You're working with patient visit data over time and want to predict an outcome for each visit by looking at what happened during previous visits. That’s a common setup in time-based healthcare modeling. While XGBoost doesn’t “remember” sequences like some deep learning models, you can help it learn from the past by creating smart features that summarize previous visits.
Sort Your Data
Add Lag Features
Add Rolling or Cumulative Stats
Patient-Specific
Handle Missing Values
Split Carefully