This repository contains multiple machine learning models and techniques used to predict glucose levels based on various features. The project focuses on experimenting with different algorithms, model stacking, and ensemble learning approaches to improve prediction accuracy.
In this project, I explored different machine learning models and their combinations to create an ensemble model that can predict glucose levels effectively. The main approaches include:
- Individual Models: Training different models like XGBoost, LightGBM, Random Forest, and CatBoost on the dataset to assess their performance individually.
- Model Stacking: Combining predictions from multiple models (XGBoost, LightGBM, and CatBoost) with a Ridge Regression meta-model to improve overall performance.
- Ensemble Learning with K-Folds: Implementing K-Fold cross-validation to train and ensemble models like XGBoost, LightGBM, Random Forest, and TabNet for final predictions.
- XGBoost: Gradient boosting framework for high performance with structured data.
- LightGBM: High-performance gradient boosting framework based on decision trees.
- Random Forest: Ensemble of decision trees to improve prediction accuracy.
- CatBoost: Gradient boosting framework optimized for categorical features.
Stacking combines multiple model predictions into a meta-model to boost accuracy. The steps include:
- Training base models: XGBoost, LightGBM, and CatBoost.
- Using a Ridge Regression meta-model to combine predictions from base models.
- K-Fold Cross-Validation: The dataset is divided into 5 folds. Models are trained on 4 folds and validated on the remaining fold. This is repeated for all folds.
- Ensembling: Predictions from models like XGBoost, LightGBM, Random Forest, and TabNet are averaged for each fold, and final predictions are averaged across folds.
The ensemble predictions from all models and folds are averaged to create the final predictions submitted as submission.csv.
The dataset used for this project can be downloaded from Kaggle:
BRIST1D Kaggle Competition Dataset
-
Clone this repository:
git clone https://github.com/SheemaMasood381/Blood-Glucose-Levels-Prediction-2024-kaggle-competition.git cd Blood-Glucose-Levels-Prediction-2024-kaggle-competition -
Install the required Python packages:
pip install -r requirements.txt
-
Download the dataset from the Kaggle BRIST1D Competition and place the files in the appropriate folder (e.g.,
data/). -
Run the Jupyter notebooks step-by-step to train models and generate predictions.
- Stacking Approach: Combining XGBoost, LightGBM, and CatBoost with a Ridge Regression meta-model provided robust predictions.
- K-Fold Ensembling: Combining XGBoost, LightGBM, Random Forest, and TabNet predictions across folds resulted in the best generalization.
- Metrics: Models were evaluated using RMSE, R², and MAE.
The final ensemble predictions are saved in submission.csv. This file contains the predicted glucose levels for the test data.
- Experiment with additional models like Neural Networks for further improvement.
- Perform hyperparameter optimization using Grid Search or Random Search.
- Explore advanced ensembling techniques like weighted averages or Bayesian model averaging.
- Dataset provided by the BRIST1D Kaggle Competition.
- Libraries used: XGBoost, LightGBM, CatBoost, and others.
This project is licensed under the MIT License. See the LICENSE file for details.