Inspiration

The inspiration behind MealMatch came from the growing need for personalized nutrition solutions in today’s fast-paced world. With so many dietary preferences, nutritional goals, and food options available, it can be overwhelming to decide what to eat. I wanted to create a tool that simplifies this process by providing tailored meal recommendations based on individual preferences and nutritional needs.

What I Learned

Building MealMatch taught me several valuable skills:

  1. Data Preprocessing: I learned how to clean and normalize a dataset to make it suitable for machine learning.
  2. Machine Learning: I gained hands-on experience with the K-Nearest Neighbors (KNN) algorithm for recommendation systems.
  3. API Development: I explored Flask to create a RESTful API that serves meal recommendations.
  4. User Interaction: I designed a simple command-line interface (CLI) to make the system accessible and user-friendly.

How I Built the Project

  1. Dataset Preparation: I used the provided cleaned_nutrition_dataset.csv to create a comprehensive meal database. The dataset was preprocessed to normalize numerical features like calories, protein, fat, and carbs.
  2. Machine Learning Model: I implemented the KNN algorithm to find meals similar to the user’s preferences. The model was trained on the preprocessed dataset to ensure accurate recommendations.
  3. Flask API: I built a RESTful API using Flask to handle user requests and return meal recommendations. The API accepts user preferences (e.g., calorie limit, protein intake) and returns a list of matching meals.
  4. Command-Line Interface (CLI): To make the system easy to use, I created a CLI that interacts with the Flask API. Users can input their preferences, and the CLI displays personalized meal recommendations.

Challenges Faced

  1. Data Mismatch: Initially, the KNN model expected 21 features, but the user input only provided 5. I resolved this by ensuring the input data matched the training data format.
  2. User Experience: Designing a simple yet effective interface was challenging. I opted for a CLI to keep things straightforward and accessible.
  3. Debugging: Integrating the Flask API with the CLI required careful debugging to ensure seamless communication between the two components.

Future Enhancements

  • Dietary Filters: Add support for dietary preferences like vegan, gluten-free, or keto.
  • Meal Planning: Allow users to plan meals for an entire week.
  • Deployment: Deploy the Flask API online so users can access it from anywhere.
Share this project:

Updates