Skip to content
Β 
Β 

Latest commit

Β 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– ML Mastery

A Complete Machine Learning Reference β€” From Zero to Production

Learn every major ML algorithm with math intuition, from-scratch implementation, and real-world projects.

Stars Forks License Open In Colab

Python Jupyter scikit-learn PRs Welcome


πŸš€ Why ML Mastery?

Most ML tutorials give you either:

  • πŸ”΄ Copy-paste code with no explanation of why it works, or
  • πŸ”΄ Dense math papers with no practical implementation

These notebooks bridge that gap. Every notebook gives you:

βœ… Plain English explanation β†’ βœ… Mathematical derivation β†’ βœ… Visual intuition β†’ βœ… From-scratch NumPy code β†’ βœ… Production sklearn code

Whether you're a complete beginner or an experienced engineer brushing up for an interview, this is your one-stop reference.


πŸ‘₯ Who is this for?

πŸŽ“ Students πŸ‘¨β€πŸ’» Engineers 🎯 Interview Prep
Learning ML from scratch with one structured, progressive path Quickly look up syntax, parameters, and best practices mid-project Algorithms explained conceptually + common interview Q&A included

πŸ“ Repository Structure

ml-mastery/
β”‚
β”œβ”€β”€ 01_libraries/               # πŸ“¦ Core Python libraries for ML
β”‚   β”œβ”€β”€ numpy.ipynb             # Arrays, operations, broadcasting, indexing
β”‚   β”œβ”€β”€ pandas.ipynb            # DataFrames, cleaning, groupby, merging
β”‚   └── matplotlib.ipynb        # Plots, subplots, styling, saving figures
β”‚
β”œβ”€β”€ 02_ml_concepts/             # 🧠 ML algorithms with math intuition + code
β”‚   β”œβ”€β”€ linear_regression.ipynb     # OLS, gradient descent, cost function
β”‚   β”œβ”€β”€ logistic_regression.ipynb   # Sigmoid, log loss, decision boundary
β”‚   β”œβ”€β”€ decision_trees.ipynb        # Entropy, Gini, information gain
β”‚   β”œβ”€β”€ random_forest.ipynb         # Bagging, feature importance, OOB error
β”‚   β”œβ”€β”€ svm.ipynb                   # Hyperplane, margin, kernel trick
β”‚   β”œβ”€β”€ knn.ipynb                   # Distance metrics, choosing K
β”‚   β”œβ”€β”€ naive_bayes.ipynb           # Bayes theorem, conditional probability
β”‚   β”œβ”€β”€ unsupervised.ipynb          # K-Means, DBSCAN, PCA, t-SNE
β”‚   β”œβ”€β”€ feature_engineering.ipynb   # Encoding, scaling, selection, pipelines
β”‚   └── model_evaluation.ipynb      # Metrics, cross-validation, bias-variance
β”‚
β”œβ”€β”€ 03_projects/                # πŸ—οΈ End-to-end ML projects on real datasets
β”‚   β”œβ”€β”€ titanic.ipynb           # Binary classification β€” survival prediction
β”‚   └── house_price.ipynb       # Regression β€” price prediction
β”‚
β”œβ”€β”€ extras/                     # πŸ“Œ Quick reference materials
β”‚   β”œβ”€β”€ cheatsheet.md           # Most-used commands across all libraries
β”‚   └── interview_qa.md         # Common ML interview questions and answers
β”‚
β”œβ”€β”€ requirements.txt            # All dependencies
β”œβ”€β”€ CONTRIBUTING.md             # How to contribute
└── README.md                   # Project README

πŸ““ Notebooks Quick Access

Click a notebook name to view it on GitHub, or click the Colab badge to open it directly in Google Colab β€” no setup required.

πŸ“¦ 01 β€” Libraries

Notebook What You'll Learn Open
numpy.ipynb Arrays, broadcasting, vectorized math, indexing Colab
pandas.ipynb DataFrames, data cleaning, groupby, merging Colab
matplotlib.ipynb Plots, subplots, styling, saving figures Colab

🧠 02 β€” ML Concepts

Notebook What You'll Learn Open
linear_regression.ipynb OLS, gradient descent, cost function, RΒ² Colab
logistic_regression.ipynb Sigmoid, log loss, decision boundary Colab
decision_trees.ipynb Entropy, Gini impurity, information gain Colab
random_forest.ipynb Bagging, feature importance, OOB error Colab
svm.ipynb Hyperplane, margin maximization, kernel trick Colab
knn.ipynb Distance metrics, K selection, curse of dimensionality Colab
naive_bayes.ipynb Bayes theorem, conditional probability, Laplace smoothing Colab
unsupervised.ipynb K-Means, DBSCAN, PCA, t-SNE dimensionality reduction Colab
feature_engineering.ipynb Encoding, scaling, feature selection, pipelines Colab
model_evaluation.ipynb Metrics, cross-validation, bias-variance tradeoff Colab

πŸ—οΈ 03 β€” Real-World Projects

Notebook Problem Type Dataset Open
titanic.ipynb Binary Classification Titanic survival Colab
house_price.ipynb Regression Housing prices Colab

πŸ—ΊοΈ Recommended Learning Path

Follow this order if you are starting from scratch:

πŸ“¦ NumPy β†’ Pandas β†’ Matplotlib
                ↓
🧠 Linear Regression β†’ Logistic Regression
                ↓
        Decision Trees β†’ Random Forest
                ↓
         SVM β†’ KNN β†’ Naive Bayes
                ↓
  Feature Engineering β†’ Model Evaluation
                ↓
        Unsupervised Learning
                ↓
πŸ—οΈ Projects (Titanic β†’ House Price)

Pro tip: Don't skip the libraries section. Everything in 02_ml_concepts/ depends heavily on NumPy and Pandas.


πŸ”¬ What's Inside Each Algorithm Notebook

Every notebook in 02_ml_concepts/ follows this proven structure:

Section What You Get
πŸ—£οΈ Concept Overview Plain English explanation of what the algorithm does and when to use it
πŸ“ Math Intuition The actual math β€” cost function, derivation, key equations
πŸ“Š Visual Intuition Plots and diagrams built from scratch to show what is happening
πŸ’» Code from Scratch Full implementation using only NumPy β€” no black boxes
βš™οΈ Sklearn Implementation The production-ready way with all parameters explained
⚠️ Common Mistakes What goes wrong, why, and how to fix it
🧩 Exercises Practice problems with worked solutions

⚑ Quick Start

Option 1 β€” Google Colab (recommended, zero setup)

Click any "Open in Colab" badge above. Everything runs instantly in your browser β€” no installation needed.

Option 2 β€” Run Locally

git clone https://github.com/himanshu231204/ml-mastery.git
cd ml-mastery
pip install -r requirements.txt
jupyter notebook

πŸ“š Extra Resources

Resource Description
πŸ“‹ Cheatsheet Most-used NumPy, Pandas, Matplotlib, and sklearn commands with output examples
🎯 Interview Q&A Common ML interview questions with detailed answers

πŸ› οΈ Dependencies

Library Version Purpose
numpy β‰₯ 1.24 Array operations, mathematical computing
pandas β‰₯ 2.0 Data manipulation and analysis
matplotlib β‰₯ 3.7 Data visualization
seaborn β‰₯ 0.12 Statistical data visualization
scikit-learn β‰₯ 1.3 Machine learning algorithms
scipy β‰₯ 1.11 Scientific and statistical computing

🀝 Contributing

Contributions are welcome and appreciated! Whether it's fixing a typo, adding a new algorithm notebook, or improving an explanation β€” every contribution helps.

See CONTRIBUTING.md for guidelines.


πŸ“„ License

This project is licensed under the MIT License β€” free to use, share, and modify with attribution. See LICENSE for details.


⭐ Support This Project

If this repository helped you learn or saved you time, please consider:

  • ⭐ Starring this repo β€” it helps others discover it
  • 🍴 Forking it β€” to build your own ML reference
  • πŸ“’ Sharing it β€” with friends, colleagues, or on social media

Every star motivates continued improvement. Thank you! πŸ™


πŸ‘¨β€πŸ’» Author

Himanshu Kumar

GitHub LinkedIn Twitter Email

Building tools that make machine learning accessible to everyone.

About

A structured Machine Learning learning & revision repository with hands-on notebooks, practical examples, and quick reference guides for developers and students.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages