LoslegenKostenlos loslegen

UMAP reduction in a decision tree model

Now that you have visualized a UMAP reduction, let's put UMAP to work in model building. In this exercise, you will build a workflow that applies UMAP in a preprocessing recipe to the credit data and then use the extracted components to build a decision tree model. The credit data train and test sets are provided for you. The embed library has already been loaded.

Diese Übung ist Teil des Kurses

Dimensionality Reduction in R

Kurs anzeigen

Anleitung zur Übung

  • Create a recipe to apply a UMAP reduction to the data, resulting in four extracted components.
  • Create a decision_tree model for classification.
  • Add the UMAP recipe and the decision tree model to a workflow.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Create a recipe to apply UMAP feature extraction
umap_recipe <-  recipe(___ ~ ___, data = ___) %>% 
  ___(___()) %>% 
  ___(___(), outcome = vars(___), num_comp = ___)

# Specify a decision tree model
umap_dt_model <- ___(___ = "___")

# Add the recipe and model to a workflow
umap_dt_workflow <-  ___() %>% 
  add_recipe(___) %>% 
  add_model(___)
umap_dt_workflow
Code bearbeiten und ausführen