Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Dimensionality Reduction in R

Cursus bekijken

Oefeninstructies

  • 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.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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 bewerken en uitvoeren