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
Metadata
Release files for miniml-adv 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| miniml_adv-0.1.0.tar.gz | 16.3 kB | Without provenance | Details for miniml_adv-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| miniml_adv-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for miniml_adv-0.1.0-py3-none-any.whl |
Total release size: 41.9 kB
Release files / miniml_adv-0.1.0.tar.gz
| Download URL | miniml_adv-0.1.0.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
906b1dab886c04ab69717a73eaca72abfff74e1227fd87c1e60fc1f5698c79be
|
|
BLAKE2b-256 checksum How to use checksums |
6e1e1bdc4957becd6a345cf584b78a691d8ea80f2f5cb2d9638dc52a66936fd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|
Release files / miniml_adv-0.1.0-py3-none-any.whl
| Download URL | miniml_adv-0.1.0-py3-none-any.whl |
|---|---|
| Size | 25.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
14f062e78e7b8522e591ab2f9145c435d0c9103818e6197a74ba4b9e8c6e4c58
|
|
BLAKE2b-256 checksum How to use checksums |
9812d67c4c49bc132870e5ffe23d9d72773faa2d823ab3eef6b3401ea3df3cee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|
Security for miniml-adv 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.