This repository contains code for predicting weight status using the K-means clustering algorithm and generating a diet plan based on the predicted weight status.
This project aims to help individuals understand their weight status and generate a personalized diet plan to maintain or achieve a healthy weight. It utilizes machine learning techniques to predict weight status and recommends a diet plan accordingly.
weight_status_prediction.ipynb
: Jupyter Notebook containing the code for K-means clustering to predict weight status.diet_plan_generation.ipynb
: Jupyter Notebook containing the code for generating a diet plan based on the predicted weight status.data.csv
: Dataset used for weight status prediction.food_data.csv
: Dataset containing food information for generating the diet plan.
- Calculates the Euclidean distance between two points in a multidimensional space.
- Used within the K-means clustering algorithm to measure the distance between data points and cluster centroids.
- Assigns each data point to the nearest cluster centroid based on Euclidean distance.
- Returns the labels indicating the assigned cluster for each data point.
- Computes the new centroids of the clusters based on the mean of the points assigned to each cluster.
- Returns the updated cluster centroids.
- Implements the K-means clustering algorithm to group data points into clusters.
- Returns the cluster labels and centroids.
- Predicts the weight status of a user based on their input data.
- Utilizes the K-means clustering model and majority class labels within clusters.
- Generates a diet plan based on the predicted weight status.
- Calculates the average daily calories for each weight status category.
- Selects food items from a dataset based on calorie content and weight status.
- Uses a LLM to help make a diet plan.
- Install the required packages using
pip install -r requirements.txt
. - Open and run the
Diet_Planner.ipynb
notebook to predict weight status and make a diet plan. - Ensure that the
Dataset.csv
file is in the same directory as the notebook. - Ensure that the
Food and Calories - Sheet 1.csv
file is in the same directory as the notebook.
- Python 3
- Jupyter Notebook
- Pandas
- Numpy (along with other used libraries)
Feel free to contribute by opening issues or submitting pull requests.