Skip to content

jvlad/machine_learning_exercises

Repository files navigation

Exercises location

./src

Notes

  1. Feature scaling should be applied after the train/test data split to prevent data leakage from a validation set to a train set.

  2. No need to check for [linear regression assumptions] prior to trying out linear regression model. If some of the data doesn't have linear correlation, an LR model will just perform poorly compared to other models that we should try anyways.

  3. When presented with a task and a dataset, how do I choose which type of regression start applying?

    – Models of different types need to be tested and compared in terms of accuracy

Course Curriculum

Section 1: Welcome to the course! Here we will help you get started

                in the best conditions.
  1. Welcome Challenge!

  2. Machine Learning Demo - Get Excited!

  3. Get all the Datasets, Codes and Slides here

  4. How to use the ML A-Z folder Google Colab

  5. Installing R and R Studio (Mac, Linux Windows)

  6. BONUS: Use ChatGPT to Boost your ML Skills

Section 2: Part 1: Data Preprocessing

  1. Welcome to Part 1 - Data Preprocessing

  2. The Machine Learning process

  3. Splitting the data into a Training and Test set

  4. Feature Scaling

Section 3: Data Preprocessing in Python

  1. Getting Started - Step 1

  2. Getting Started - Step 2

  3. Importing the Libraries

  4. Importing the Dataset - Step 1

  5. Importing the Dataset - Step 2

  6. Importing the Dataset - Step 3

  7. For Python learners, summary of Object-oriented programming: classes objects Coding Exercise 1: Coding Exercise 1: Importing and Preprocessing a Dataset for Machine Learning

  8. Taking care of Missing Data - Step 1

  9. Taking care of Missing Data - Step 2

Coding Exercise 2: Coding Exercise 2: Handling Missing Data in a Dataset for Machine Learning 20. Encoding Categorical Data - Step 1

  1. Encoding Categorical Data - Step 2

  2. Encoding Categorical Data - Step 3

Coding Exercise 3: Coding Exercise 3: Encoding Categorical Data for Machine Learning 23. Splitting the dataset into the Training set and Test set - Step 1 24. Splitting the dataset into the Training set and Test set - Step 2 25. Splitting the dataset into the Training set and Test set - Step 3 Coding Exercise 4: Coding Exercise 4: Dataset Splitting and Feature Scaling 26. Feature Scaling - Step 1

  1. Feature Scaling - Step 2

  2. Feature Scaling - Step 3

  3. Feature Scaling - Step 4

Coding Exercise 5: Coding exercise 5: Feature scaling for Machine Learning

Section 4: Data Preprocessing in R

  1. Getting Started

  2. Dataset Description

  3. Importing the Dataset

  4. Taking care of Missing Data

  5. Encoding Categorical Data

  6. Splitting the dataset into the Training set and Test set - Step 1

  7. Splitting the dataset into the Training set and Test set - Step 2

  8. Feature Scaling - Step 1

  9. Feature Scaling - Step 2

  10. Data Preprocessing Template

Quiz 1: Data Preprocessing Quiz

Section 5: Part 2: Regression

  1. Welcome to Part 2 - Regression

Section 6: Simple Linear Regression

  1. Simple Linear Regression Intuition

  2. Ordinary Least Squares

  3. Simple Linear Regression in Python - Step 1a

  4. Simple Linear Regression in Python - Step 1b

  5. Simple Linear Regression in Python - Step 2a

  6. Simple Linear Regression in Python - Step 2b

  7. Simple Linear Regression in Python - Step 3

  8. Simple Linear Regression in Python - Step 4a

  9. Simple Linear Regression in Python - Step 4b

  10. Simple Linear Regression in Python - Additional Lecture

  11. Simple Linear Regression in R - Step 1

  12. Simple Linear Regression in R - Step 2

  13. Simple Linear Regression in R - Step 3

  14. Simple Linear Regression in R - Step 4a

  15. Simple Linear Regression in R - Step 4b

  16. Simple Linear Regression in R - Step 4c

Quiz 2: Simple Linear Regression Quiz

Section 7: Multiple Linear Regression

  1. Dataset + Business Problem Description

  2. Multiple Linear Regression Intuition

  3. Assumptions of Linear Regression

  4. Multiple Linear Regression Intuition - Step 3

  5. Multiple Linear Regression Intuition - Step 4

  6. Understanding the P-Value

  7. Multiple Linear Regression Intuition - Step 5

  8. Multiple Linear Regression in Python - Step 1a

  9. Multiple Linear Regression in Python - Step 1b

  10. Multiple Linear Regression in Python - Step 2a

  11. Multiple Linear Regression in Python - Step 2b

  12. Multiple Linear Regression in Python - Step 3a

  13. Multiple Linear Regression in Python - Step 3b

  14. Multiple Linear Regression in Python - Step 4a

  15. Multiple Linear Regression in Python - Step 4b

  16. Multiple Linear Regression in Python - Backward Elimination

  17. Multiple Linear Regression in Python - EXTRA CONTENT

  18. Multiple Linear Regression in R - Step 1a

  19. Multiple Linear Regression in R - Step 1b

  20. Multiple Linear Regression in R - Step 2a

  21. Multiple Linear Regression in R - Step 2b

  22. Multiple Linear Regression in R - Step 3

  23. Multiple Linear Regression in R - Backward Elimination - HOMEWORK !

  24. Multiple Linear Regression in R - Backward Elimination - Homework Solution

  25. Multiple Linear Regression in R - Automatic Backward Elimination Quiz 3: Multiple Linear Regression Quiz

Section 8: Polynomial Regression

  1. Polynomial Regression Intuition

  2. Polynomial Regression in Python - Step 1a

  3. Polynomial Regression in Python - Step 1b

  4. Polynomial Regression in Python - Step 2a

  5. Polynomial Regression in Python - Step 2b

  6. Polynomial Regression in Python - Step 3a

  7. Polynomial Regression in Python - Step 3b

  8. Polynomial Regression in Python - Step 4a

  9. Polynomial Regression in Python - Step 4b

  10. Polynomial Regression in R - Step 1a

  11. Polynomial Regression in R - Step 1b

  12. Polynomial Regression in R - Step 2a

  13. Polynomial Regression in R - Step 2b

  14. Polynomial Regression in R - Step 3a

  15. Polynomial Regression in R - Step 3b

  16. Polynomial Regression in R - Step 3c

  17. Polynomial Regression in R - Step 4a

  18. Polynomial Regression in R - Step 4b

  19. R Regression Template - Step 1

  20. R Regression Template - Step 2

Quiz 4: Polynomial Regression Quiz

Section 9: Support Vector Regression (SVR)

  1. SVR Intuition (Updated!)

  2. Heads-up on non-linear SVR

  3. SVR in Python - Step 1a

  4. SVR in Python - Step 1b

  5. SVR in Python - Step 2a

  6. SVR in Python - Step 2b

  7. SVR in Python - Step 2c

  8. SVR in Python - Step 3

  9. SVR in Python - Step 4

  10. SVR in Python - Step 5a

  11. SVR in Python - Step 5b

  12. SVR in R - Step 1

  13. SVR in R - Step 2

Quiz 5: SVR Quiz

Section 10: Decision Tree Regression

  1. Decision Tree Regression Intuition

  2. Decision Tree Regression in Python - Step 1a

  3. Decision Tree Regression in Python - Step 1b

  4. Decision Tree Regression in Python - Step 2

  5. Decision Tree Regression in Python - Step 3

  6. Decision Tree Regression in Python - Step 4

  7. Decision Tree Regression in R - Step 1

  8. Decision Tree Regression in R - Step 2

  9. Decision Tree Regression in R - Step 3

  10. Decision Tree Regression in R - Step 4

Quiz 6: Decision Tree Regression Quiz

Section 11: Random Forest Regression

  1. Random Forest Regression Intuition

  2. Random Forest Regression in Python - Step 1

  3. Random Forest Regression in Python - Step 2

  4. Random Forest Regression in R - Step 1

  5. Random Forest Regression in R - Step 2

  6. Random Forest Regression in R - Step 3

Quiz 7: Random Forest Regression Quiz

Section 12: Evaluating Regression Models

                Performance
  1. R-Squared Intuition

  2. Adjusted R-Squared Intuition

Quiz 8: Evaluating Regression Models Performance Quiz

Section 13: Regression Model Selection in

                Python
  1. Make sure you have this Model Selection folder ready
  2. Preparation of the Regression Code Templates - Step 1
  3. Preparation of the Regression Code Templates - Step 2
  4. Preparation of the Regression Code Templates - Step 3
  5. Preparation of the Regression Code Templates - Step 4
  6. THE ULTIMATE DEMO OF THE POWERFUL REGRESSION CODE TEMPLATES IN ACTION! - STEP 1
  7. THE ULTIMATE DEMO OF THE POWERFUL REGRESSION CODE TEMPLATES IN ACTION! - STEP 2
  8. Conclusion of Part 2 - Regression

Section 14: Regression Model Selection in R

  1. Evaluating Regression Models Performance - Homework's Final Part
  2. Interpreting Linear Regression Coefficients
  3. Conclusion of Part 2 - Regression

Section 15: Part 3: Classification

  1. Welcome to Part 3 - Classification

  2. What is Classification?

Section 16: Logistic Regression

  1. Logistic Regression Intuition

  2. Maximum Likelihood

  3. Logistic Regression in Python - Step 1a

  4. Logistic Regression in Python - Step 1b

  5. Logistic Regression in Python - Step 2a

  6. Logistic Regression in Python - Step 2b

  7. Logistic Regression in Python - Step 3a

  8. Logistic Regression in Python - Step 3b

  9. Logistic Regression in Python - Step 4a

  10. Logistic Regression in Python - Step 4b

  11. Logistic Regression in Python - Step 5

  12. Logistic Regression in Python - Step 6a

  13. Logistic Regression in Python - Step 6b

  14. Logistic Regression in Python - Step 7a

  15. Logistic Regression in Python - Step 7b

  16. Logistic Regression in Python - Step 7c

  17. Logistic Regression in Python - Step 7 (Colour-blind friendly image)

  18. Logistic Regression in R - Step 1

  19. Logistic Regression in R - Step 2

  20. Logistic Regression in R - Step 3

  21. Logistic Regression in R - Step 4

  22. Warning - Update

  23. Logistic Regression in R - Step 5a

  24. Logistic Regression in R - Step 5b

  25. Logistic Regression in R - Step 5c

  26. Logistic Regression in R - Step 5 (Colour-blind friendly image)

  27. R Classification Template

  28. Machine Learning Regression and Classification BONUS Quiz 9: Logistic Regression Quiz

  29. EXTRA CONTENT: Logistic Regression Practical Case Study

Section 17: K-Nearest Neighbors (K-NN)

  1. K-Nearest Neighbor Intuition

  2. K-NN in Python - Step 1

  3. K-NN in Python - Step 2

  4. K-NN in Python - Step 3

  5. K-NN in R - Step 1

  6. K-NN in R - Step 2

  7. K-NN in R - Step 3

Quiz 10: K-Nearest Neighbor Quiz

Section 18: Support Vector Machine (SVM)

  1. SVM Intuition

  2. SVM in Python - Step 1

  3. SVM in Python - Step 2

  4. SVM in Python - Step 3

  5. SVM in R - Step 1

  6. SVM in R - Step 2

Quiz 11: SVM Quiz

Section 19: Kernel SVM

  1. Kernel SVM Intuition

  2. Mapping to a higher dimension

  3. The Kernel Trick

  4. Types of Kernel Functions

  5. Non-Linear Kernel SVR (Advanced)

  6. Kernel SVM in Python - Step 1

  7. Kernel SVM in Python - Step 2

  8. Kernel SVM in R - Step 1

  9. Kernel SVM in R - Step 2

  10. Kernel SVM in R - Step 3

Quiz 12: Kernel SVM Quiz

Section 20: Naive Bayes

  1. Bayes Theorem

  2. Naive Bayes Intuition

  3. Naive Bayes Intuition (Challenge Reveal)

  4. Naive Bayes Intuition (Extras)

  5. Naive Bayes in Python - Step 1

  6. Naive Bayes in Python - Step 2

  7. Naive Bayes in Python - Step 3

  8. Naive Bayes in R - Step 1

  9. Naive Bayes in R - Step 2

  10. Naive Bayes in R - Step 3

Quiz 13: Naive Bayes Quiz

Section 21: Decision Tree Classification

  1. Decision Tree Classification Intuition

  2. Decision Tree Classification in Python - Step 1

  3. Decision Tree Classification in Python - Step 2

  4. Decision Tree Classification in R - Step 1

  5. Decision Tree Classification in R - Step 2

  6. Decision Tree Classification in R - Step 3

Quiz 14: Decision Tree Classification Quiz

Section 22: Random Forest Classification

  1. Random Forest Classification Intuition

  2. Random Forest Classification in Python - Step 1

  3. Random Forest Classification in Python - Step 2

  4. Random Forest Classification in R - Step 1

  5. Random Forest Classification in R - Step 2

  6. Random Forest Classification in R - Step 3

Quiz 15: Random Forest Classification Quiz

Section 23: Classification Model Selection in

                Python
  1. Make sure you have this Model Selection folder ready

  2. Confusion Matrix Accuracy Ratios

  3. ULTIMATE DEMO OF THE POWERFUL CLASSIFICATION CODE TEMPLATES IN ACTION - STEP 1

  4. ULTIMATE DEMO OF THE POWERFUL CLASSIFICATION CODE TEMPLATES IN ACTION - STEP 2

  5. ULTIMATE DEMO OF THE POWERFUL CLASSIFICATION CODE TEMPLATES IN ACTION - STEP 3

  6. ULTIMATE DEMO OF THE POWERFUL CLASSIFICATION CODE TEMPLATES IN ACTION - STEP 4

Section 24: Evaluating Classification Models

                Performance
  1. False Positives False Negatives

  2. Accuracy Paradox

  3. CAP Curve

  4. CAP Curve Analysis

  5. Conclusion of Part 3 - Classification

Quiz 16: Evaluating Classiification Model Performance Quiz

Section 25: Part 4: Clustering

  1. Welcome to Part 4 - Clustering

Section 26: K-Means Clustering

  1. What is Clustering? (Supervised vs Unsupervised Learning)

  2. K-Means Clustering Intuition

  3. The Elbow Method

  4. K-Means++

  5. K-Means Clustering in Python - Step 1a

  6. K-Means Clustering in Python - Step 1b

  7. K-Means Clustering in Python - Step 2a

  8. K-Means Clustering in Python - Step 2b

  9. K-Means Clustering in Python - Step 3a

  10. K-Means Clustering in Python - Step 3b

  11. K-Means Clustering in Python - Step 3c

  12. K-Means Clustering in Python - Step 4

  13. K-Means Clustering in Python - Step 5a

  14. K-Means Clustering in Python - Step 5b

  15. K-Means Clustering in Python - Step 5c

  16. K-Means Clustering in R - Step 1

  17. K-Means Clustering in R - Step 2

Quiz 17: K-Means Clustering Quiz

Section 27: Hierarchical Clustering

  1. Hierarchical Clustering Intuition

  2. Hierarchical Clustering How Dendrograms Work

  3. Hierarchical Clustering Using Dendrograms

  4. Hierarchical Clustering in Python - Step 1

  5. Hierarchical Clustering in Python - Step 2a

  6. Hierarchical Clustering in Python - Step 2b

  7. Hierarchical Clustering in Python - Step 2c

  8. Hierarchical Clustering in Python - Step 3a

  9. Hierarchical Clustering in Python - Step 3b

  10. Hierarchical Clustering in R - Step 1

  11. Hierarchical Clustering in R - Step 2

  12. Hierarchical Clustering in R - Step 3

  13. Hierarchical Clustering in R - Step 4

  14. Hierarchical Clustering in R - Step 5

Quiz 18: Hierarchical Clustering Quiz

  1. Conclusion of Part 4 - Clustering

Section 28: Part 5: Association Rule Learning

  1. Welcome to Part 5 - Association Rule Learning

Section 29: Apriori

  1. Apriori Intuition

  2. Apriori in Python - Step 1

  3. Apriori in Python - Step 2

  4. Apriori in Python - Step 3

  5. Apriori in Python - Step 4

  6. Apriori in R - Step 1

  7. Apriori in R - Step 2

  8. Apriori in R - Step 3

Quiz 19: Apriori Quiz

Section 30: Eclat

  1. Eclat Intuition

  2. Eclat in Python

  3. Eclat in R

Quiz 20: Eclat Quiz

Section 31: Part 6: Reinforcement Learning

  1. Welcome to Part 6 - Reinforcement Learning

Section 32: Upper Confidence Bound (UCB)

  1. The Multi-Armed Bandit Problem

  2. Upper Confidence Bound (UCB) Intuition

  3. Upper Confidence Bound in Python - Step 1

  4. Upper Confidence Bound in Python - Step 2

  5. Upper Confidence Bound in Python - Step 3

  6. Upper Confidence Bound in Python - Step 4

  7. Upper Confidence Bound in Python - Step 5

  8. Upper Confidence Bound in Python - Step 6

  9. Upper Confidence Bound in Python - Step 7

  10. Upper Confidence Bound in R - Step 1

  11. Upper Confidence Bound in R - Step 2

  12. Upper Confidence Bound in R - Step 3

  13. Upper Confidence Bound in R - Step 4

Quiz 21: Upper Confidence Bound Quiz

Section 33: Thompson Sampling

  1. Thompson Sampling Intuition

  2. Algorithm Comparison: UCB vs Thompson Sampling

  3. Thompson Sampling in Python - Step 1

  4. Thompson Sampling in Python - Step 2

  5. Thompson Sampling in Python - Step 3

  6. Thompson Sampling in Python - Step 4

  7. Additional Resource for this Section

  8. Thompson Sampling in R - Step 1

  9. Thompson Sampling in R - Step 2

Quiz 22: Thompson Sampling Quiz

Section 34: Part 7: Natural Language Processing

  1. Welcome to Part 7 - Natural Language Processing

  2. NLP Intuition

  3. Types of Natural Language Processing

  4. Classical vs Deep Learning Models

  5. Bag-Of-Words Model

  6. Natural Language Processing in Python - Step 1

  7. Natural Language Processing in Python - Step 2

  8. Natural Language Processing in Python - Step 3

  9. Natural Language Processing in Python - Step 4

  10. Natural Language Processing in Python - Step 5

  11. Natural Language Processing in Python - Step 6

  12. Natural Language Processing in Python - BONUS

  13. Homework Challenge

  14. Natural Language Processing in R - Step 1

  15. Warning - Update

  16. Natural Language Processing in R - Step 2

  17. Natural Language Processing in R - Step 3

  18. Natural Language Processing in R - Step 4

  19. Natural Language Processing in R - Step 5

  20. Natural Language Processing in R - Step 6

  21. Natural Language Processing in R - Step 7

  22. Natural Language Processing in R - Step 8

  23. Natural Language Processing in R - Step 9

  24. Natural Language Processing in R - Step 10

  25. Homework Challenge

Quiz 23: Natural Language Processing Quiz

Section 35: Part 8: Deep Learning

  1. Welcome to Part 8 - Deep Learning

  2. What is Deep Learning?

Quiz 24: Deep Learning Quiz

Section 36: Artificial Neural Networks

  1. Plan of attack

  2. The Neuron

  3. The Activation Function

  4. How do Neural Networks work?

  5. How do Neural Networks learn?

  6. Gradient Descent

  7. Stochastic Gradient Descent

  8. Backpropagation

  9. Business Problem Description

  10. ANN in Python - Step 1

  11. ANN in Python - Step 2

  12. ANN in Python - Step 3

  13. ANN in Python - Step 4

  14. ANN in Python - Step 5

  15. ANN in R - Step 1

  16. ANN in R - Step 2

  17. ANN in R - Step 3

  18. ANN in R - Step 4 (Last step)

  19. Deep Learning Additional Content

  20. EXTRA CONTENT: ANN Case Study

Quiz 25: ANN QUIZ

Section 37: Convolutional Neural Networks

  1. Plan of attack

  2. What are convolutional neural networks?

  3. Step 1 - Convolution Operation

  4. Step 1(b) - ReLU Layer

  5. Step 2 - Pooling

  6. Step 3 - Flattening

  7. Step 4 - Full Connection

  8. Summary

  9. Softmax Cross-Entropy

  10. CNN in Python - Step 1

  11. CNN in Python - Step 2

  12. CNN in Python - Step 3

  13. CNN in Python - Step 4

  14. CNN in Python - Step 5

  15. CNN in Python - FINAL DEMO!

  16. Deep Learning Additional Content #2

Quiz 26: CNN Quiz

Section 38: Part 9: Dimensionality Reduction

  1. Welcome to Part 9 - Dimensionality Reduction

Section 39: Principal Component Analysis (PCA)

  1. Principal Component Analysis (PCA) Intuition

  2. PCA in Python - Step 1

  3. PCA in Python - Step 2

  4. PCA in R - Step 1

  5. PCA in R - Step 2

  6. PCA in R - Step 3

Quiz 27: PCA Quiz

Section 40: Linear Discriminant Analysis (LDA)

  1. Linear Discriminant Analysis (LDA) Intuition

  2. LDA in Python

  3. LDA in R

Quiz 28: LDA Quiz

Section 41: Kernel PCA

  1. Kernel PCA in Python

  2. Kernel PCA in R

Section 42: Part 10: Model Selection

                Boosting 
  1. Welcome to Part 10 - Model Selection Boosting

Section 43: Model Selection

  1. k-Fold Cross Validation in Python

  2. Grid Search in Python

  3. k-Fold Cross Validation in R

  4. Grid Search in R

Section 44: XGBoost

  1. XGBoost in Python

  2. Model Selection and Boosting Additional Content

  3. XGBoost in R

Section 45: Annex: Logistic Regression (Long

                Explanation)
  1. Logistic Regression Intuition

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages