LoslegenKostenlos loslegen

Fitting a logistic regression model

In addition to regression models, the parsnip package also provides a general interface to classification models in R.

In this exercise, you will define a parsnip logistic regression object and train your model to predict canceled_service using avg_call_mins, avg_intl_mins, and monthly_charges as predictor variables from the telecom_df data.

The telecom_training and telecom_test tibbles that you created in the previous lesson have been loaded into this session.

Diese Übung ist Teil des Kurses

Modeling with tidymodels in R

Kurs anzeigen

Interaktive Übung

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

# Specify a logistic regression model
logistic_model <- ___ %>% 
  # Set the engine
  ___ %>% 
  # Set the mode
  ___

# Print the model specification
logistic_model
Code bearbeiten und ausführen