LoslegenKostenlos loslegen

Streamlining the modeling process

The last_fit() function is designed to streamline the modeling workflow in tidymodels. Instead of training your model on the training data and building a results tibble using the test data, last_fit() accomplishes this with one function.

In this exercise, you will train the same logistic regression model as you fit in the previous exercises, except with the last_fit() function.

Your data split object, telecom_split, and model specification, logistic_model, have been loaded into your session.

Diese Übung ist Teil des Kurses

Modeling with tidymodels in R

Kurs anzeigen

Anleitung zur Übung

  • Pass your logistic_model object into the last_fit() function.
  • Predict canceled_service using avg_call_mins, avg_intl_mins, and monthly_charges.
  • Display the performance metrics of your trained model, telecom_last_fit.

Interaktive Übung

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

# Train model with last_fit()
telecom_last_fit <- ___ %>% 
  last_fit(___,
           split = ___)

# View test set metrics
telecom_last_fit %>% 
  ___
Code bearbeiten und ausführen