Skip to content

A machine learning project that uses Logistic Regression to classify apples as good or bad based on various features.

Notifications You must be signed in to change notification settings

talamh0/apple-quality-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Apple Quality Classification

A machine learning project that uses Logistic Regression to classify apples as good or bad based on various features. The dataset is preprocessed, trained with models using L2 regularization, and evaluated using performance metrics and an ROC curve.

Features

  • ๐Ÿ“Œ Data Preprocessing: Cleans missing values and applies feature scaling.
  • ๐Ÿ“Œ Logistic Regression: Implements classification with and without regularization.
  • ๐Ÿ“Œ Model Comparison: Evaluates multiple models with different regularization strengths.
  • ๐Ÿ“Œ Performance Metrics: Calculates accuracy, precision, recall, F1-score, and ROC-AUC.
  • ๐Ÿ“Œ ROC Curve Visualization: Plots the best modelโ€™s performance.

๐Ÿ–ผ๏ธ Screenshots

๐Ÿ”น ROC Curve

ROC Curve


๐Ÿ“‚ Dataset

The dataset is publicly available and can be accessed here:
๐Ÿ“Œ Apple Quality Dataset

Features:

  • Various numerical attributes related to apple quality.
  • Target variable: Quality (good = 1, bad = 0).

๐Ÿ› ๏ธ Technologies & Libraries

Library Purpose
pandas Data processing & cleaning
sklearn.model_selection Train-test splitting
sklearn.preprocessing Feature scaling
sklearn.linear_model Logistic Regression models
sklearn.metrics Performance evaluation
matplotlib.pyplot Visualization (ROC Curve)

๐Ÿ—๏ธ Built With

  • Python
  • Scikit-learn
  • Matplotlib

๐ŸŽฏ How to Run

1๏ธโƒฃ Clone the repository:

git clone https://github.com/your-username/apple-quality-classification.git
cd apple-quality-classification

2๏ธโƒฃ Install dependencies:

pip install pandas scikit-learn matplotlib

3๏ธโƒฃ Run the Python script:

python main.py

๐Ÿ“Š Model Comparison

Model Type Accuracy Precision Recall F1-score ROC-AUC
No Regularization 0.85 0.87 0.83 0.85 0.86
L2 (C=0.1) 0.88 0.89 0.86 0.87 0.89
L2 (C=1) 0.90 0.91 0.88 0.89 0.91
L2 (C=10) 0.89 0.90 0.87 0.88 0.90

โœ” Best Model: L2 Regularization with C=1, achieving the highest accuracy and balanced precision/recall.

About

A machine learning project that uses Logistic Regression to classify apples as good or bad based on various features.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages