Skills application solution
Skills application solution
Compare your skills application output to the solution example below provided by Multiverse subject matter experts.
Solution In this solution, you applied a robust and realistic data handling workflow using the MediCareAI dataset.1. Data splitting and leakage prevention
-
Used a temporal holdout split, training on data before July 2024 and testing on the following six months.
-
Verified that no admission dates in the test set precede those in the training set, confirming no temporal leakage.
-
Applied stratified 5-fold cross-validation within the training set for hyperparameter tuning to maintain balance across folds.2. Handling class imbalance
-
Used SMOTE (Synthetic Minority Oversampling Technique) to generate synthetic examples of readmitted cases.
-
Verified post-resampling balance with approximately 50:50 class distribution in the training set.
-
Ensured that SMOTE was applied only on the training data to avoid leakage into the test set.3. Data quality protocols
-
Performed median imputation for missing numerical values (BMI, glucose, blood pressure).
-
Capped extreme glucose and blood pressure values at the 1st and 99th percentiles.
-
Removed 80 duplicate rows to eliminate redundant records.
-
Validated final data integrity by checking distributions and summary statistics after cleaning.
Outcome: A clean, balanced, and temporally consistent dataset was prepared for model training. The solution improves model generalisation and fairness while maintaining realistic conditions for evaluation.
Why this solution works well
- Demonstrates methodical leakage prevention by using a time-based split.
- Balances classes effectively using SMOTE without distorting distributions.
- Implements reproducible data quality checks that could easily be automated in production.
Tips for applying this skill in your role
- Always design data splits that mirror real-world prediction scenarios (e.g., future vs. past data).
- Handle imbalance carefully, oversampling and weighting are powerful but must be isolated to training data.
- Build modular preprocessing pipelines that include data validation checks before training or deployment.
Action item: Reflection
- Compare your output to the solution example provided. What did you do well? Where could you improve?
- How might you automate or scale your data quality and leakage prevention steps across multiple ML pipelines in your organisation?