1. Learn
  2. /
  3. Courses
  4. /
  5. End-to-End Machine Learning

Exercise

KFold cross validation

When working with ML models, it's essential to evaluate their performance on unseen data while ensuring that. One common technique for this purpose is k-fold cross-validation. In this exercise, you'll explore how the k-fold cross-validation technique splits a dataset into training and testing sets. KFold is imported for you, as well as the heart disease dataset features heart_disease_df_X.

Instructions

100 XP
  • Create a KFold object with k=5, shuffle=True, and random_state=42
  • Split the data using kfold.split()
  • Print out the number of datapoints in the train and test splits