Let's say I have time series data.
'person':['A','A','A','B','B','B','C,'C','C']
'weight':[120, 123, 135, 140, 150, 151, 120, 120, 121]
'height':[5, 5, 5, 6, 6, 6, 4.5, 4.5, 4.5]
'running_time':[60,61,63,34,50,55, 60, 70, 80]
'week':[1, 2, 3, 1, 2, 3, 1, 2, 3}
Let's assume the dataset is much larger than that, of course. Let's assume I want to generate a model that will use person, weight, height, and week to predict running time (this is just an example, let's forget about other better ways to do this).
For a train test split or cross-validation, I could completely randomly split the data, where some of person A's measurements will be in train, and some in test. Or I could randomly split based on people. In other words, 70% of people go into train, 30% into test.
What would be the best way to do this?