Machine Learning Tutorials (Jupyter Notebooks) — English & فارسی
A bilingual, notebook-first machine learning course delivered in Jupyter Notebook (.ipynb) format. The repository is designed as a structured, chapter-by-chapter curriculum for learners who want a practical and theoretical path through classical machine learning, model evaluation, time series, reliability, MLOps, and applied case studies.
Each lesson is provided in:
- English:
Tutorials/English/...
- Persian (Farsi / فارسی):
Tutorials/Persian/... with Persian notebooks ending in _Fa.ipynb
The English and Persian notebooks cover the same material, with the Persian version being a translation of the English content.
Repository layout
Datasets/
Classification/ # tabular datasets for classification examples
Regression/ # tabular datasets for regression examples
Clustering/ # datasets for unsupervised learning and clustering
Tutorials/
English/
Chapter1/
Chapter1_Lesson01.ipynb
Chapter1_Lesson02.ipynb
...
...
Chapter37/
Chapter37_Lesson01.ipynb
Chapter37_Lesson02.ipynb
...
Persian/
Chapter1/
Chapter1_Lesson01_Fa.ipynb
Chapter1_Lesson02_Fa.ipynb
...
...
Chapter37/
Chapter37_Lesson01_Fa.ipynb
Chapter37_Lesson02_Fa.ipynb
...
css/
rtl.css # RTL styles used by Persian notebooks
- Datasets/ contains CSV files used in examples, exercises, and projects.
- Tutorials/ contains the notebooks organized by Chapter → Lesson.
- css/rtl.css supports right-to-left rendering for Persian notebooks.
Course size
This curriculum contains:
- 37 chapters
- 330 lessons
- Introductory, advanced, and comprehensive extension modules
- End-to-end capstone projects for applied classical machine learning
What you will learn
This course spans an end-to-end classical machine learning curriculum, progressing from foundations to advanced topics and applied case studies:
- Machine learning foundations, problem formulation, workflow design, and reproducibility
- Data preprocessing, feature engineering, leakage prevention, and pipeline hygiene
- Exploratory data analysis, diagnostics, statistical testing, and data-quality forensics
- Supervised learning: regression, classification, GLMs, regularization, robust methods, and cost-sensitive learning
- Decision trees, tree variants, ensemble learning, boosting, calibration, and imbalanced learning
- SVMs, kernel methods, instance-based learning, and probabilistic models
- Unsupervised learning, clustering, dimensionality reduction, and association rules
- Cross-validation, model evaluation, uncertainty estimation, and decision analysis
- Time series modeling, forecasting, rolling validation, and anomaly detection
- Bayesian networks, graphical models, Gaussian processes, causal inference, and experimentation
- Fairness, privacy, robustness, security, reliability, conformal prediction, and MLOps
- Scalable, online, specialized, and capstone machine learning workflows
Full course curriculum
Introductory Course of Machine Learning
Chapter 1: Introduction to Machine Learning
- Lesson 1: What is Machine Learning?
- Lesson 2: Types of Machine Learning (Supervised, Unsupervised, Semi-Supervised, Reinforcement Learning)
- Lesson 3: Applications and Real-World Use Cases
- Lesson 4: ML Workflow (Data, Model, Evaluation, Deployment)
- Lesson 5: History and Evolution of ML
- Lesson 6: Key Mathematical Foundations (Linear Algebra, Probability, Optimization)
- Lesson 7: Common Misconceptions and Challenges in ML
- Lesson 8: ML vs. Statistics vs. Data Mining vs. AI (Boundaries and Overlaps)
- Lesson 9: Problem Formulation (Inputs/Outputs, Objective, Constraints, Costs)
- Lesson 10: Learning Paradigms and Task Taxonomy (Regression, Classification, Ranking, Forecasting)
- Lesson 11: What “Good Performance” Means (Generalization, Robustness, Reliability)
- Lesson 12: Reproducibility Basics (Random Seeds, Determinism, Experiment Tracking Concepts)
Chapter 2: Basics of Data and Preprocessing
- Lesson 1: Understanding Data Types and Structures
- Lesson 2: Data Cleaning and Missing Values
- Lesson 3: Data Transformation and Encoding
- Lesson 4: Feature Scaling (Normalization & Standardization)
- Lesson 5: Handling Outliers and Imbalanced Data
- Lesson 6: Feature Engineering Fundamentals
- Lesson 7: Data Leakage and Prevention Techniques
- Lesson 8: Data Collection and Label Quality (Noise, Ambiguity, Measurement Error)
- Lesson 9: Missingness Mechanisms (MCAR, MAR, MNAR) and Practical Implications
- Lesson 10: Imputation Methods (Simple, kNN, Iterative/Multiple Imputation Concepts)
- Lesson 11: Encoding Categorical Features (One-Hot, Ordinal, Hashing, Target Encoding)
- Lesson 12: Train/Validation/Test Hygiene (Temporal Splits, Group Splits, Entity Leakage)
- Lesson 13: Building Preprocessing Pipelines (Fit/Transform Discipline, Column-Wise Pipelines)
Chapter 3: Exploratory Data Analysis (EDA)
- Lesson 1: Visualizing Data Distributions
- Lesson 2: Pairwise Relationships (Correlation, Scatterplots)
- Lesson 3: Detecting Patterns in Data
- Lesson 4: Dimensionality Reduction (Intro to PCA)
- Lesson 5: Using Tools like Pandas, Matplotlib, and Seaborn
- Lesson 6: Statistical Hypothesis Testing in ML Context
- Lesson 7: EDA for Data Quality (Duplicates, Inconsistencies, Drift, Label Issues)
- Lesson 8: Multicollinearity and Confounding Signals (Detection and Mitigation)
- Lesson 9: Leakage Forensics in EDA (Suspicious Features, Post-Outcome Variables)
- Lesson 10: EDA Reporting (Narratives, Assumptions, and Actionable Insights)
Chapter 4: Supervised Learning Basics
- Lesson 1: Introduction to Regression and Classification
- Lesson 2: Linear Regression: Concept and Applications
- Lesson 3: Logistic Regression: Binary Classification
- Lesson 4: Overfitting and Regularization (Ridge, LASSO, Elastic Net)
- Lesson 5: All Model Evaluation Metrics (MAE, MSE, RMSE, Accuracy, etc.)
- Lesson 6: Bias-Variance Tradeoff and Model Complexity
- Lesson 7: Polynomial and Interaction Terms in Regression Models
- Lesson 8: Generalized Linear Models (GLMs) Overview (Link Functions, Likelihood)
- Lesson 9: Multiclass Logistic Regression (Softmax) and Evaluation
- Lesson 10: Ordinal Regression (When Class Order Matters)
- Lesson 11: Robust Regression (Huber, RANSAC Concepts and Use Cases)
- Lesson 12: Quantile Regression and Prediction Intervals (Intro)
- Lesson 13: Cost-Sensitive Learning Basics (Thresholding, Costs, Utility)
Chapter 5: Decision Trees and Variants
- Lesson 1: Concept of Decision Trees
- Lesson 2: CART (Classification and Regression Trees)
- Lesson 3: Pruning and Overfitting in Trees
- Lesson 4: CHAID and M5 Model Trees
- Lesson 5: C4.5 and C5.0 Decision Trees
- Lesson 6: Interpretability and Feature Importance in Trees
- Lesson 7: Split Criteria (Gini, Entropy, Gain Ratio, Variance Reduction)
- Lesson 8: Handling Missing Values and Categorical Variables in Trees
- Lesson 9: Tree Stability, Variance, and Sensitivity Analysis
- Lesson 10: Monotonic Constraints and Business Rules in Tree Models (Concepts)
Chapter 6: Ensemble Learning Techniques
- Lesson 1: What is Ensemble Learning?
- Lesson 2: Bagging Algorithms (Random Forest, Bootstrap Aggregation)
- Lesson 3: Boosting Algorithms (AdaBoost, Gradient Boosting)
- Lesson 4: Stacking and Blending Techniques
- Lesson 5: Comparison of Ensemble Methods
- Lesson 6: Voting Classifiers and Averaging Methods
- Lesson 7: Bias-Variance Reduction via Ensembles
- Lesson 8: Out-of-Bag (OOB) Estimation and When It Works
- Lesson 9: Extremely Randomized Trees (ExtraTrees) and Diversity
- Lesson 10: Calibration with Ensembles (Platt Scaling, Isotonic Regression Overview)
- Lesson 11: Imbalanced Data with Ensembles (Class Weights, Balanced RF, Thresholding)
Chapter 7: Support Vector Machines (SVM)
- Lesson 1: Concept of SVM for Classification
- Lesson 2: Kernel Functions in SVM
- Lesson 3: Soft Margin and Hyperparameters
- Lesson 4: Support Vector Regression (SVR)
- Lesson 5: Applications of SVM in Real-World Problems
- Lesson 6: Mathematical Formulation of the SVM Optimization Problem
- Lesson 7: Kernel Trick Intuition and Feature Spaces
- Lesson 8: Multi-Class SVM Strategies (OvR, OvO) and Practical Tradeoffs
- Lesson 9: SVM Probability Estimates and Calibration Considerations
- Lesson 10: Scaling SVMs (Approximate Kernels, Linear SVMs, Complexity)
Chapter 8: Instance-Based Learning
- Lesson 1: K-Nearest Neighbors (KNN) Algorithm
- Lesson 2: Choosing the Right K
- Lesson 3: Distance Metrics and Weighting
- Lesson 4: Locally Weighted Learning (LWL)
- Lesson 5: Applications and Challenges
- Lesson 6: Curse of Dimensionality and Its Impact on KNN
- Lesson 7: kNN Regression and Local Smoothing Bias/Variance
- Lesson 8: Approximate Nearest Neighbors (KD-Trees, Ball Trees, ANN Concepts)
- Lesson 9: Metric Learning Overview (When Distances Should Be Learned)
Chapter 9: Probabilistic Models
- Lesson 1: Naïve Bayes Classifier
- Lesson 2: Gaussian Naïve Bayes
- Lesson 3: Bayesian Linear Regression
- Lesson 4: Assumptions and Limitations
- Lesson 5: Case Studies with Probabilistic Models
- Lesson 6: Maximum Likelihood vs. Bayesian Estimation
- Lesson 7: Bayesian Decision Theory (Risk, Loss, Bayes Optimal Classifier)
- Lesson 8: Priors and Conjugacy (Conceptual Toolkit for Fast Bayesian Updates)
- Lesson 9: MAP Estimation, Regularization Connections, and Interpretations
- Lesson 10: Expectation-Maximization (EM) Intuition (Preview for Later Chapters)
Chapter 10: Unsupervised Learning Basics
- Lesson 1: Introduction to Clustering
- Lesson 2: K-Means Clustering
- Lesson 3: Hierarchical Clustering
- Lesson 4: Gaussian Mixture Models (GMM)
- Lesson 5: Applications of Clustering Techniques
- Lesson 6: Evaluation Metrics for Clustering (Silhouette, Davies-Bouldin)
- Lesson 7: K-Means Variants (k-medoids, k-means++ initialization)
- Lesson 8: Model-Based Clustering and Selecting Number of Clusters (AIC/BIC concepts)
- Lesson 9: Constraints and Practicalities (Must-Link/Cannot-Link, Business Constraints)
- Lesson 10: Clustering at Scale (Mini-Batch K-Means and Sampling Strategies)
Chapter 11: Dimensionality Reduction
- Lesson 1: Principal Component Analysis (PCA)
- Lesson 2: t-SNE for Visualization
- Lesson 3: Linear Discriminant Analysis (LDA)
- Lesson 4: Feature Selection vs Feature Extraction
- Lesson 5: Applications of Dimensionality Reduction
- Lesson 6: Independent Component Analysis (ICA)
- Lesson 7: Random Projections and Johnson–Lindenstrauss Intuition
- Lesson 8: Non-negative Matrix Factorization (NMF) for Parts-Based Representations
- Lesson 9: Sparse PCA and Interpretability Tradeoffs
- Lesson 10: Embedded Feature Selection (L1, Tree-Based, Permutation Importance Overview)
Chapter 12: Association Rule Learning
- Lesson 1: Concept of Association Rules
- Lesson 2: Apriori Algorithm
- Lesson 3: Eclat Algorithm
- Lesson 4: Market Basket Analysis
- Lesson 5: Challenges and Limitations
- Lesson 6: Evaluation Metrics (Support, Confidence, Lift)
- Lesson 7: FP-Growth (Frequent Pattern Growth) and When It Outperforms Apriori
- Lesson 8: Rule Pruning and Redundancy Control
- Lesson 9: Sequential Pattern Mining (Concepts and Use Cases)
Chapter 13: Cross-Validation and Model Evaluation
- Lesson 1: Train-Test Split and Validation
- Lesson 2: K-Fold Cross-Validation
- Lesson 3: Stratified Sampling in Cross-Validation
- Lesson 4: Performance Metrics for Classification
- Lesson 5: Performance Metrics for Regression
- Lesson 6: Model Calibration and ROC Curves
- Lesson 7: Learning Curves and Validation Curves
- Lesson 8: Nested Cross-Validation for Model Selection (Leakage Avoidance)
- Lesson 9: Bootstrap Methods for Performance Estimation and Uncertainty
- Lesson 10: Statistical Tests for Comparing Models (Paired Tests, Practi