{"id":15043318,"url":"https://github.com/lucko515/ml_tutor","last_synced_at":"2025-08-08T20:22:29.946Z","repository":{"id":57442388,"uuid":"294529828","full_name":"lucko515/ml_tutor","owner":"lucko515","description":"Machine Learning Tutor Python library","archived":false,"fork":false,"pushed_at":"2020-10-01T21:56:32.000Z","size":1899,"stargazers_count":24,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-25T19:20:48.684Z","etag":null,"topics":["classification","clustering","data-science","education","jupyter-notebook","machine-learning","python","regression","tutorials"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/ml-tutor/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucko515.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-10T21:48:03.000Z","updated_at":"2021-07-31T12:02:16.000Z","dependencies_parsed_at":"2022-09-26T18:00:23.977Z","dependency_job_id":null,"html_url":"https://github.com/lucko515/ml_tutor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucko515%2Fml_tutor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucko515%2Fml_tutor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucko515%2Fml_tutor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucko515%2Fml_tutor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucko515","download_url":"https://codeload.github.com/lucko515/ml_tutor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248955551,"owners_count":21189160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","clustering","data-science","education","jupyter-notebook","machine-learning","python","regression","tutorials"],"created_at":"2024-09-24T20:48:51.011Z","updated_at":"2025-04-14T20:31:26.017Z","avatar_url":"https://github.com/lucko515.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ML Tutor v1.0.3\n\n[![Downloads](https://pepy.tech/badge/ml-tutor)](https://pepy.tech/project/ml-tutor)\n\nML Tutor is a Python library created to help people learn Machine Learning (ML). \n\nMachine Learning (ML) is pretty hard and especially if you are just starting (been there done that)! \nI've created this library to help anybody interested in learning ML. ML Tutor provides visual training \nfor every algorithm inside it so you can visualize what's happening with your data in real-time!\nBesides that, for every algorithm, there is a theory on how it works and interview questions. \n\nHappy learning! ^_^\n\nUse ML Tutor if you are looking to:\n\n- Learn most popular Machine Learning algorithms directly from Jupyter Notebook or Google Colab\n- Visualize what's happening with your data (Educational purpose only)\n\n\n## Usage\n\nTo demonstrate what you can do with ML Tutor, we will need a dataset.\nYou can use your own dataset or some classic dataset (such as [Iris](https://archive.ics.uci.edu/ml/datasets/iris)).\n\nLet's use the Iris dataset from the Sklearn library and split it into the training and testing subsets.\n\n```python\nfrom sklearn.datasets import load_iris\nfrom sklearn.model_selection import train_test_split\n\ndataset = load_iris()\nX_train, X_test, y_train, y_test = train_test_split(dataset.data, dataset.target, test_size=0.2)\n```\n\n### Training/Prediction\n\n#### Clustering\nFor the clustering example, let's import KMeans and demonstrate how to use it with the ML Tutor library.\nNotice that you can train/test it just like any `sklearn` algorithm.\n\nEach algorithm has several arguments you can provide, but the unique one across all of them is `visual_training`. \nIf you set this to `True`, you will see the whole training process inside your IDE.\n\n```python\nfrom ml_tutor.clustering.kmeans import KMeans\n\nclf = KMeans(n_clusters=3, visual_training=True)\nclf.fit(X_train)\n```\n![](images/kmeans-vt.gif)\n\n#### Classification\n\nFor the classification example, let's use KNeighbourClassifier (KNN).\n\nBecause the KNN just stores data when you call the `.fit()` function on it, the visualization part comes in the __prediction__ time.\n\n```python\nfrom ml_tutor.classification.knn import KNeighbourClassifier\n\nclf = KNeighbourClassifier(n_neighbors=5, visual_training=True, number_of_visual_steps=2)\nclf.fit(X_train, y_train)\n\npredictions = clf.predict(X_test)\n```\n\n![](images/knn.gif)\n\n### How an algorithm works? (theory)\n\nEvery algorithm has method `.how_it_works()` which generates a blog post directly inside your IDE.\nEvery blog is written by somebody from the community, not myself, and in the end, they get a shout out for the great material.\n```python\nfrom ml_tutor.classification.knn import KNeighbourClassifier\n\nclf = KNeighbourClassifier()\nclf.how_it_works()\n```\n\n![](images/th.gif)\n\n#### What if I prefer video instead of reading tutorial?\n\nI've got you covered! Just place `video=True` inside the method `how_it_works()`, and it will open a YouTube video for you.\n\n```python\nfrom ml_tutor.classification.knn import KNeighbourClassifier\n\nclf = KNeighbourClassifier()\nclf.how_it_works(video=True)\n```\n\n![](images/thv.gif)\n\n\n### Interview questions\n\nIf you call `.interview_questions()` on any algorithm, it will generate resources with interview questions for the algorithm.\n\n```python\nfrom ml_tutor.classification.knn import KNeighbourClassifier\n\nclf = KNeighbourClassifier()\nclf.interview_questions()\n```\n\n![](images/inter-q.png)\n\n### Sklearn code\n\nSince 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!\n\nNOTE: For now, this method only works in Jupyter Notebook!\n\n```python\nfrom ml_tutor.classification.knn import KNeighbourClassifier\n\nclf = KNeighbourClassifier()\nclf.sklearn_version()\n```\n\n![](images/sklearn.gif)\n\n## Supported IDEs\n\nFor now this library is fully supported for `Jupyter Notebook` and partially supported for `Google Colab` \n(read `Sklearn code` section for more details). \n\n## Installation\n\n### Installation with `pip`\n\nYou can install ML Tutor directly from the PyPi repository using `pip` (or `pip3`): \n\n```bash\npip install ml-tutor\n```\n\n### Manual installation\n\nIf you prefer to install it from source:\n\n1. Clone this repository\n\n```bash\ngit clone https://github.com/lucko515/ml-tutor\n```\n\n2. Go to the library folder and run\n\n```bash\npip install .\n```\n\n## TODO\n\nIf you want to contribute to the ML Tutor, here is what's on the TODO list:\n\n- [ ] `.sklearn_version()` is not working in Google Colab\n- [ ] Logistic Regression visualization needs a re-do, currently it's not showing how the classification lines moves over time\n- [ ] Interview questions should be added to each algorithm (take the `knn.py` as a reference)\n- [ ] Visualization export to `.gif` and/or `.mp4`\n- [ ] Additional algorithms (e.g. NaiveBayes)\n- [ ] Support for other IDEs (e.g. regular Python Shell)\n\n## Contact\n\nAdd me on [LinkedIn](https://www.linkedin.com/in/luka-anicin/).\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucko515%2Fml_tutor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucko515%2Fml_tutor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucko515%2Fml_tutor/lists"}