text_plain_output_1.png
from sklearn.model_selection import KFold

import pandas as pd

boston = pd.read_pickle('https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBM-ML240EN-SkillsNetwork/labs/data/boston_housing_clean.pickle')

boston.keys()

boston_df = boston['dataframe']

X = boston_df.drop('MEDV', axis=1)

X.shape

kf = KFold(n_splits=3, shuffle=True)

type(kf.split(X))

for training_set, test_set in kf.split(X):
    print('Training set', training_set, '\n', 'Total:', len(training_set))
    print('Test set', test_set, '\n', 'Total:', len(test_set))
    print('  ')