균일 매니폴드 근사와 투영(UMAP)

R에서의 차원 축소

Matt Pickard

Owner, Pickard Predictives, LLC

PCA, t-SNE, UMAP

PCA, t-SNE, UMAP 비교

R에서의 차원 축소

PCA, t-SNE, UMAP

PCA, t-SNE, UMAP 비교

R에서의 차원 축소

PCA, t-SNE, UMAP

PCA, t-SNE, UMAP 비교

R에서의 차원 축소

PCA, t-SNE, UMAP

PCA, t-SNE, UMAP 비교

R에서의 차원 축소

PCA, t-SNE, UMAP

PCA, t-SNE, UMAP 비교

UMAP도 유사한 하이퍼파라미터를 튜닝할 수 있습니다.

R에서의 차원 축소

UMAP 플롯

library(embed)

set.seed(1234) umap_df <- recipe(Attrition ~ ., data = attrition_df) %>% step_normalize(all_predictors()) %>% step_umap(all_predictors(), num_comp = 2) %>% prep() %>% juice()
umap_df %>% ggplot(aes(x = UMAP1, y = UMAP2, color = Attrition)) + geom_point(alpha = 0.7)
R에서의 차원 축소

UMAP: 직원 이직

직원 이직의 UMAP 플롯

R에서의 차원 축소

tidymodels에서의 UMAP

레시피 생성

umap_recipe <-  recipe(Attrition ~ ., data = train) %>% 
  step_normalize(all_predictors()) %>% 
  step_umap(all_predictors(), num_comp = 4)

모델 스펙 생성

umap_lr_model <- linear_reg()
R에서의 차원 축소

tidymodels에서의 UMAP

워크플로 생성

umap_lr_workflow <-  workflow() %>% 
  add_recipe(umap_recipe) %>% 
  add_model(umap_lr_model)

워크플로 적합

umap_lr_fit <- umap_lr_workflow %>% 
  fit(data = train)
R에서의 차원 축소

tidymodels에서의 UMAP

모델 평가

predict_umap_df <- test %>% 
  bind_cols(predict = predict(umap_lr_fit, test))

rmse(predict_umap_df, Attrition, .pred_class)
R에서의 차원 축소

연습해 봅시다!

R에서의 차원 축소

Preparing Video For Download...