CommencerCommencer gratuitement

Creating recipe objects

In the previous chapter, you fit a logistic regression model using a subset of the predictor variables from the telecom_df data. This dataset contains information on customers of a telecommunications company and the goal is predict whether they will cancel their service.

In this exercise, you will use the recipes package to apply a log transformation to the avg_call_mins and avg_intl_mins variables in the telecommunications data. This will reduce the range of these variables and potentially make their distributions more symmetric, which may increase the accuracy of your logistic regression model.

Cet exercice fait partie du cours

Modeling with tidymodels in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Specify feature engineering recipe
telecom_log_rec <- recipe(___, 
                          data = ___) %>%
  # Add log transformation step for numeric predictors
  ___(___, ___, base = 10)

# Print recipe object
telecom_log_rec
Modifier et exécuter le code