CoolFace
Apppublic

mrhammad12/hammad-logistic-regression

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes
App README

๐Ÿง  Logistic Regression from Scratch

Built a Machine Learning Model from Scratch + Integrated with a Flask App

This project demonstrates the implementation of a Logistic Regression model completely from scratch, with every formula and function manually implemented โ€” no pre-built ML libraries for training or prediction! The model is integrated with a Flask web app for real-time predictions and visualization.

๐Ÿš€ Demo

![Hugging Face Spaces](https://huggingface.co/spaces/your-username/logistic-regression-from-scratch)

Try the live demo on Hugging Face Spaces!

๐Ÿ“‹ Project Overview

I developed a beginner-level Machine Learning model from the ground up, implementing all mathematical formulas manually. The project includes a Flask web interface that showcases how the model performs predictions in real-time.

โœ… Key Features

  • โ€”Custom Logistic Regression implementation using only NumPy
  • โ€”Manual preprocessing and feature scaling using StandardScaler
  • โ€”98% accuracy on the Breast Cancer Wisconsin dataset
  • โ€”Flask web interface for real-time predictions
  • โ€”Performance visualization and prediction results
  • โ€”Complete mathematical implementation of gradient descent and sigmoid activation

๐Ÿง  Tech Stack

  • โ€”Python (core ML logic implementation)
  • โ€”Flask (web framework)
  • โ€”NumPy, Pandas (data manipulation and numerical operations)
  • โ€”HTML/CSS/JavaScript (frontend interface)
  • โ€”Scikit-learn (only for dataset loading and train-test split)

๐Ÿ“Š Model Performance

  • โ€”Accuracy: 98% on test set
  • โ€”Training Method: Gradient Descent with L2 regularization
  • โ€”Epochs: 2000
  • โ€”Learning Rate: 0.01

๐Ÿ”ฌ Mathematical Implementation

The model implements:

  • โ€”Sigmoid activation function: ฯƒ(z) = 1 / (1 + e^(-z))
  • โ€”Cost function with L2 regularization
  • โ€”Gradient descent optimization
  • โ€”Manual forward and backward propagation

๐Ÿ‘จโ€๐Ÿ’ป Author

Hammad - Machine Learning Enthusiast

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


This project helped me connect theory, implementation, and presentation, reinforcing how ML models work under the hood before using frameworks like TensorFlow or PyTorch.

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference