Skip to content

In this project I did lot of efforts because the dataset used was imbalanced that's why i couldn't find any ML algorithms that gave me good results, I tried different Sampling techniques, although nothing happened. Finally I build this project using ANN and got an 77% accuracy and also very good precision, recall and f1 score.

Notifications You must be signed in to change notification settings

Debopam-Pritam2014/Wine-Quality_Predictor

Repository files navigation

Wine Quality Prediction

This project aims to predict the quality of wine based on its chemical properties using various machine learning models. The dataset used is the Wine Quality dataset, which contains features such as acidity, chlorides, sulfur dioxide levels, etc., along with a quality rating.

Table of Contents

Introduction

Wine quality is determined by various factors that can be measured chemically. This project aims to leverage machine learning techniques to predict the quality of wine based on these measurable factors. The project includes data preprocessing, model training, and evaluation.

Dataset

The dataset used in this project is the Wine Quality dataset. It contains the following columns:

  • Fixed Acidity
  • Volatile Acidity
  • Citric Acid
  • Residual Sugar
  • Chlorides
  • Free Sulfur Dioxide
  • Total Sulfur Dioxide
  • Density
  • pH
  • Sulphates
  • Alcohol
  • Quality (target variable)

Preprocessing

  1. Handling Missing Values: The dataset is checked for missing values and handled appropriately.
  2. Handling Duplicate Values: The dataset is checked for duplicate values and handled appropriately.
  3. Standardization: Features are standardized using StandardScaler.
  4. Class Imbalance: Synthetic Minority Over-sampling Technique (SMOTE) is used to handle class imbalance.

Modeling

The following models were used for prediction:

  • Logistic Regression
  • Decision Tree Classifier
  • Random Forest Classifier
  • Support Vector Classifier
  • K-Nearest Neighbors
  • Extra Tree Classifier
  • XGB Classifier
  • Artificial Neural Network (ANN)

Evaluation

The models are evaluated using the following metrics:

  • Accuracy
  • Precision
  • Recall
  • F1 Score

Results

The performance of the models is stored in a pandas DataFrame and printed as follows:

Classifier Accuracy Precision Recall F1 Score
Logistic Regression 0.532362 0.542011 0.532362 0.521114
Decision Tree 0.522654 0.521329 0.522654 0.521787
Random Forest 0.600324 0.612666 0.600324 0.590215
Support Vector Classifier 0.579288 0.596981 0.579288 0.560440
K-Nearest Neighbors 0.556634 0.558658 0.556634 0.556183
Extra Tree Classifier 0.610032 0.621627 0.610032 0.600254
XGB classifier 0.601942 0.605508 0.601942 0.597072
Artificial Neural Network 0.730831 0.715200 0.730831 0.718137

Dependencies

  • pandas
  • numpy
  • scikit-learn 1.3.2
  • xgboost 1.6.2
  • streamlit
  • pickle
  • tensorflow 2.15.0

Installation

Install all project requirements

  pip install -r requirements.txt

Run the command to see the demo

  streamlit run app.py

Authors

Acknowledgements

Conclusion

The project demonstrates the use of various machine learning algorithms to predict wine quality. The Artificial Neural Network model showed promising results with further potential improvements through hyperparameter tuning and more sophisticated feature engineering.

Feedback

If you have any feedback, please reach out to me at [email protected]

About

In this project I did lot of efforts because the dataset used was imbalanced that's why i couldn't find any ML algorithms that gave me good results, I tried different Sampling techniques, although nothing happened. Finally I build this project using ANN and got an 77% accuracy and also very good precision, recall and f1 score.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages