mrhammad12/hammad-logistic-regression
0
1---2title: Hammad Logistic Regression3emoji: ๐4colorFrom: indigo5colorTo: green6sdk: gradio7sdk_version: 5.49.18app_file: app.py9pinned: false10license: mit11---12 13 14# ๐ง Logistic Regression from Scratch15 16**Built a Machine Learning Model from Scratch + Integrated with a Flask App**17 18This 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.19 20## ๐ Demo21[](https://huggingface.co/spaces/your-username/logistic-regression-from-scratch)22 23Try the live demo on Hugging Face Spaces!24 25## ๐ Project Overview26 27I 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.28 29## โ
Key Features30 31- **Custom Logistic Regression** implementation using only NumPy32- **Manual preprocessing** and feature scaling using StandardScaler33- **98% accuracy** on the Breast Cancer Wisconsin dataset34- **Flask web interface** for real-time predictions35- **Performance visualization** and prediction results36- **Complete mathematical implementation** of gradient descent and sigmoid activation37 38## ๐ง Tech Stack39 40- **Python** (core ML logic implementation)41- **Flask** (web framework)42- **NumPy, Pandas** (data manipulation and numerical operations)43- **HTML/CSS/JavaScript** (frontend interface)44- **Scikit-learn** (only for dataset loading and train-test split)45 46## ๐ Model Performance47 48- **Accuracy**: 98% on test set49- **Training Method**: Gradient Descent with L2 regularization50- **Epochs**: 200051- **Learning Rate**: 0.0152 53## ๐ฌ Mathematical Implementation54 55The model implements:56- Sigmoid activation function: `ฯ(z) = 1 / (1 + e^(-z))`57- Cost function with L2 regularization58- Gradient descent optimization59- Manual forward and backward propagation60 61## ๐จโ๐ป Author62 63**Hammad** - Machine Learning Enthusiast64 65## ๐ License66 67This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.68 69---70 71*This project helped me connect theory, implementation, and presentation, reinforcing how ML models work under the hood before using frameworks like TensorFlow or PyTorch.*72 73Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference74 