Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have dataset that include (vertical, lateral, sagittal, bwwform, ecgwform, user, wid, wno, eid, exercise, setno, hr, br, hrv) attribute. The wid attribute has 3 sets of each exercise in a session.
how to apply train/test data split based on wid attribute (Set No).
for example

If wid = `1,2,3,4,5,6`

wid(1) = set {`1,2,3`} (3 sets of each exercise)

wid(1) =
{ w1 s1
w1 s2
w1 s3 }


How to split into train/test? 2 sets for train and 1 set for test

What I have tried:

As you can see in the python code I am trying to split train/test data.  

        from sklearn.model_selection import train_test_split
        training_data, testing_data = train_test_split(df_train, test_size = 0.2)
        print(f"No. of training examples: {training_data.shape[0]}")
        print(f"No. of testing examples: {testing_data.shape[0]}")
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900