Skip to content

About

Implementation of core ML algorithms to have better understanding of how logic and code works behind an algorithm and scikit_learn library

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ML Algorithms From Scratch

This repository contains implementations of core Machine Learning algorithms from scratch using Python and NumPy to understand how code works behind sklearn library. The goal of this project is to understand the mathematics, logic, and workflow behind commonly used ML algorithms.

📌 Implemented Algorithms

1. Linear Regression

  • Implemented using the Gradient Descent
  • Predicts continuous values
  • Evaluated using R² score

2. Logistic Regression

  • Binary classification (0 / 1)
  • Uses sigmoid function
  • Probability-based classification
  • Evaluated using accuracy

3. K-Nearest Neighbors (KNN)

  • Distance-based (lazy learning) algorithm
  • Uses Euclidean distance
  • Majority voting for classification

📊 Dataset

  • Small synthetic datasets created manually
  • 2D feature space for better visualization and understanding
  • Separate sample files for each algorithm

Tech Stack

  • Python
  • NumPy
  • Pandas
  • Matplotlib / Seaborn
  • Jupyter Notebook
  • Git & GitHub

How to Run

  1. Clone the repository: git clone https://github.com/sonakshigupta29/ML_Algorithm_Scratch_Implementation.git
  2. Navigate to the project directory: cd ML_Algorithm_Scratch_Implementation
  3. Open Jupyter Notebook: jupyter notebook
  4. Run any *_main.ipynb file to see the implementation and results.

Future Improvements

  • Add algorithms such as Softmax Regression, Polynomial Regression, and Neural Networks as I continue learning.
  • Introduce model optimizations like train–test split, better evaluation metrics, performance analysis and etc to gain insight into how machine learning algorithms work behind the scenes.

About

Implementation of core ML algorithms to have better understanding of how logic and code works behind an algorithm and scikit_learn library

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages