Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import pandas as pd
- from sklearn.model_selection import KFold
- df = pd.DataFrame({'num_legs': [2, 4, 8, 0], 'num_wings': [2, 0, 0, 0], 'num_specimen_seen': [10, 2, 1, 8]}, index=[0,1,2,3])
- kf = KFold(n_splits=2, shuffle=True)
- for train_index, val_index in kf.split(df):
- df_train, df_val = df[train_index], df[val_index]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement