Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

traint test split on column id

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

train = df.iloc[train_inds]
test = df.iloc[test_inds]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #traint #test #split #column #id
ADD COMMENT
Topic
Name
6+8 =