LoslegenKostenlos loslegen

Creating training and test sets

Before you create any model, it is important to split your dataset into two: a training set which will be used to build your churn model, and a test set which will be used to validate your model. To do this, you can use the train_test_split() function from sklearn.model_selection.

You'll practice creating training and test sets in this exercise. The telco DataFrame is available in your workspace.

Diese Übung ist Teil des Kurses

Marketing Analytics: Predicting Customer Churn in Python

Kurs anzeigen

Interaktive Übung

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

# Import train_test_split
Code bearbeiten und ausführen