Go to home
Back
4
1

wine-class-prediction

:

šŸ¤– Wine Class Prediction

A project to predict wine class using different models.

šŸ“‹ Table of Contents

āš™ļø Setup

First, ensure you have Python 3.11+ installed on your system. Install the required dependencies:

# Create a virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

requirements.txt:

pandas
scikit-learn

šŸš€ Running the Scripts

Train the Model

Train the models by running:

python train.py

This script performs the following operations:

  • Loads the data from data/wine_data.csv
  • Preprocesses the features and target variables
  • Trains a logistic regression model and a support vector machine model on the data
  • Saves the trained model as model.pkl and the scaler as scaler.pkl under the model folder

šŸ“ Project Structure

ml-project/
ā”œā”€ā”€ data/
│   └── wine_data.csv
ā”œā”€ā”€ train.py
ā”œā”€ā”€ requirements.txt
ā”œā”€ā”€ model/
│   └── model.pkl (generated after training)
│   └── scaler.pkl (generated after training)
└── docs/
    ā”œā”€ā”€ README.md
    └── LICENSE

ā“ Troubleshooting

  • Missing dependencies: Ensure all packages are installed via pip install -r requirements.txt
  • File not found errors: Check that your data file exists in the data/ directory
  • Version conflicts: Verify your Python version is 3.11+ and package versions match requirements

šŸ”® Next Steps

  • Experiment with different ML algorithms
  • Implement hyperparameter tuning to optimize model performance
  • Add data visualization to better understand your dataset