Skip to main content

ML Tutor v1.0.3

Downloads

ML Tutor is a Python library created to help people learn Machine Learning (ML).

Machine Learning (ML) is pretty hard and especially if you are just starting (been there done that)! I've created this library to help anybody interested in learning ML. ML Tutor provides visual training for every algorithm inside it so you can visualize what's happening with your data in real-time! Besides that, for every algorithm, there is a theory on how it works and interview questions.

Happy learning! ^_^

Use ML Tutor if you are looking to:

  • Learn most popular Machine Learning algorithms directly from Jupyter Notebook or Google Colab
  • Visualize what's happening with your data (Educational purpose only)

Usage

To demonstrate what you can do with ML Tutor, we will need a dataset. You can use your own dataset or some classic dataset (such as Iris).

Let's use the Iris dataset from the Sklearn library and split it into the training and testing subsets.

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split

dataset = load_iris()
X_train, X_test, y_train, y_test = train_test_split(dataset.data, dataset.target, test_size=0.2)

Training/Prediction

Clustering

For the clustering example, let's import KMeans and demonstrate how to use it with the ML Tutor library. Notice that you can train/test it just like any sklearn algorithm.

Each algorithm has several arguments you can provide, but the unique one across all of them is visual_training. If you set this to True, you will see the whole training process inside your IDE.

from ml_tutor.clustering.kmeans import KMeans

clf = KMeans(n_clusters=3, visual_training=True)
clf.fit(X_train)

Classification

For the classification example, let's use KNeighbourClassifier (KNN).

Because the KNN just stores data when you call the .fit() function on it, the visualization part comes in the prediction time.

from ml_tutor.classification.knn import KNeighbourClassifier

clf = KNeighbourClassifier(n_neighbors=5, visual_training=True, number_of_visual_steps=2)
clf.fit(X_train, y_train)

predictions = clf.predict(X_test)

How an algorithm works? (theory)

Every algorithm has method .how_it_works() which generates a blog post directly inside your IDE. Every blog is written by somebody from the community, not myself, and in the end, they get a shout out for the great material.

from ml_tutor.classification.knn import KNeighbourClassifier

clf = KNeighbourClassifier()
clf.how_it_works()

What if I prefer video instead of reading tutorial?

I've got you covered! Just place video=True inside the method how_it_works(), and it will open a YouTube video for you.

from ml_tutor.classification.knn import KNeighbourClassifier

clf = KNeighbourClassifier()
clf.how_it_works(video=True)

Interview questions

If you call .interview_questions() on any algorithm, it will generate resources with interview questions for the algorithm.

from ml_tutor.classification.knn import KNeighbourClassifier

clf = KNeighbourClassifier()
clf.interview_questions()

Sklearn code

Since this is the library for education and not for production, you'll need to learn how to use these algorithms with the battle-tested library sklearn. Just call .sklearn_version() on any algorithm, and it will generate code for you!

NOTE: For now, this method only works in Jupyter Notebook!

from ml_tutor.classification.knn import KNeighbourClassifier

clf = KNeighbourClassifier()
clf.sklearn_version()

Supported IDEs

For now this library is fully supported for Jupyter Notebook and partially supported for Google Colab (read Sklearn code section for more details).

Installation

Installation with pip

You can install ML Tutor directly from the PyPi repository using pip (or pip3):

pip install ml-tutor

Manual installation

If you prefer to install it from source:

  1. Clone this repository
git clone https://github.com/lucko515/ml-tutor
  1. Go to the library folder and run
pip install .

TODO

If you want to contribute to the ML Tutor, here is what's on the TODO list:

  • .sklearn_version() is not working in Google Colab
  • Logistic Regression visualization needs a re-do, currently it's not showing how the classification lines moves over time
  • Interview questions should be added to each algorithm (take the knn.py as a reference)
  • Visualization export to .gif and/or .mp4
  • Additional algorithms (e.g. NaiveBayes)
  • Support for other IDEs (e.g. regular Python Shell)

Contact

Add me on LinkedIn.

Metadata

Release files for ml-tutor 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ml-tutor 1.0.3
File Size Uploaded Provenance
ml_tutor-1.0.3.tar.gz 26.3 kB Without provenance Details

Release files / ml_tutor-1.0.3.tar.gz

Download URL ml_tutor-1.0.3.tar.gz
Size 26.3 kB
Tags Source
SHA-256 checksum
How to use checksums
585ecde93a2a214d9fc8acebe6a956e42cb9fc382ef9fc5f82d3d24a319abb03
BLAKE2b-256 checksum
How to use checksums
bc9db9c0fb7574b684abcc704248001d52d968d3ce5ac9438688cf399e9b4d42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.9

Security for ml-tutor 1.0.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page