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.
Saved automatically
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.
Related Questions in Data Science & Machine Learning
Why does feature scaling matter for some models more than others?
Medium level • 3 views
How do classification and regression differ? Give an example of each.
Easy level • 2 views
Why should training, validation, and test datasets have different roles?
Easy level • 2 views
What does PCA do, and what are its limitations?
Medium level • 2 views
How would you compare two models without mistaking random variation for an improvement?
Medium level • 1 views