Skip to content

Latest commit

Β 

History

History
141 lines (109 loc) Β· 3.12 KB

File metadata and controls

141 lines (109 loc) Β· 3.12 KB

🧠 ML Systems Lab

A hands-on repository for implementing machine learning algorithms from scratch, with a focus on understanding the mathematics, optimization, and system design behind modern ML models.

This project bridges the gap between theory and real-world ML engineering.


πŸš€ Overview

Most machine learning libraries hide the underlying mechanics.
This repository focuses on:

  • Building algorithms from first principles
  • Understanding how models learn
  • Writing clean, modular, production-style Python code
  • Developing intuition for model performance and limitations

🎯 Objectives

  • Implement core ML algorithms without high-level frameworks
  • Strengthen understanding of optimization and learning dynamics
  • Build reusable ML components
  • Prepare for advanced ML systems and MLOps workflows

πŸ“‚ Project Structure

ml-systems-lab/
β”‚
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ perceptron/
β”‚ β”‚ β”œβ”€β”€ perceptron.py
β”‚ β”‚ β”œβ”€β”€ xor.py
β”‚ β”‚ └── init.py
β”‚ β”œβ”€β”€ backpropagation/
β”‚ β”‚ β”œβ”€β”€ backpropagation.py
β”‚ β”‚ └── init.py
β”‚ β”‚
β”‚ β”œβ”€β”€ linear_models/
β”‚ β”‚ β”œβ”€β”€ linear_regression.py
β”‚ β”‚ β”œβ”€β”€ logistic_regression.py
β”‚ β”‚ └── init.py
β”‚ β”‚
β”‚ β”œβ”€β”€ utils/
β”‚ β”‚ β”œβ”€β”€ metrics.py
β”‚ β”‚ β”œβ”€β”€ data_utils.py
β”‚ β”‚ └── init.py
β”‚ β”‚
β”‚ └── init.py
β”‚
β”œβ”€β”€ notebooks/
β”‚ └── experiments.ipynb
β”‚
β”œβ”€β”€ tests/
β”‚ β”œβ”€β”€ test_perceptron.py
β”‚ β”‚ β”œβ”€β”€ xor.py
β”‚ └── test_linear_models.py
β”‚
β”œβ”€β”€ data/
β”‚ └── (datasets go here)
β”‚
β”œβ”€β”€ examples/
β”‚ └── perceptron_example.py
β”‚
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
└── .gitignore

βš™οΈ Implemented Algorithms

βœ… Supervised Learning

  • Perceptron (binary classification)
  • XOR (basic multilayer perceptron)

πŸ”œ Coming Soon

  • Linear Regression
  • Logistic Regression
  • Neural Networks (MLP)
  • Decision Trees
  • Support Vector Machines (SVM)

🧩 Example Usage

import numpy as np
from src.perceptron.perceptron import Perceptron

X = np.array([[0,0], [0,1], [1,0], [1,1]])
y = np.array([0, 0, 0, 1])

model = Perceptron(input_dim=2, learning_rate=0.1)
model.train(X, y)

πŸ› οΈ Key Features

  • Pure NumPy implementations (no ML frameworks)
  • Modular and extensible design
  • Clear training loops and update rules
  • Easy to debug and experiment with
  • Structured like a real ML codebase

πŸ“Š Design Philosophy

  • Clarity over cleverness
  • Understanding over abstraction
  • Engineering discipline over shortcuts

Each algorithm is implemented with:

  • Direct math-to-code mapping
  • Explicit training procedures
  • Reusable components

πŸ§‘β€πŸ’» Tech Stack

  • Python
  • NumPy
  • (Planned) Pandas
  • (Planned) Matplotlib

πŸ’‘ Author

Derrick Nyongesa

Data Scientist | Electrical & Electronics Engineer

Focus: Understanding Machine Learning Algorithims

LinkedIn