Skip to main content

Machine Learning from Scratch - Educational Python Library

Project description

MLZero: Machine Learning from Scratch

PyPI version License: MIT

Overview

MLZero is a Python library providing a collection of machine learning algorithms implemented from scratch. The goal is to offer a clear, educational codebase for understanding the fundamentals of machine learning, with practical driver scripts and a modular design for easy extension.

Features

  • Classifiers: Perceptron, AdaLine, Logistic Regression, k-Nearest Neighbors (kNN), Naive Bayes, Softmax Regression
  • Clusterers: K-Means clustering algorithm
  • Regressors: Linear regression (closed-form and gradient descent), L1 (Lasso) and L2 (Ridge) regularization, ElasticNet, polynomial regression, multiple variable regression
  • Small Neural Nets: Basic implementation of a multi-neuron layer
  • Decomposers: Principal Component Analysis (PCA)
  • Metrics: Regression and classification metrics (MAE, MSE, R², accuracy, precision, recall, F1, etc.)

Requirements

To run this project, you need the following Python libraries:

  • numpy
  • matplotlib for plotting purpose not necessary otherwise, recommended to have installed

Install the dependencies using:

pip install -r requirements.txt

Directory Structure

mlzero/
├── classifiers/        # Classification algorithms and driversC/
├── clusterers/         # Clustering algorithms and driversK/
├── regressors/         # Regression algorithms and driversR/
├── decomposers/        # Dimensionality reduction and driversD/
├── metrics/            # Regression and classification metrics
├── small_neural_net/   # Multi-neuron layer implementations
└── requirements.txt    # Dependencies list

Usage

Each algorithm has a corresponding driver script in its drivers subdirectory. For example:

Run the ElasticNet regressor:

python regressors/driversR/driverElasticNet.py

Run the kNN classifier:

python classifiers/driversC/driverKNNClassifier.py

Development Status

MLZero is under active development. The codebase is modular and designed for educational purposes. Contributions for new algorithms, bug fixes, and documentation improvements are welcome.

Contributing

Contributions are welcome! Feel free to fork the repo, submit issues, or open pull requests. Please ensure your code is well-documented and tested before submitting.

License

This project is licensed under the MIT 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

mlzero-0.1.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

mlzero-0.1.2-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file mlzero-0.1.2.tar.gz.

File metadata

  • Download URL: mlzero-0.1.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for mlzero-0.1.2.tar.gz
Algorithm Hash digest
SHA256 19e436ff72f7ba92a824c845b943aa7785f43c31233b9a016b6f11002375471e
MD5 7f3f821f6c306f18a147ddbc14072df8
BLAKE2b-256 f62d186c2d607445d0e3ac567167188f610fe979fccae1adfaa92e5e87785b4c

See more details on using hashes here.

File details

Details for the file mlzero-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mlzero-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for mlzero-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 34015d043d6322e77a5af03053479ef274dcf1933f252e7eb4dac37ea5fdc4ca
MD5 f4a70c0b808e4b41a004f5b2021752ca
BLAKE2b-256 4f49c8fe354de69270f612538e25d2648817396801bd9af1f10ca84f9a97d140

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