Sign inSign up

bytebard101/wine_research

By bytebard101

β€’Updated 8 months ago

A web app that can predict wine quality by taking physicochemical data as input.

Image
Machine learning & AI
0

1.1K

bytebard101/wine_research repository overview

⁠🍷 Wine Quality Classifier

This project is regularly updated in GitHub. Click here⁠ to take a look.

A machine learning–powered web application that assesses the quality of wine based on its physicochemical properties. Built with Flask, Scikit-Learn, and Pandas, this project blends oenology with machine learning to create an interactive tool for wine quality analysis. This project demonstrates how data science can be applied to the food and beverage industry to standardize quality assessment.


β πŸš€ Overview

The Wine Quality Classifier uses a trained Machine Learning Model (optimized via GridSearchCV) to predict whether a given wine sample is of Low, Average, or High quality. The model is hosted via a Flask web app where users can input parameters (like acidity, sugar, and alcohol content) and get instant quality assessments.


⁠🧠 Motivation

Wine tasting is traditionally a subjective art, reliant on the refined palates of sommeliers. However, the chemical composition of wine plays a decisive role in its quality. This project aims to bridge the gap between chemistry and sensory experience, providing an objective, data-driven approach to classifying wine quality.


β πŸ“Š Dataset

  • Source: Wine Quality Dataset (WineQT)⁠
  • Classes:
    • Low β†’ 0 (Quality 3, 4)
    • Average β†’ 1 (Quality 5, 6)
    • High β†’ 2 (Quality 7, 8)
  • Features:
    • Fixed Acidity, Volatile Acidity, Citric Acid
    • Residual Sugar, Chlorides
    • Free & Total Sulfur Dioxide
    • Density, pH, Sulphates, Alcohol

β βš™οΈ Model Architecture

The model generation pipeline (fit.py) includes the following steps:

StepDescription
ImputationMissing values handled using median strategy
ScalingStandardized with StandardScaler
AugmentationSMOTE (Synthetic Minority Over-sampling Technique) for class balance
DimensionalityPCA (Principal Component Analysis) for feature reduction
ClassifierOptimized Estimator (Random Forest / XGBoost / KNN) found via GridSearchCV

Final model artifacts are serialized with joblib as:

models/
β”œβ”€β”€ model.pkl
└── columns.pkl

⁠🧩 Project Structure

Wine_Research/
β”œβ”€β”€ Datasets/
β”‚   └── WineQT.csv           # Primary dataset
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ columns.pkl          # List of feature names
β”‚   └── model.pkl            # Serialized trained model
β”œβ”€β”€ reports/
β”‚   └── research.html        # Static HTML report of the research notebook
β”œβ”€β”€ static/                  # Static assets
β”‚   β”œβ”€β”€ script.js            # Frontend interaction logic
β”‚   └── style.css            # Premium styling
β”œβ”€β”€ templates/
β”‚   └── index.html           # Main web interface
|
β”œβ”€β”€ .gitignore               # gitignore file
β”œβ”€β”€ app.py                   # Flask application entry point
β”œβ”€β”€ fit.py                   # Machine learning pipeline script
β”œβ”€β”€ LICENSE                  # Licensing information
β”œβ”€β”€ research.py              # Research and analysis script
└── requirements.txt         # Dependencies

β πŸ’» Installation & Usage

⁠1️⃣ Clone the Repository
git clone https://github.com/ByteBard58/Wine_Research.git
cd Wine_Research
⁠2️⃣ Install Dependencies
pip install -r requirements.txt
⁠3️⃣ Run the App
python app.py

The app will start at http://127.0.0.1:5000.


⁠🍷 Web Interface

Users can input physicochemical parameters such as:

  • Acidity levels (Fixed, Volatile, Citric)
  • Sugar & Salt (Residual Sugar, Chlorides)
  • Sulfur Dioxide levels
  • Density & pH
  • Alcohol content

The app returns the predicted quality tier (Low, Average, High) with a corresponding visual indicator.

Note: Due to the absence of front-end web development expertise and the lack of other contributors for the project, I had to resort to using AI tools (such as LLM services like ChatGPTβ„’, Grokβ„’, and GitHub Copilotβ„’) to create a sophisticated front-end for the web app.


⁠🧰 Tech Stack

  • Languages: Python, HTML, CSS, JavaScript
  • Libraries: Flask, Scikit-Learn, Pandas, NumPy, Joblib, XGBoost, Imbalanced-Learn
  • Dataset Source: WineQT (Kaggle)

⁠πŸͺ Author

Sakib ( ByteBard58 )

Student | Aspiring Computer Engineer | AI & ML Enthusiast

πŸ“ GitHub Profile: ByteBard58⁠


β πŸ˜ƒ Appreciation

Thank You for taking the time to review my work. I hope you enjoyed it and found it interesting. It would mean a lot to me if you could star it on GitHub 🌟

If you have any questions, suggestions, or anything you’d like to discuss, please don’t hesitate to reach out. You can find my contact information on my GitHub profile page⁠. I’m all ears! 😊

Have a great day !

Tag summary

Content type

Image

Digest

sha256:7df1b96b7…

Size

1.1 GB

Last updated

8 months ago

docker pull bytebard101/wine_research