Machine Learning A to Z with AI
Go from beginner to job-ready — master every core ML algorithm with hands-on projects in Python & R.
Machine Learning A to Z with AI takes you from absolute beginner to confident practitioner — covering every major ML technique with hands-on projects in both Python and R. You'll learn the intuition behind each algorithm first, then build it yourself: from regression and classification to clustering, NLP, and deep learning. By the end, you'll be able to build real-world models, make data-driven decisions, and step into AI and data-science roles with confidence.
What You'll Learn
- Master data preprocessing in both Python and R
- Build regression models: Linear, Polynomial, SVR, Decision Tree & Random Forest
- Apply classification: Logistic Regression, K-NN, SVM, Kernel SVM & Naive Bayes
- Cluster data with K-Means and Hierarchical Clustering
- Mine patterns with Apriori & Eclat, plus Reinforcement Learning (UCB & Thompson Sampling)
- Implement NLP and Deep Learning (ANN & CNN) with TensorFlow
- Reduce dimensions with PCA, LDA & Kernel PCA
- Select and boost models with K-Fold Cross-Validation and XGBoost
Course Curriculum
Module 01: Welcome to the Course 3 lessons
- Welcome to the Course — Predict Car Purchases with Python & Scikit-learn in 5 Minutes
- How to Use Google Colab & the Machine Learning Course Folder
- Getting Started with R: Install R and RStudio on Windows & Mac
Module 02: Part 1 — Data Preprocessing 3 lessons
- Machine Learning Workflow: Importing, Modeling, and Evaluating Your ML Model
- Data Preprocessing: Importance of the Training/Test Split in ML Model Evaluation
- Feature Scaling: Normalization vs Standardization Explained
Module 03: Data Preprocessing in Python 18 lessons
- Data Preprocessing in Python: Preparing Your Dataset for ML Models
- Data Preprocessing Techniques: From Raw Data to ML-Ready Datasets
- ML Toolkit: Importing NumPy, Matplotlib, and Pandas Libraries
- Importing Datasets Using Pandas read_csv()
- Using Pandas iloc for Feature Selection in Data Preprocessing
- Building X and Y Vectors for ML Model Training
- Using Scikit-Learn to Replace Missing Values
- Imputing Missing Data: SimpleImputer and Numerical Columns
- One-Hot Encoding: Transforming Categorical Features for ML Algorithms
- Handling Categorical Data: One-Hot Encoding with ColumnTransformer
- Preprocessing Categorical Data: One-Hot and Label Encoding
- How to Prepare Data for ML: Training vs Test Sets
- Creating Training and Test Sets in Python
- Splitting Data into Training and Test Sets: Best Practices
- Feature Scaling: Why It's Crucial for Data Preprocessing
- How to Scale Numeric Features in Python
- Implementing Feature Scaling: Fit and Transform Methods Explained
- Applying the Same Scaler to Training and Test Sets
Module 04: Data Preprocessing in R 10 lessons
- Data Preprocessing for Beginners: Preparing Your Dataset
- Understanding Independent vs Dependent Variables
- R Tutorial: Importing and Viewing Datasets
- How to Handle Missing Values in R
- Using R's Factor Function to Handle Categorical Variables
- How to Prepare Data for ML: Training vs Test Sets
- Creating Training and Test Sets in R
- Feature Scaling Step 1: Why It's Crucial
- How to Scale Numeric Features in R — Step 2
- Essential Steps in Data Preprocessing
Module 05: Part 2 — Regression 1 lesson
- Welcome to Part 2 — Regression
Module 06: Simple Linear Regression 15 lessons
- Simple Linear Regression: Understanding the Equation & Yield Prediction
- How to Find the Best-Fit Line: Ordinary Least Squares Regression
- Step 1a: Simple Linear Regression — Key Concepts and Implementation
- Step 1b: Data Preprocessing for Linear Regression in Python
- Step 2a: Building a Simple Linear Regression Model with Scikit-learn
- Step 2b: Training a Linear Regression Model in Python
- Step 3: Using Scikit-Learn's Predict Method for Linear Regression
- Step 4a: Plotting Real vs Predicted Salaries
- Step 4b: Evaluating Linear Regression Performance on Test Data
- Step 1: Data Preprocessing in R for Linear Regression
- Step 2: Fitting Simple Linear Regression in R (lm Function)
- Step 3: Using the predict() Function in R
- Step 4a: Plotting Linear Regression Data in R with ggplot2
- Step 4b: Scatter Plot with Regression Line in R
- Step 4c: Comparing Training vs Test Set Predictions
Module 07: Multiple Linear Regression 24 lessons
- Startup Success Prediction: A Regression Model for VC Decisions
- Multiple Linear Regression: Independent Variables & Prediction Models
- Regression Assumptions: Linearity, Homoscedasticity & More
- How to Handle Categorical Variables in Linear Regression
- Multicollinearity: Understanding the Dummy Variable Trap
- Understanding P-Values and Statistical Significance
- Backward Elimination: Building Robust Regression Models
- Step 1a: Data Preprocessing for Multiple Linear Regression (Python)
- Step 1b: Implementing Multiple Linear Regression in Python
- Step 2a: Preparing Data for MLR in Python
- Step 2b: Multiple Linear Regression — Preparing Your Dataset
- Step 3a: Scikit-learn for Efficient MLR Model Building
- Step 3b: Building & Training Multiple Linear Regression Models
- Step 4a: Comparing Real vs Predicted Profits
- Step 4b: Evaluating Multiple Linear Regression Accuracy
- Step 1a: Data Preprocessing for MLR — Handling Categorical Data (R)
- Step 1b: Preparing Datasets for MLR in R
- Step 2a: Building & Interpreting the Regressor in R
- Step 2b: Statistical Significance — P-values & Stars
- Step 3: Using predict() for Multiple Linear Regression in R
- Optimizing Regression Models: Backward Elimination in R
- Feature Selection: Backward Elimination in R
- Multiple Linear Regression in R — Automatic Backward Elimination
- Multiple Linear Regression Quiz
Module 08: Polynomial Regression 19 lessons
- Understanding Polynomial Regression: Applications and Examples
- Step 1a: Building a Polynomial Regression Model (Python)
- Step 1b: Setting Up Data for Linear vs Polynomial Comparison
- Step 2a: Preparing Data for Advanced Models
- Step 2b: Transforming Linear to Polynomial Regression
- Step 3a: Plotting Real vs Predicted Salaries
- Step 3b: Polynomial vs Linear — Better Fit with Higher Degrees
- Step 4a: Predicting Salaries — Linear Regression in Python
- Step 4b: Polynomial Regression — Predicting Salaries Accurately
- Step 1a: Polynomial Regression in R — HR Salary Case Study
- Step 1b: Preparing Data for Polynomial Regression
- Step 2a: Building Linear & Polynomial Models in R
- Step 2b: Adding Squared & Cubed Terms
- Step 3a: Visualizing Regression Results with ggplot2
- Step 3b: Plotting Predictions vs Observations
- Step 3c: Polynomial Regression Curve Fitting
- Step 4a: Single Predictions Using Polynomial Regression in R
- Step 4b: Predicting Salaries — A Practical Example
- Step 1: A Reusable Framework for Nonlinear Regression in R
Module 09: Support Vector Regression (SVR) 14 lessons
- How SVR Differs from Linear Regression
- RBF Kernel SVR: From Linear to Non-Linear Regression
- Step 1a: SVR Model Training — Feature Scaling & Dataset Prep (Python)
- Step 1b: SVR in Python — Importing Libraries and Dataset
- Step 2a: Feature Scaling for SVR in Python
- Step 2b: Reshaping Data — Preparing the Y Vector
- Step 2c: Scaling X & Y Independently with StandardScaler
- Step 3: Training the SVR Model with an RBF Kernel
- Step 4: SVR Prediction — Handling Scaled Data & Inverse Transformation
- Step 5a: How to Plot Support Vector Regression Models
- Step 5b: SVR Scaling & Inverse Transformation in Python
- Step 1: Creating a Support Vector Machine Regressor in R
- Step 2: Building a Predictive SVR Model
- SVR Quiz
Module 10: Decision Tree Regression 11 lessons
- How to Build a Regression Tree — Step-by-Step
- Step 1a: Decision Tree Regression Without Feature Scaling
- Step 1b: Uploading & Preprocessing Data (Python)
- Step 2: Implementing DecisionTreeRegressor in Python
- Step 3: Making Predictions with Decision Tree Regression
- Step 4: Visualizing Decision Tree Regression (High-Resolution)
- Step 1: Creating a Decision Tree Regressor with rpart in R
- Step 2: Fixing Splits with rpart Control Parameters
- Step 3: Non-Continuous Regression — Visualization Challenges
- Step 4: Understanding Intervals and Predictions
- Decision Tree Regression Quiz
Module 11: Random Forest Regression 7 lessons
- Understanding the Random Forest Algorithm — Intuition & Application
- Step 1: Building a Random Forest Regression Model (Python)
- Step 2: Key Parameters and Model Fitting
- Step 1: Building a Random Forest Model in R
- Step 2: Interpreting Stairs and Splits
- Step 3: Fine-Tuning from 10 to 500 Trees
- Random Forest Regression Quiz
Module 12: Evaluating Regression Models Performance 3 lessons
- Understanding R-Squared: Goodness of Fit
- Understanding Adjusted R-Squared
- Evaluating Regression Models Performance Quiz
Module 13: Regression Model Selection in Python 7 lessons
- Step 1: Comparing Models for Optimal Performance
- Step 2: Generic Code Templates for Regression Models
- Step 3: R-Squared & Performance Metrics Explained
- Step 4: Implementing R-Squared Score with Scikit-Learn
- Step 1: Selecting the Best Regression Model
- Step 2: Random Forest vs SVR Performance
- Conclusion of Part 2 — Regression
Module 14: Regression Model Selection in R 3 lessons
- R-Squared vs Adjusted R-Squared Explained
- Interpreting Coefficients for Business Decisions
- Conclusion of Part 2 — Regression
Module 15: Part 3 — Classification 2 lessons
- Welcome to Part 3 — Classification
- What is Classification in Machine Learning
Module 16: Logistic Regression 28 lessons
- Understanding Logistic Regression: Predicting Categorical Outcomes
- Finding the Best-Fit Curve Using Maximum Likelihood
- Step 1a: Logistic Regression for Customer Behavior Prediction
- Step 1b: Data Preprocessing for Logistic Regression (Python)
- Step 2a: Dataset Prep for Logistic Regression
- Step 2b: Feature Scaling Techniques
- Step 3a: Importing & Using the LogisticRegression Class
- Step 3b: Training the Model with the Fit Method
- Step 4a: Formatting Single Observation Input for Predict
- Step 4b: Predicted vs Real Purchase Decisions
- Step 5: Comparing Predicted vs Real Results
- Step 6a: Confusion Matrix and Accuracy Score in Scikit-Learn
- Step 6b: Confusion Matrix & Accuracy Metrics
- Step 7a: Visualizing Decision Boundaries (2D Plot)
- Step 7b: Interpreting Prediction Regions
- Step 7c: Visualizing Performance on New Data
- Logistic Regression in Python — Step 7 Recap
- Step 1: Data Preprocessing for Logistic Regression in R
- Step 2: Creating a Classifier Using R's GLM Function
- Step 3: Logistic Regression Prediction in R
- Step 4: Assessing Accuracy with a Confusion Matrix
- Step 5a: Interpreting Prediction Regions in R
- Step 5b: Linear Classifiers & Prediction Boundaries
- Step 5c: Colorizing Pixels for Logistic Regression in R
- Logistic Regression in R — Step 5 Recap
- Building a Reusable Classification Template in R
- Machine Learning Regression and Classification — EXTRA
- Logistic Regression Quiz
Module 17: K-Nearest Neighbors (K-NN) 8 lessons
- K-Nearest Neighbors Explained: A Beginner's Guide
- Step 1: Python KNN — Classifying Customer Data
- Step 2: Building a KNN Model with KNeighborsClassifier
- Step 3: Visualizing KNN Decision Boundaries
- Step 1: Implementing KNN Classification in R
- Step 2: Preparing Training and Test Sets in R
- Step 3: Adapting the Classifier Template in R
- K-Nearest Neighbors Quiz
Module 18: Support Vector Machine (SVM) 6 lessons
- Support Vector Machines Explained: Hyperplanes & Support Vectors
- Step 1: Building an SVM Model with Scikit-learn
- Step 2: Building an SVM Model with Sklearn's SVC
- Step 3: Linear SVM Limitations vs KNN
- Step 1: Building a Linear SVM Classifier in R
- Step 2: Evaluating the Linear SVM Classifier in R
Module 19: Kernel SVM 11 lessons
- From Linear to Non-Linear SVM: Higher Dimensional Spaces
- Transforming Non-Linear Data for Linear Separation
- The Kernel Trick for Non-Linear Classification
- Understanding Different Types of Kernel Functions
- Non-Linear SVR with the RBF Kernel Explained
- Step 1: Python Kernel SVM — Applying RBF
- Step 2: Improving Accuracy with Non-Linear Classifiers
- Step 1: Kernel SVM vs Linear SVM in R
- Step 2: Building a Gaussian Kernel SVM Classifier
- Step 3: Visualizing Kernel SVM
- Kernel SVM Quiz
Module 20: Naive Bayes 11 lessons
- Understanding Bayes' Theorem Intuitively
- Understanding the Naive Bayes Algorithm
- Bayes' Theorem: Step-by-Step Probability Calculation
- Why is Naive Bayes Called 'Naive'?
- Step 1: Naive Bayes in Python — Social Network Ads
- Step 2: Training and Evaluating a Classifier
- Step 3: Analyzing Results — Accuracy and Predictions
- Step 1: Getting Started with Naive Bayes in R
- Step 2: Troubleshooting Empty Prediction Vectors
- Step 3: Visualizing Results — Confusion Matrix and Graphs
- Naive Bayes Quiz
Module 21: Decision Tree Classification 7 lessons
- How Decision Tree Algorithms Work — with Examples
- Step 1: Decision Tree Classification in Python
- Step 2: Optimizing Performance in Python
- Step 1: Creating a Decision Tree Classifier with rpart (R)
- Step 2: Optimizing Prediction Boundaries in R
- Step 3: Exploring Splits and Conditions in R
- Decision Tree Classification Quiz
Module 22: Random Forest Classification 7 lessons
- Understanding Random Forest: Decision Trees & Majority Voting
- Step 1: Random Forest Classification in Python
- Step 2: Confusion Matrix & Accuracy Metrics
- Step 1: From Template to Implementation in R
- Step 2: Visualizing Predictions & Results
- Step 3: Evaluating Performance & Overfitting
- Random Forest Classification Quiz
Module 23: Classification Model Selection in Python 5 lessons
- Mastering the Confusion Matrix: True/False Positives & Negatives
- Step 1: Choosing the Right Classification Algorithm
- Step 2: Streamlined Classification Code in Python
- Step 3: Accuracy Metrics in Python
- Step 4: The Model Selection Process
Module 24: Evaluating Classification Models Performance 7 lessons
- Interpreting Predictions and Errors
- The Accuracy Paradox and Better Metrics
- Understanding CAP Curves
- Mastering CAP Analysis with Accuracy Ratio
- Classification — Pros & Cons
- Conclusion of Part 3 — Classification
- Evaluating Classification Model Performance Quiz
Module 25: Part 4 — Clustering 1 lesson
- Welcome to Part 4 — Clustering
Module 26: K-Means Clustering 17 lessons
- What is Clustering? Introduction to Unsupervised Learning
- K-Means Clustering Tutorial: Visualizing the Algorithm
- How to Use the Elbow Method in K-Means
- K-Means++ : Solving the Random Initialization Trap
- Step 1a: Python K-Means — Identifying Customer Patterns
- Step 1b: Data Preparation in Colab/Jupyter
- Step 2a: Selecting Relevant Features for Analysis
- Step 2b: Optimizing Features for 2D Visualization
- Step 3a: Implementing the Elbow Method
- Step 3b: WCSS and Elbow Method Implementation
- Step 3c: Plotting the Elbow Method Graph
- Step 4: Creating a Dependent Variable from Clustering Results
- Step 5a: Visualizing K-Means Clusters with a Scatter Plot
- Step 5b: Plotting Customer Segments
- Step 5c: Insights from K-Means Clustering
- Step 1: K-Means in R — Importing & Exploring Data
- Step 2: Fitting and Analyzing Mall Data in R
Module 27: Hierarchical Clustering 17 lessons
- How to Perform Hierarchical Clustering — Step-by-Step
- Dendrograms: Visualizing Cluster Dissimilarity
- Dendrogram Analysis and Threshold Setting
- Step 1: Getting Started — Data Setup in Python
- Step 2a: Building a Dendrogram with SciPy
- Step 2b: Dendrogram Basics in Python
- Step 2c: Interpreting Dendrograms for Optimal Clusters
- Step 3a: Building a Model with Scikit-learn
- Step 3b: Comparing 3 vs 5 Clusters
- Step 1: R Data Import — Income & Spending Score
- Step 2: Building & Interpreting Dendrograms in R
- Step 3: Hierarchical Clustering Using hclust in R
- Step 4: Visualizing Clustering Results in R
- Step 5: Understanding Customer Spending Patterns
- Hierarchical Clustering Quiz
- Clustering — Pros & Cons
- Conclusion of Part 4 — Clustering
Module 28: Part 5 — Association Rule Learning 1 lesson
- Welcome to Part 5 — Association Rule Learning
Module 29: Apriori 9 lessons
- Apriori Algorithm: Uncovering Hidden Patterns in Data
- Step 1: Boost Sales with Python Data Mining
- Step 2: Creating a List of Transactions
- Step 3: Configuring Apriori — Support, Confidence & Lift
- Step 4: Visualizing Apriori Results for Product Deals
- Step 1: Creating a Sparse Matrix in R
- Step 2: Choosing Minimum Support and Confidence
- Step 3: Optimizing Product Placement — Lift & Confidence
- Apriori Quiz
Module 30: Eclat 5 lessons
- Mastering ECLAT: Support-Based Market Basket Optimization
- Adapting Apriori to Eclat for Frequent Itemset Mining
- Eclat vs Apriori Simplified
- Eclat — Hands-On
- Eclat Quiz
Module 31: Part 6 — Reinforcement Learning 1 lesson
- Welcome to Part 6 — Reinforcement Learning
Module 32: Upper Confidence Bound (UCB) 14 lessons
- The Multi-Armed Bandit: Exploration vs Exploitation
- The UCB Algorithm: Solving the Multi-Armed Bandit Problem
- Step 1: UCB in Python — Problem Setup
- Step 2: Implementing UCB — Data Preparation
- Step 3: Setting Up Key Variables
- Step 4: Coding the UCB Algorithm Step-by-Step
- Step 5: Optimizing Ad Selection in Python
- Step 6: Finalizing the UCB Algorithm
- Step 7: Visualizing UCB Results with a Histogram
- Step 1: Exploring UCB in R
- Step 2: Calculating Average Reward & Confidence Interval
- Step 3: Optimizing Ad Selection with UCB
- Step 4: Analyzing Ad Selection with Histograms
- Upper Confidence Bound Quiz
Module 33: Thompson Sampling 10 lessons
- Understanding Thompson Sampling: Intuition & Implementation
- Deterministic vs Probabilistic: UCB vs Thompson Sampling
- Step 1: Python Implementation for Bandit Problems
- Step 2: Optimizing Ad Selection
- Step 3: Maximizing Random Beta Distributions
- Step 4: Beating UCB with Thompson Sampling
- Additional Resource for this Section
- Step 1: Thompson Sampling vs UCB in R
- Step 2: Thompson Sampling Outperforms UCB
- Thompson Sampling Quiz
Module 34: Part 7 — Natural Language Processing 24 lessons
- Welcome to Part 7 — Natural Language Processing
- NLP Basics: Understanding Bag of Words
- Deep NLP & Sequence-to-Sequence Models
- From If/Else Rules to CNNs: The Evolution of NLP
- Implementing Bag of Words — Step-by-Step
- Step 1: Getting Started with Sentiment Analysis
- Step 2: Importing TSV Data for Sentiment Analysis
- Step 3: Text Cleaning — Punctuation & Lowercase
- Step 4: Stemming and Stop-Word Removal (Python)
- Step 5: Tokenization and Feature Extraction
- Step 6: Training & Evaluating a Naive Bayes Classifier
- Natural Language Processing in Python — EXTRA
- Homework Challenge
- Step 1: Text Classification with Bag-of-Words & Random Forest (R)
- Step 2: NLP Data Preprocessing in R
- Step 3: Initialising a Corpus for Sentiment Analysis
- Step 4: Lowercase Transformation in R
- Step 5: Removing Numbers with tm_map
- Step 6: Removing Punctuation for NLP
- Step 7: Removing Stop Words with SnowballC
- Step 8: Stemming for Efficient Feature Matrices
- Step 9: Removing Extra Spaces
- Step 10: Building a Document-Term Matrix
- Homework Challenge
Module 35: Part 8 — Deep Learning 3 lessons
- Welcome to Part 8 — Deep Learning
- Introduction to Deep Learning: History to Modern Applications
- Deep Learning Quiz
Module 36: Artificial Neural Networks (ANN) 18 lessons
- The Neuron: Neurons, Synapses & Activation Functions
- Understanding Activation Functions in Deep Learning
- How Do Neural Networks Work? Step-by-Step
- How Do Neural Networks Learn?
- Gradient Descent vs Brute Force Optimization
- Stochastic vs Batch Gradient Descent
- Training Neural Networks Step-by-Step
- Bank Customer Churn Prediction with TensorFlow
- Step 1: ANN in Python — Predicting Customer Churn
- Step 2: Preprocessing Data for the Churn Model
- Step 3: Designing the ANN — Sequential Model & Dense Layers
- Step 4: Compile & Fit for Churn Prediction
- Step 5: From Model to Confusion Matrix
- Step 1: Preprocessing Data for ANNs in R
- Step 2: Installing and Initializing H2O in R
- Step 3: H2O Neural Network Layer Config
- Step 4: Making Predictions & Evaluating Accuracy with H2O
- Deep Learning Additional Content
Module 37: Convolutional Neural Networks (CNN) 18 lessons
- Understanding CNN Layers: Convolution, ReLU, Pooling & Flattening
- Introduction to CNNs for Computer Vision
- Step 1: Convolution — Feature Detection & Feature Maps
- Step 1b: Applying ReLU to Convolutional Layers
- Step 2: Max Pooling — Spatial Invariance
- Step 3: Understanding Flattening
- Step 4: Fully Connected Layers in CNNs
- How CNNs Process Images
- Understanding Softmax and Cross-Entropy in CNNs
- Make Sure Your Dataset is Ready
- Step 1: Intro to CNNs for Image Classification
- Step 2: Keras ImageDataGenerator — Prevent Overfitting
- Step 3: TensorFlow CNN — Convolution to Output Layer
- Step 4: CNN Training — Epochs, Loss Function & Metrics
- Step 5: Making Single Predictions with a CNN
- Hands-on CNN Training in Jupyter Notebook
- Deep Learning Additional Content #2
- CNN Quiz
Module 38: Part 9 — Dimensionality Reduction 1 lesson
- Welcome to Part 9 — Dimensionality Reduction
Module 39: Principal Component Analysis (PCA) 7 lessons
- PCA Intuition: Reducing Dimensions in Unsupervised Learning
- Step 1: PCA in Python — Reducing the Wine Dataset
- Step 2: PCA in Action — Predicting Customer Segments
- Step 1: Understanding PCA for Feature Extraction (R)
- Step 2: Using preProcess in R for PCA
- Step 3: Implementing PCA and SVM for Segmentation
- PCA Quiz
Module 40: Linear Discriminant Analysis (LDA) 4 lessons
- LDA Intuition: Maximizing Class Separation
- LDA Step-by-Step Python Implementation
- Applying LDA for Feature Extraction
- LDA Quiz
Module 41: Kernel PCA 2 lessons
- Kernel PCA in Python: Improving Classification Accuracy
- Implementing Kernel PCA for Non-Linear Data
Module 42: Part 10 — Model Selection & Boosting 1 lesson
- Welcome to Part 10 — Model Selection & Boosting
Module 43: Model Selection 6 lessons
- K-Fold Cross-Validation Techniques Explained
- Mastering the Bias-Variance Tradeoff
- K-Fold Cross-Validation in Python
- Optimizing SVM Models with GridSearchCV (Python)
- K-Fold Cross-Validation in R
- Optimizing SVM Models with Grid Search (R)
Module 44: XGBoost 3 lessons
- XGBoost in Python for Cancer Prediction with High Accuracy
- Model Selection and Boosting — Additional Content
- XGBoost Tutorial: Gradient Boosting for Classification
Module 45: Annex — Logistic Regression 1 lesson
- Logistic Regression Intuition
Module 46: Congratulations! 1 lesson
- Huge Congrats for Completing the Challenge!