https://github.com/khushi130404/logistic_regression
This repository demonstrates logistic regression using step and sigmoid functions, gradient descent, and sklearn for comparison. It includes visualizations and comparisons to provide a clear understanding of the model.
https://github.com/khushi130404/logistic_regression
gradient-descent logistic-regression sigmoid-function sklearn step-functions
Last synced: 14 days ago
JSON representation
This repository demonstrates logistic regression using step and sigmoid functions, gradient descent, and sklearn for comparison. It includes visualizations and comparisons to provide a clear understanding of the model.
- Host: GitHub
- URL: https://github.com/khushi130404/logistic_regression
- Owner: Khushi130404
- License: mit
- Created: 2024-12-27T15:29:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-31T06:50:40.000Z (over 1 year ago)
- Last Synced: 2025-03-01T13:23:46.334Z (over 1 year ago)
- Topics: gradient-descent, logistic-regression, sigmoid-function, sklearn, step-functions
- Language: Jupyter Notebook
- Homepage:
- Size: 275 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Logistic_Regression
This repository contains an implementation of logistic regression from scratch using foundational concepts such as step function, sigmoid function, and gradient descent. Additionally, it includes an implementation using sklearn for comparison. The project also includes visualizations and comparisons of these methods to provide a comprehensive understanding of logistic regression.
## Features
1. Step Function Implementation: Demonstrates the use of the step function for classification.
2. Sigmoid Function Implementation: Applies the sigmoid function for logistic regression, enabling probabilistic outputs.
3. Gradient Descent Optimization: Optimizes the logistic regression model using gradient descent.
4. sklearn Implementation: Uses the built-in LogisticRegression from sklearn for benchmarking and comparison.
5. Visualization: Includes visual plots to illustrate the behavior and performance of each implementation.
6. Comparison: Provides side-by-side comparisons of different methods to highlight their strengths and weaknesses.
## Dependencies
- numpy
- matplotlib
- pandas
- scikit-learn
## Methodology
1. Step Function :
- A basic binary classification approach.
- Illustrates the limitations of hard classification boundaries.
2. Sigmoid Function :
- Smooth, probabilistic classification boundary.
- Output ranges between 0 and 1, allowing confidence levels for predictions.
3. Gradient Descent :
- Optimizes the logistic regression cost function by iteratively updating weights.
- Implements learning rate adjustments and convergence checks.
4. sklearn Implementation :
- Uses LogisticRegression from scikit-learn for a straightforward and efficient implementation.
- Provides a benchmark to compare the manual implementation's performance.
## Visualization
- Graphical representation of decision boundaries.
- Loss function convergence during gradient descent.
- Comparison of the performance of step, sigmoid, gradient descent, and sklearn implementations.