Verified Jobs Live
Data Science & Machine Learning Medium Level ~3 min read

How would you handle a dataset where several rows belong to the same patient?

Interactive Practice Mode
Formulate your thoughts or take notes before revealing the model solution.
Model Answer & Deep-Dive Explanation

Keep all rows for one patient in the same evaluation partition when the objective is generalization to unseen patients. A random row split can let the model recognize patient-specific patte s from training and produce an overly optimistic score. Use group-aware splitting and ensure preprocessing is fitted inside each training fold. If the actual objective is future predictions for existing patients, use a time-aware design that prevents future information from leaking backward. State the deployment population explicitly because it determines which split answers the right question.