Package: ml-tutor
ML Tutor v1.0.3ML 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 ColabVisualize what's happening with your data (Educational purpose only)UsageTo demonstrate what you can do with ML Tutor, we will need a dataset.
You can use your own dataset or some classic dataset (such asIris).Let's use the Iris dataset from the Sklearn library and split it into the training and testing subsets.fromsklearn.datasetsimportload_irisfromsklearn.model_selectionimporttrain_test_splitdataset=load_iris()X_train,X_test,y_train,y_test=train_test_split(dataset.data,dataset.target,test_size=0.2)Training/PredictionClusteringFor 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 anysklearnalgorithm.Each algorithm has several arguments you can provide, but the unique one across all of them isvisual_training.
If you set this toTrue, you will see the whole training process inside your IDE.fromml_tutor.clustering.kmeansimportKMeansclf=KMeans(n_clusters=3,visual_training=True)clf.fit(X_train)ClassificationFor 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 thepredictiontime.fromml_tutor.classification.knnimportKNeighbourClassifierclf=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.fromml_tutor.classification.knnimportKNeighbourClassifierclf=KNeighbourClassifier()clf.how_it_works()What if I prefer video instead of reading tutorial?I've got you covered! Just placevideo=Trueinside the methodhow_it_works(), and it will open a YouTube video for you.fromml_tutor.classification.knnimportKNeighbourClassifierclf=KNeighbourClassifier()clf.how_it_works(video=True)Interview questionsIf you call.interview_questions()on any algorithm, it will generate resources with interview questions for the algorithm.fromml_tutor.classification.knnimportKNeighbourClassifierclf=KNeighbourClassifier()clf.interview_questions()Sklearn codeSince this is the library for education and not for production, you'll need to learn how to use these algorithms with the battle-tested librarysklearn. Just call.sklearn_version()on any algorithm, and it will generate code for you!NOTE: For now, this method only works in Jupyter Notebook!fromml_tutor.classification.knnimportKNeighbourClassifierclf=KNeighbourClassifier()clf.sklearn_version()Supported IDEsFor now this library is fully supported forJupyter Notebookand partially supported forGoogle Colab(readSklearn codesection for more details).InstallationInstallation withpipYou can install ML Tutor directly from the PyPi repository usingpip(orpip3):pipinstallml-tutorManual installationIf you prefer to install it from source:Clone this repositorygitclonehttps://github.com/lucko515/ml-tutorGo to the library folder and runpipinstall.TODOIf you want to contribute to the ML Tutor, here is what's on the TODO list:.sklearn_version()is not working in Google ColabLogistic Regression visualization needs a re-do, currently it's not showing how the classification lines moves over timeInterview questions should be added to each algorithm (take theknn.pyas a reference)Visualization export to.gifand/or.mp4Additional algorithms (e.g. NaiveBayes)Support for other IDEs (e.g. regular Python Shell)ContactAdd me onLinkedIn.