Answers for "how to split test and train data in python pandas"

1

split data train, test by id python

train_inds, test_inds = next(GroupShuffleSplit(test_size=.20, n_splits=2, random_state = 7).split(df, groups=df['Group_Id']))

train = df.iloc[train_inds]
test = df.iloc[test_inds]
Posted by: Guest on July-17-2020

Code answers related to "how to split test and train data in python pandas"

Python Answers by Framework

Browse Popular Code Answers by Language