Skip to content

A practical implementation of Logistic Regression in Python using Scikit-learn. The project covers essential steps including data preprocessing, model training, accuracy evaluation, and visualizing results. Perfect for anyone looking to grasp logistic regression concepts through hands-on experience with real datasets.

Notifications You must be signed in to change notification settings

Sidra-009/Logistic-Regression-Practical

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🌸 Logistic Regression – Iris Dataset (Binary Classification)

This project demonstrates the practical implementation of Logistic Regression for binary classification using the Iris dataset. The focus is on classifying between Iris-versicolor and Iris-virginica using Scikit-learn and evaluating model performance with cross-validation and hyperparameter tuning.


πŸ“‚ Project Structure

  • logistic_regression.ipynb – Jupyter notebook with complete implementation
  • README.md – Project overview and usage guide

βœ… Features

  • Load and filter the Iris dataset for binary classification
  • Map categorical species to numerical labels
  • Split data into training and testing sets
  • Implement and tune Logistic Regression using GridSearchCV
  • Evaluate model using classification report and accuracy
  • Visualize data using Seaborn pair plots
  • Display correlation matrix

πŸ› οΈ Tools & Libraries

  • Python
  • NumPy
  • Pandas
  • Seaborn
  • Matplotlib
  • scikit-learn

πŸ§ͺ Model Training & Tuning

  • Model: Logistic Regression
  • Tuning Parameters:
    • penalty: l1, l2, elasticnet
    • C: Regularization strength
    • max_iter: Maximum iterations
  • GridSearchCV used with cv=5 for cross-validation

πŸ“Š Evaluation

  • Metrics:
    • Accuracy Score
    • Classification Report (Precision, Recall, F1-Score)
  • Best Parameters: Displayed using best_params_
  • Best Score: Shown using best_score_

πŸ–ΌοΈ Visualizations

  • Pair Plot colored by species
  • Correlation matrix

πŸš€ How to Run

  1. Clone the repository:
git clone https://github.com/Sidra-009/logistic-regression-iris.git
cd logistic-regression-iris

About

A practical implementation of Logistic Regression in Python using Scikit-learn. The project covers essential steps including data preprocessing, model training, accuracy evaluation, and visualizing results. Perfect for anyone looking to grasp logistic regression concepts through hands-on experience with real datasets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published