Skip to content

edbajric/SupplementRecsML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Fitness Supplement Recommendation System (Machine Learning)

Overview

This project implements a machine learning–based recommendation system for fitness supplements using real-world observational data. The system predicts expected weight change, body fat change, and performance improvement for gym users based on their profile, training habits, and supplement usage, and then recommends the most suitable supplement aligned with a user’s fitness goal.

Key Features:

  • Predicts weight, body fat, and performance changes
  • Recommends supplements based on user goals
  • Emphasizes interpretability and explainability

Dataset

The dataset contains anonymized questionnaire and fitness app–tracking data, including:

  • Demographics
  • Training frequency and type
  • Diet type and fitness level
  • Supplement usage details
  • Observed changes in weight, body fat percentage, and performance

⚠️ Note: The dataset is not included in this repository due to licensing and size considerations. You must download it manually from Kaggle.


Project Objective

To build a Digital Personal Trainer that recommends supplements aligned with a user’s primary fitness goal:

  • Muscle gain
    • Fat loss
    • Performance improvement

Recommendations are based on observed data patterns rather than arbitrary rules and include interpretable insights.


Machine Learning Formulation

Given a user profile and supplement configuration, the system predicts:

  • Weight change (kg)
  • Body fat change (%)
  • Performance improvement (%)

The recommendation engine evaluates all supplements and selects the optimal option based on the user’s goal.


Methods

Data Preprocessing

  • Textual age and height ranges converted to numeric values
  • Supplement and supplement type merged into a single categorical feature
  • Categorical variables encoded using one-hot encoding
  • Numerical variables kept on natural scale
  • No missing values in core variables

Models Implemented

Three regression algorithms were trained for each target variable:

  • Linear Regression
  • Random Forest Regressor
  • Gradient Boosting Regressor

Model evaluation used 5-fold cross-validation with:

  • MAE
  • RMSE
  • Adjusted R²

Results Summary

  • Random Forest consistently achieved the best performance across all targets
  • Tree-based models significantly outperformed Linear Regression
  • Recommendations aligned with real-world fitness practices:
    • Creatine → muscle gain
    • Pre-workout → performance boost
    • L-carnitine → fat loss

An interactive Jupyter widget allows users to input their profile and receive ranked supplement recommendations with predicted outcomes.


Repository Structure

.
├── project_ML.ipynb        # Main Jupyter Notebook (analysis, modeling, evaluation)
├──  README.md               # Project documentation
└──  .gitignore
     

How to Run the Project

  1. Clone the repository
    git clone https://github.com/edbajric/SupplementRecsML.git
    cd SupplementRecsML
  2. Download the dataset
    • Go to the Kaggle link
    • Download the CSV file
    • Place it in the project directory (or update the notebook path accordingly)
  3. Open the notebook
    jupyter notebook project_ML.ipynb
  4. Run all cells
    • Run the notebook top to bottom to reproduce preprocessing, model training, evaluation, and recommendations.

Requirements

The project uses standard Python data science libraries, including:

  • pandas
  • numpy
  • scikit-learn
  • matplotlib / seaborn
  • ipywidgets

(Exact versions are not pinned; standard recent versions are sufficient.)


Limitations

  • The dataset is observational, not experimental
  • Many influential factors are not captured (sleep, genetics, injuries, caloric intake, etc.)
  • Predictions should be treated as supportive guidance, not medical or nutritional advice
  • Recommendations do not replace professional consultation

References

  1. Kaggle. (2023). Fitness Supplement Effect Tracking Dataset. Link
  2. P. C. Magalhães et al. (2025). Machine learning classification of consumption habits of creatine supplements in gym goers. RBNE – Brazilian Journal of Sports Nutrition, 19(114):1–13. Link
  3. J. Wang, C. He, and Z. Long. (2023). Establishing a machine learning model for predicting nutritional risk through facial feature recognition. Frontiers in Nutrition, 10:1219193. doi:10.3389/fnut.2023.1219193

About

Fitness Supplement Recommendation System is a machine‑learning project that predicts expected changes in weight, body fat, and performance for gym users and then recommends the most suitable supplement for their fitness goal using a real‑world Kaggle dataset and regression models.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors