Key Features
User-friendly Interface
A simple, clean web form for entering wine properties, making it accessible to all users.
Regression Model
Predicts a continuous wine quality score (e.g., from 3 to 8) for nuanced evaluation.
Auto-fill Buttons
Allows for quick testing with predefined values for low, medium, and high-quality wines.
Responsive Design
Optimized for various screen sizes, providing a seamless experience on mobile and desktop.
Landing Page
An attractive, professional introduction page to welcome users to the application.
How It Works & Technology
The Machine Learning Core
The application uses a RandomForestRegressor model, a powerful ensemble learning method, which was trained on the renowned Wine Quality Red dataset from the UCI Machine Learning Repository.
To ensure prediction accuracy, all input features are scaled using a StandardScaler before being fed into the model. This process standardizes the features to have a mean of 0 and a standard deviation of 1, preventing features with larger scales from dominating the model's learning process.
Technology Stack
Project Structure
- 📁 your_project_folder/
-
- 📄 app.py # Main Flask application
- 📄 train_model.py # Script to train and save the model
- 📄 winequality-red (1).csv # Dataset for training
- 📄 requirements.txt # Python dependencies
- 📄 .gitignore # Specifies files to ignore
-
📁 templates/
- 📄 index.html # The prediction form
- 📄 index_landing.html # The landing page
-
📁 static/
- 📄 style.css # Custom CSS
Note: `scaler.pkl` and `wine_model_regression.pkl` are generated by `train_model.py` and are intentionally excluded from version control.
Setup & Installation Guide
Clone the Repository
Get the project files on your local machine.
git clone https://github.com/AliGohar2151/Wine_Prediction_System.git
cd Wine_Prediction_System
Create & Activate Virtual Environment
Isolate project dependencies. Run the command for your OS.
# Windows
python -m venv venv
.\\venv\\Scripts\\activate
# macOS/Linux
python -m venv venv
source venv/bin/activate
Install Dependencies
Install all required Python libraries from `requirements.txt`.
pip install -r requirements.txt
Generate Model Files
Run the training script to create `scaler.pkl` and `wine_model_regression.pkl`.
python train_model.py
Run the Flask App
Start the local development server.
python app.py
Access the application in your browser at http://127.0.0.1:5000/.