Skip to main content

Machine Learning Library Built From Scratch Using NumPy

Project description

MiniML

A Machine Learning Library Built From Scratch Using NumPy.

MiniML is a machine learning library implemented completely from scratch using NumPy without relying on scikit-learn for core algorithms.

The goal of this project is to deeply understand:

  • Machine Learning Algorithms
  • Optimization
  • Neural Networks
  • Backpropagation
  • Linear Algebra
  • ML Engineering
  • Software Architecture

The project includes:

  • Classical ML Algorithms
  • Clustering Algorithms
  • Dimensionality Reduction
  • Neural Network Engine
  • Optimizers
  • Visualization Tools
  • Benchmarking System
  • CLI Interface

Features

  • Linear Regression
  • Logistic Regression
  • KNN
  • KMeans
  • DBSCAN
  • PCA
  • Neural Networks
  • SGD Optimizer
  • Momentum Optimizer
  • Adam Optimizer
  • Mini-Batch Training
  • Visualization Tools
  • Benchmarking
  • CLI Tool

Installation

git clone <repo-link>

cd MiniML

pip install -r requirements.txt

Quick Start

from miniml.linear_regression import LinearRegression

model = LinearRegression()

model.fit(X, y)

predictions = model.predict(X)

Neural Network Example

from miniml.neural_network import NeuralNetwork

from miniml.layers import Dense
from miniml.activations import ReLU, Sigmoid

from miniml.optimizers import Adam

model = NeuralNetwork()

model.add(Dense(2, 8))
model.add(ReLU())

model.add(Dense(8, 1))
model.add(Sigmoid())

model.compile(
    loss="binary_cross_entropy",
    optimizer=Adam(learning_rate=0.01)
)

model.fit(X, y, epochs=1000)

Project Architecture

MiniML follows modular ML framework design:

  • Layers
  • Activations
  • Loss Functions
  • Optimizers
  • Training Engine
  • Visualization System
  • Benchmarking System

Neural networks are implemented using:

  • Forward Propagation
  • Backpropagation
  • Gradient Descent
  • Automatic Gradient Flow

Mathematical Concepts Implemented

  • Gradient Descent
  • Binary Cross Entropy
  • Backpropagation
  • Covariance Matrices
  • Eigen Decomposition
  • Distance Metrics
  • Clustering Optimization
  • Numerical Stability
  • Vectorized Computation

Benchmarking

MiniML includes benchmarking tools comparing:

  • Training Time
  • Prediction Time
  • Accuracy
  • Memory Usage

against scikit-learn implementations.

Visualization Tools

  • Loss Curves
  • Accuracy Curves
  • Decision Boundaries
  • Cluster Visualizations
  • PCA Projections

CLI Usage

python cli.py --model linear_regression

python cli.py --model logistic_regression

python cli.py --model kmeans

python cli.py --model neural_network

Folder Structure

MiniML/
│
├── miniml/
├── benchmarks/
├── visualizations/
├── examples/
├── tests/
├── datasets/
├── cli.py
├── README.md
└── requirements.txt

Future Improvements

  • CNN Layers
  • Transformer Architecture
  • GPU Support
  • Automatic Differentiation Engine
  • Model Serialization
  • Hyperparameter Tuning
  • Distributed Training
  • CUDA Acceleration

Python NumPy License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

miniml_adv-0.1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

miniml_adv-0.1.0-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file miniml_adv-0.1.0.tar.gz.

File metadata

  • Download URL: miniml_adv-0.1.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for miniml_adv-0.1.0.tar.gz
Algorithm Hash digest
SHA256 906b1dab886c04ab69717a73eaca72abfff74e1227fd87c1e60fc1f5698c79be
MD5 f8f21c4f77283cee5978dc4fdc85c4ac
BLAKE2b-256 6e1e1bdc4957becd6a345cf584b78a691d8ea80f2f5cb2d9638dc52a66936fd5

See more details on using hashes here.

File details

Details for the file miniml_adv-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: miniml_adv-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for miniml_adv-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14f062e78e7b8522e591ab2f9145c435d0c9103818e6197a74ba4b9e8c6e4c58
MD5 5453ffdefee32506851a6de7eb200a3e
BLAKE2b-256 9812d67c4c49bc132870e5ffe23d9d72773faa2d823ab3eef6b3401ea3df3cee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page