Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

🎓 Predicting Student Health Risk (Kaggle S6E7)

📌 Project Overview

This repository contains a highly optimized, end-to-end Machine Learning pipeline for the Kaggle Playground Series (Season 6, Episode 7): Predicting Student Health Risk.

The goal of this competition is to accurately predict the health_condition of a student (e.g., at-risk, fit, unhealthy) based on their physical metrics and lifestyle choices. The evaluation metric for this competition is Balanced Accuracy.

🚀 Key Strategies & Highlights

  • Dataset Augmentation: The competition data is synthetic, heavily inspired by the real-world College Student Health Behavior Dataset. To combat synthetic noise, we augment our training data by merging it with the original dataset, bringing the total training rows to ~740,000.
  • Feature Engineering:
    • Ordinal Encoding: Re-mapped ordered categories (e.g., sleep_quality from poor/average/good to 0/1/2).
    • Interaction Features: Created custom metrics like bmi_x_exercise and sleep_score (Sleep Duration × Sleep Quality).
  • 5-Fold Cross-Validation Ensemble: We utilized a strict 5-fold Stratified K-Fold cross-validation strategy. Within each fold, we trained and ensembled two of the fastest and most robust gradient boosting frameworks: LightGBM and XGBoost.
  • Prior Correction for Balanced Accuracy: The competition is evaluated on Balanced Accuracy, but the dataset suffers from extreme class imbalance (~86% of students are 'at-risk'). We applied a mathematical Prior Correction technique to the blended model probabilities, artificially re-weighting the predictions against the training class priors. This forces the model to directly optimize for Balanced Accuracy.

📈 Leaderboard Performance

Model / Pipeline Public Leaderboard Score
Fast LightGBM Baseline 0.94904
Optimized 5-Fold Ensemble 0.94789

(Note: While the fast baseline scored slightly higher on the Public Leaderboard (which only tests 20% of hidden data), the 5-Fold Ensemble with prior correction is mathematically more robust and designed to prevent overfitting on the final Private Leaderboard.)

📁 Repository Structure

  • final_solution.ipynb: The complete Jupyter Notebook containing the data loading, feature engineering, 5-fold ensemble loop, and prior correction logic. It is dynamically written to work effortlessly on local environments or Kaggle Cloud Kernels.
  • (Note: The CSV datasets are excluded from this repo via .gitignore due to size limits. You can download the data from the Kaggle competition page).

🛠️ Usage

  1. Download the data from the Kaggle Competition.
  2. Download the Original Dataset.
  3. Place train.csv and test.csv in the root directory.
  4. Place student_health_dataset_50k.csv in original_data/.
  5. Run the final_solution.ipynb notebook from top to bottom.

Authored by shibomdas

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages