Skip to main content

My Machine Learning (MML) Library, a high performance machine learning and deep learning framework coding from scratch (pure Python) with hybrid backend support (`numpy` or `torch`).. Write `import mml` to use it.

Project description

MML (mml-pypi)

My Machine Learning (MML) Library developed by Nathmath and DOF Studio, identified as mml-pypi on PyPI.

What is MML? Why MML?

  • It is a high performance machine learning and deep learning framework coding from scratch (pure Python) with hybrid backend support (numpy or torch).

  • It is a pure Python implementation and almost has production level performance (significantly higher in neural nets) as fantastic toolkit for quick application, library comparision, and quick benchmarking with.

  • It is a package with utilities covering from Data IO, Feature Engineering, and Data Transforming, not only and far from simply a machine learning library, but a deeply integrated environment you can do everything on one set.

  • Its code is completely light-weight and open-source suitable for teaching, learning, deploying, and even debugging. You will never forget how integrated, simple, and powerful MML can be before starting to code on it.

  • Its style is designed for experts as well as non-experts -- we have a complete set of nn modules and Auto Neural Network framework, which can automatically build, train, fine-tune, and evaluate a neural network natively useful for non-technical groups.

Latest Version: 0.0.5

For more information:

How to Start

# bash:
pip install mml-pypi
# Python:
import mml

# For further tutorials, see `./document`
# Recommend to start from `1. General.md` and try the must-run example first.

Update History

MML 0.0.5 Release:

  • Minor bugs fixed.
  • Some document updates.
  • New methods erf and erfinv are provided in Matrix and Tensor containers.
  • New Activations like GELU, ELU, SELU, SiLU, ... are implemented.
  • More abbreviations like RM, BCM, MCM, BCE, MCE ... are included.
  • Global support of better Auto-Encoder arch by introducing a forward_encoder method from the base nn_Module, and predict_encoder in Evaluator.
  • Global support of Auto Forward and Auto Backward systems. Users can only define a sequential network in __init__ without concerning its forward and backward passes by manual labor.
  • Formal introduction of Auto Neural Network system, supporting tabular and time-series data modelling (will be continuously updating in the future).
  • Try nn.AutoNN now!

Planned Updates:

Within 0.0.5.x:

  • More Document updates.

  • Clip layer, manually supports clipping to avoid overfitting in classification tasks.

  • Reshape layer, a generic reshaping tool supplementary to the current Flatten.

  • Pooling layers, useful in CNN or LSTM related architectures.

  • GRU layers, serves as a simpler version of LSTM.

  • Introduce Dropout layers between Recurrent blocks.

  • More Loss functions like WMSE, WRMSE, etc. to support weighted average.

  • More Loss functions designed for financial engineers to develop strategies.

  • Kernel PCA implementation for simpler but stronger dimensionality reduction.

  • KNN and K-means algorithms for regression and clustering.

  • More AutoNN architecture and tasks support.

    Later versions:

  • Attention module, which is regarded by someone as All You Need.

  • Conv1D and Conv2D layers and pre-trained models (like MobileNet) for audio and image neural network tasks.

  • Auto Neural Network support for audio and image style tasks.

  • GAN and RL framework, incorporated into the current Neural Network framework.

  • More AutoNN architecture and tasks support.

Version Control

From versions later than 0.0.5, Viewable Version Control (VVC) tools will be installed with this library. With VVC

enabled, you can clear filter and see what has changed on a specific function or argument from a specific version to a specific version. Database will record any change starting from version 0.0.5.1 (next minor update to 0.0.5).

  • Note: Viewable Version Control (VVC) is also a DOF Studio owned open-source repository.
  • See https://github.com/dof-studio/VVC for more information about using this version control tool.

License

Apache 2.0 License, with no warranty but grants the right for even commercial use.

What's Inside?

  • Containers.

  • ML Algorithms.

  • Neural Network Framework (and Simple Interfaces).

  • Utilities and Toolkits.

  • Free ML Tutorial, Project Examples, and Documents.

Everything coded from scratch!

See below for a quick and complete reference.

Containers using Mixed Backends

  • Matrix (n-dimensional, For ML Algorithms) (NumPy √ Torch √)
  • Tensor (n-dimensional, For NN Framework) (NumPy √ Torch √)

ML Algorithms from Scratch

  • Linear Models (OLS and FGLS)
  • Generalized Linear Models (FGLS with Activation)
  • Time Series Models (TS, ARIMAX)
  • Principal Component Analysis (PCA)
  • Support Vector Machine (SVM)
  • Classification And Regression Tree (CART)
  • Linear Regression Tree Wrapper (LRTW)
  • Random Forest (RF)
  • Gradient Boosting Machine (GBM)
  • Extreme Gradient Boosting Machine (XGBM)
  • ...

Neural Network Framework from Scratch

  • Basic Overridable Neural Network Module (Module)
  • Dense Layer (Dense)
  • Dropout Layer (Dropout)
  • Flatten Layer (Flatten)
  • Single or Stacked RNN Layer (RNN)
  • Single or Stacked LSTM Layer (LSTM)
  • Activation Layers (ReLU, LeakyReLU, ELU, SELU, GELU, SiLU, ...)
  • Loss Functions (MSE, RMSE, MAE, BCE, MCE, ...)
  • Optimizers (SGD, Adam, AdamW, ...)
  • Easy Interface for Evaluation (Evaluator)
  • Auto Neural Network Framework (AutoNN)
  • ...

Utilities from Scratch

  • Regression, Binary Classification, Multi Classification Metrics
  • Train-Test Split, Train-Test Split for Time Series, Rolling Window Maker
  • Data Scaler
  • Data Wrangling Toolkits
  • Easy Save and Load Interface
  • Generic Optimizer
  • Generic Bootstrap Sampler
  • ...

Documentation in Detail (Updating)

See ./document for more information.

Recommended learning curve:

  • 1. General.md
  • 2. Containers.md
  • 3. Machine Learning Models.md
  • 4. Neural Netwotk Framwwork.md
  • 5. Simple Interface and AutoNN System.md

Project Based Examples (Legacy)

  • Homework_1_Q1_TimeSeries.ipynb

  • Homework_1_Q2_PCA.ipynb

  • Homework_1_Q3_SVM.ipynb

  • Homework_2_Q1_Tree.ipynb

  • Homework_2_Q2_RandomForest.ipynb

  • Homework_2_Q3_Bagging_with_Linear_Regression.ipynb

  • Homework_3_Q1_Logistic_Regression.ipynb

  • Homework_3_Q2_Gradient_Boosting_with_Decision_Trees.ipynb

  • Homework_3_Q3_Multilayer_Perceptron.ipynb

  • Homework_4_Q1_Vanilla_RNN.ipynb

  • Homework_4_Q2_LSTM.ipynb

  • Homework_4_Q3_Autoencoders.ipynb

Contact core developers

Please open an issue at https://github.com/dof-studio/MML if you find a bug or functionality problem.

To directly contact the developer team, send an e-mail to dof.hbx@gmail.com (can't ensure to be replied).

We welcome and value any positive contribution to this repository.

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

mml_pypi-0.0.5.tar.gz (235.5 kB view details)

Uploaded Source

Built Distribution

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

mml_pypi-0.0.5-py3-none-any.whl (263.5 kB view details)

Uploaded Python 3

File details

Details for the file mml_pypi-0.0.5.tar.gz.

File metadata

  • Download URL: mml_pypi-0.0.5.tar.gz
  • Upload date:
  • Size: 235.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.4

File hashes

Hashes for mml_pypi-0.0.5.tar.gz
Algorithm Hash digest
SHA256 6d158ad124410525f3264c64eda5d10e17918480548e674233224dbec0126b01
MD5 8cf2125092d6e238d5cca4926eb1efe5
BLAKE2b-256 aefd86b34ebd167a6ab9876a25b22c3a891a2032f7e54c9bb53c895940e977cb

See more details on using hashes here.

File details

Details for the file mml_pypi-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: mml_pypi-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 263.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.4

File hashes

Hashes for mml_pypi-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 db52499d42bd87d04ad8bf3f031ec2bf78015c455a1dc45ad1d7a6f81a80dbae
MD5 99a32e08891f4b3387ecc2a611eb4f4d
BLAKE2b-256 3975fc1948016fb82915abb88ffaff2aff72ea4c26ebf7e6f31b5c67ef046c24

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