| --- |
| license: apache-2.0 |
| datasets: |
| - codesignal/wine-quality |
| metrics: |
| - accuracy |
| pipeline_tag: tabular-classification |
| --- |
| |
| # Random Forest Model for Wine-Quality Prediction |
|
|
| This repository contains a Random Forest model trained on wine-quality data for wine quality prediction. The model has been trained to classify wine quality into six classes. During training, it achieved a 100% accuracy on the training dataset and a 66% accuracy on the validation dataset. |
|
|
| ## Model Details |
| - **Algorithm**: Random Forest |
| - **Dataset**: Wine-Quality Data |
| - **Objective**: Wine quality prediction (Six classes) - (3,4,5,6,7,8) and prediction above 5 is good quality wine. |
| - **Dataset Size**: 320 samples with 11 features. |
| - **Target Variable**: Wine Quality |
| - **Data Split**: 80% for training, 20% for validation |
| - **Training Accuracy**: 100% |
| - **Validation Accuracy**: 66% |
|
|
| ## Usage |
| You can use this model to predict wine quality based on the provided features. Below are some code snippets to help you get started: |
|
|
| ```python |
| # Load the model and perform predictions |
| import pandas as pd |
| from sklearn.ensemble import RandomForestClassifier |
| import joblib |
| |
| # Load the trained Random Forest model (assuming 'model.pkl' is your model file) |
| model = joblib.load('model/random_forest_model.pkl') |
| |
| # Prepare your data for prediction (assuming 'data' is your input data) |
| # Ensure that your input data has the same features as the training data |
| |
| # Perform predictions |
| predictions = model.predict(data) |
| |
| # Get the predicted wine quality class |
| # The predicted class will be an integer between 0 and 5 |
| |