Course Name : MACHINE LEARNING
Course Code : 20AM01
Course Instructor : K.Rajasekhar
Semester : VI
Regulation : R23
Unit: 3
1
UNIT-3: SYLLABUS
Models Based on Decision Trees:
Decision Trees for Classification, Impurity Measures, Properties, Regression Based on Decision Trees, Bias–Variance Trade-off, Random Forests for Classification and Regression. The Bayes Classifier: Introduction to the Bayes Classifier, Bayes’ Rule and Inference, The Bayes Classifier and its Optimality, Multi-Class Classification, Class Conditional Independence and Naive Bayes Classifier (NBC) .
�
Decision Trees for Classification (Cont’d..)
A Decision Tree Terminologies
A decision tree consists of three types of nodes:
Building a Decision Tree
Building a Decision Tree
Algorithm for Decision Tree
A Decision Tree – Example –Car Driving
Attribute Selection Measures (ASM)
There are two popular techniques for ASM, which are:
Impurity Measures: (cont’d)
Why Impurity Measures Are Needed
Major Impurity Measures
1.Entropy
Strengths of Decision Trees
Weakness of Decision Trees
Applications of Decision Trees
Properties of Decision Trees Classifiers
A good impurity measure satisfies the following properties:.
1. Splitting Rule
Is Age ≤ 30? → Yes / No
The rule divides data into child nodes
II. Criterion for Splitting
The feature for splitting is chosen using a purity measure
Properties of Decision Trees Classifiers
3. Binary or Non-Binary Splits
4.Termination Condition (Stopping Criteria)
Properties of Decision Trees Classifiers
5. Class Labels
6. Classification
7.Transparency (Interpretability)
Properties of Decision Trees Classifiers
8. Handling Mixed Data Types
Can handle:
9 Eliminating Irrelevant Features
10 Pruning Decision Tree
Types:
Regression Based on Decision Trees
Regression based on decision trees is a supervised learning method used to predict continuous-valued outputs.�Unlike classification trees, regression trees output numeric values at leaf nodes. It splits data into smaller subsets using decision rules and fits a model to each subset.
Working Principle
Algorithm (Steps)
1. Splitting the Data: The dataset is recursively split into subsets using a decision criterion (e.g., minimizing variance).
2. Choosing the Best Split: The best split minimizes the Mean Squared Error (MSE) or Mean Absolute Error (MAE).
3. Stopping Criteria: The process continues until a stopping condition is met (e.g., max depth reached or number of samples in a node is below a threshold).
4. Prediction: At each terminal (leaf) node, the model predicts the mean value of the observations in that node.
Regression Based on Decision Trees
Regression Based on Decision Trees
Advantages:
Disadvantages
Bias–Variance Trade-of (Cont’d)
Example:�Using a linear regression model for highly curved (non-linear) data.
Characteristics:
Bias–Variance Trade-of (Cont’d)
Variance
Example:�A very deep decision tree that perfectly fits training data but performs poorly on new data.
Characteristics:
Bias–Variance Trade-of (Cont’d)
Understanding Bias and Variance with an Example
How to Reduce Bias and Variance
To reduce Bias:
To reduce Variance:
Simple Real-World Analogy 🎯
Ensemble Learning in Machine Learning
Ensemble learning is a supervised learning technique used in machine learning to improve overall performance by combining the predictions from multiple models.
Random Forest for classification
Random Forest for classification
Steps for Random forest algorithm :
Random Forest Strengths
Strengths:
Applications of Random Forest
Random Forest for Regression
How Random Forest Regression Works
The Bayes Classifier
The Bayes Classifier
The Bayes Classifier
The Bayes Classifier
The Bayes Classifier
The Bayes Classifier
The Bayes Classifier
The Bayes Classifier
Why is it Optimal?
Bayes Error Rate
Multi-class classification
Examples (Real-World)
Multi-class classification
Class Conditional Independence?
The Naïve Bayes Classifier
The Naïve Bayes Classifier
The Bayes Classifier
The Naïve Bayes Classifier
The Naïve Bayes Classifier
The Naïve Bayes Classifier
The Naïve Bayes Classifier
The Naïve Bayes Classifier