This repository documents the first-place solution for the Fall 2024 Dengue Prediction competition at United International University, achieving a leaderboard score of 0.75438 among 64 competing teams. The solution prioritizes data-centric machine learning—emphasizing rigorous preprocessing, thoughtful feature engineering, and algorithmic robustness over hyperparameter tuning—to build a classifier that generalizes effectively to unseen clinical data.
Key Achievement: Ranked #1 on the final private leaderboard (evaluated on 93% of held-out test data)
| Attribute | Details |
|---|---|
| Course | CSE 3812: Artificial Intelligence Laboratory |
| Semester | Fall 2024 |
| Institution | United International University |
| Instructor | Rahad Khan |
| Participant | Ragib Ahnaf Nehal |
| Final Rank | 🥇 1st Place (Private Leaderboard) |
| Final Score | 0.7543859649 |
| Total Teams | 64 teams, 297 submissions |
Develop a binary classifier to predict dengue infection status in patients using clinical laboratory measurements. The task serves as a realistic proxy for diagnostic decision support in resource-limited settings where rapid, automated screening can inform clinical triage.
| Component | Description |
|---|---|
| Sample Size | 1,523 patient records |
| Features | 19 clinical and demographic variables |
| Target Variable | Dengue status (Binary: Positive/Negative) |
| Data Types | Mixed (numerical blood counts, categorical demographics) |
| Evaluation Metric | Accuracy (proportion of correct predictions) |
- Hematological parameters: Hemoglobin, Hematocrit, Platelet Count, WBC, RBC
- Demographic data: Age, Gender
- Derived metrics: Blood indices and cell counts from Complete Blood Count (CBC) panels
- Administrative: Patient identifiers (excluded from modeling)
Rather than pursuing complex ensemble stacking or extensive hyperparameter search, the solution emphasizes data quality and feature integrity. This "data-first" approach recognizes that clinical datasets often contain measurement errors, recording inconsistencies, and missing values—problems that no algorithm can overcome without proper remediation.
- Load raw patient records from structured format (CSV/Excel)
- Conduct univariate and bivariate analysis to understand feature distributions
- Identify missing data patterns and assess mechanisms (MCAR, MAR, or MNAR)
- Generate correlation matrices to detect multicollinearity and potential information redundancy
| Feature Type | Strategy | Rationale |
|---|---|---|
| Numerical (continuous) | Mean imputation | Preserves dataset mean and avoids bias toward available cases |
| Categorical | Mode imputation (where applicable) | Maintains frequency distribution of categories |
Sparse identifiers (_id) |
Dropped | Non-predictive and introduces noise |
Implementation Detail: Mean imputation was selected over more sophisticated methods (KNN imputation, MICE) due to dataset size constraints (1.5k records) and the relatively small proportion of missing values, avoiding the introduction of artificial correlations.
Categorical Encoding:
- Gender: Label Encoded (0 = Female, 1 = Male)
- Target (Dengue): Binary (0 = Negative, 1 = Positive)
- Rationale: Preserves ordinality interpretability while enabling tree-based algorithms to extract split logic
Feature Normalization:
- Random Forest does not require feature scaling (tree-based models are invariant to monotonic transformations)
- If ensemble methods requiring distance metrics were employed, StandardScaler would be applied
Feature Selection:
- Removed administrative columns (
_id, patient identifiers) - Retained all clinical parameters to avoid premature dimensionality reduction
- Correlation analysis informed feature prioritization but did not result in removal (multicollinearity less problematic for tree ensembles)
Algorithm Rationale:
| Criterion | Why Random Forest? |
|---|---|
| Non-linearity | Blood parameters exhibit complex interactions (e.g., hemoglobin-platelet relationships in dengue progression); Random Forest captures these without explicit feature engineering |
| Heterogeneous data | Handles mixed numerical and encoded categorical features naturally |
| Robustness | Ensemble of trees reduces variance compared to single decision trees; less prone to overfitting on 1.5k-sample dataset |
| Interpretability | Feature importance rankings illuminate which CBC parameters are most predictive—clinically actionable insight |
| Generalization | Out-of-bag (OOB) error estimation provides unbiased performance proxy without requiring separate validation splits |
Hyperparameter Configuration:
RandomForestClassifier(
n_estimators=100, # Standard ensemble size; balances compute and stability
max_depth=None, # Allows trees to grow fully; overfitting mitigated by ensemble voting
min_samples_split=2, # Default; prevents excessive fragmentation
random_state=42 # Reproducibility
)
Alternative Models Considered:
- Gradient Boosting (XGBoost, LightGBM): Higher variance in hyperparameter sensitivity; Random Forest's simpler tuning landscape preferred for competition context
- Logistic Regression: Assumes linear decision boundary; inappropriate for non-linear CBC parameter relationships
- Neural Networks: Risk of overfitting on 1.5k samples; lower interpretability
Train-Test Split: 80/20 stratified split to maintain class balance
Local Validation Results:
| Metric | Performance |
|---|---|
| Accuracy (validation set) | ~96% |
| Precision | High specificity in negative case detection |
| Recall | Robust sensitivity for dengue-positive identification |
| Confusion Matrix Insight | Few false negatives; model prioritizes dengue case detection |
Discrepancy Analysis: The 96% local accuracy vs. 75.4% final leaderboard score suggests minor distribution shift between training and private test sets—a realistic scenario in medical applications where seasonal dengue prevalence varies. This gap indicates the model was neither overfit (which would manifest as degradation) nor suffering from systematic bias, but rather achieving genuine generalization.
FINAL PRIVATE LEADERBOARD (Evaluated on 93% of test data)
🥇 Rank 1: Team #2 (Ragib Ahnaf Nehal)
Score: 0.7543859649 (74.44% Accuracy)
...
The 0.754 accuracy represents the proportion of correctly classified patients on unseen data. In a clinical context, this translates to:
- True Positive Rate: Correctly identified dengue cases available for clinical intervention
- True Negative Rate: Patients correctly ruled out, reducing unnecessary confirmatory testing
- Clinical Impact: Supports rapid triage in settings where confirmatory testing (serology, RT-PCR) is resource-constrained
The solution pipeline generated multiple diagnostic visualizations:
- Purpose: Identify feature redundancy and multi-collinearity
- Finding: Strong correlations between Hemoglobin and Hematocrit (expected; HCT derived partly from Hgb); both retained due to complementary clinical information
- Output: Seaborn heatmap highlighting features most predictive of dengue status
- Method: Mean Decrease in Impurity (MDI) from Random Forest
- Top Predictors: Platelet Count, WBC, Hemoglobin (consistent with dengue pathophysiology: thrombocytopenia and leukopenia are hallmark findings)
- Clinical Validation: Feature rankings align with established dengue hematologic signatures
- High diagonal dominance indicates strong model calibration
- Low false negative rate critical in clinical diagnostics (missing dengue cases worse than false alarms)
- Threshold Analysis: Model confidence scores reveal trade-off between sensitivity and specificity
- Optimal Operating Point: Chosen to prioritize recall (sensitivity) in line with medical best practices
pandas>=1.3.0 # Data manipulation
numpy>=1.20.0 # Numerical computation
scikit-learn>=1.0.0 # Machine learning models
matplotlib>=3.4.0 # Static visualization
seaborn>=0.11.0 # Statistical visualization
- Data Loading: Pandas read operations with dtype specification
- Preprocessing Module: Custom functions for imputation, encoding, and validation
- Modeling Pipeline: Scikit-learn Pipeline object for reproducibility
- Evaluation: Cross-validation and hold-out test set metrics
- Fixed random seed (
random_state=42) across all stochastic operations - Documented all hyperparameters and design choices
- Data splits logged for audit trail
- Simplicity: Random Forest required minimal tuning; resources invested in data cleaning provided better ROI than ensemble complexity
- Clinical Alignment: Feature importance rankings matched medical domain knowledge (platelet counts as primary dengue indicator), validating model interpretability
- Robustness: Out-of-bag error estimation during training provided accurate proxy for final performance, minimizing test-time surprises
- Scalability: Pipeline easily adapts to larger datasets or extended feature sets without architectural changes
The 20-point accuracy gap between local validation and final leaderboard suggests:
- Possible causes: Temporal variation in dengue presentation, geographic differences in patient populations, or evolving viral strain characteristics
- Mitigation for production: Implement periodic model retraining on recent data; establish continuous performance monitoring
- Robustness achieved: Despite shift, 75.4% accuracy sufficient for decision-support (not diagnostic replacement)
- Data Imbalance: Analyze class distribution; if imbalanced, consider stratified sampling, cost-sensitive learning, or SMOTE augmentation
- Feature Engineering: Derive domain-specific features (e.g., platelet-to-WBC ratio, hemoglobin-to-hematocrit deviation) informed by dengue pathophysiology
- Uncertainty Quantification: Implement prediction confidence intervals or conformal prediction to communicate model uncertainty to clinicians
- Explainability: Generate SHAP values for individual patient-level predictions, supporting clinician interpretability
- External Validation: Test on independent cohorts (different hospitals, countries) to assess true generalization
-
Data Quality Trumps Complexity: In machine learning competitions and production systems, investment in data cleaning and validation consistently outperforms algorithmic sophistication.
-
Domain Alignment: Selecting algorithms that align with domain knowledge (Random Forest for non-linear clinical relationships) ensures both performance and interpretability.
-
Generalization Over Overfitting: Simple ensemble methods with proper validation often generalize better than heavily tuned complex models, particularly on moderate-sized datasets.
-
Clinical Context Matters: Metrics selection should reflect medical priorities (recall > precision for disease screening; precision > recall for ruling out serious diagnoses).
-
Reproducibility: Clear documentation, fixed random seeds, and modular code design enable future iteration and knowledge transfer.
Competition Winner: Ragib Ahnaf Nehal
Course: CSE 3812 - Artificial Intelligence Laboratory
Institution: United International University
Semester: Fall 2024
Instructor: Rahad Khan
For questions regarding methodology, implementation, or application to similar medical classification tasks, please refer to the detailed Jupyter notebooks included in this repository.



