SlideShare a Scribd company logo
Interaction Lab. Kumoh National Institute of Technology
Hands-On Machine Learning
with Scikit-Learn, Keras & TensorFlow
Chapter 6. Decision Tree
Chapter 7. Ensemble and random forest
Jeong jaeyeop
■Decision tree
■Ensemble and random forest
Agenda
Interaction Lab., Kumoh National Institue of Technology 2
Decision tree
Ensemble and random forest
Data Engineering Lab., Kumoh National Institue of Technology 3
■Decision tree
 Machine learning algorithms
• Classification
• Regression
 Components of a random forest
Intro
Interaction Lab., Kumoh National Institue of Technology 4
■Decision tree training
 Use iris datasets
• Species : setosa, versicolor, virginica
• Property : sepal length, sepal width, petal length, petal width
Decision tree training and visualization(1/2)
Interaction Lab., Kumoh National Institue of Technology 5
■Decision tree visualization
 Use export_graphviz in sklearn
Decision tree training and visualization(2/2)
Interaction Lab., Kumoh National Institue of Technology 6
■How to tree make prediction?
 Start root node(depth = 0)
 Samples are value
 Value is number of samples
 Gini is impurity
• If gini is 0, that node is pure
 Class is predicted value
Prediction(1/2)
Interaction Lab., Kumoh National Institue of Technology 7
■Gini calculation method
 1 −
0
54
2
−
49
54
2
−
5
54
2
≈ 0.168
 𝐺𝑖 = 1 − 𝑘=1
𝑛
𝑃𝑖,𝑘
2
Prediction(2/2)
Interaction Lab., Kumoh National Institue of Technology 8
■CART algorithm
 Decision tree training in sklearn
• Divide subset using property 𝑘 and threshold 𝑡𝑘
 Cost function
• 𝐽 𝑘, 𝑡𝑘 =
𝑚𝑙𝑒𝑓𝑡
𝑚
𝐺𝑙𝑒𝑓𝑡 +
𝑚𝑟𝑖𝑔ℎ𝑡
𝑚
𝐺𝑟𝑖𝑔ℎ𝑡
•
𝐺𝑙𝑒𝑓𝑡/𝑟𝑖𝑔ℎ𝑡 𝑖𝑠 𝑙𝑒𝑓𝑡/𝑟𝑖𝑔ℎ𝑡 𝑖𝑚𝑝𝑢𝑟𝑖𝑡𝑦 𝑜𝑓 𝑠𝑢𝑏𝑠𝑒𝑡𝑠
𝑚𝑙𝑒𝑓𝑡/𝑟𝑖𝑔ℎ𝑡 𝑖𝑠 𝑙𝑒𝑓𝑡/𝑟𝑖𝑔ℎ𝑡 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑠𝑎𝑚𝑝𝑙𝑒𝑠
 Repeat until limited max depth, cannot divide
CART training algorithm
Interaction Lab., Kumoh National Institue of Technology 9
■Determination of impurity
 Default setup is gini
 Entropy
• Determination of impurity in machine learning
• If it is stable and orderly, the entropy is 0
• If a set contains only one class of samples, the entropy is 0
• 𝐻𝑖 = − 𝑘=1
𝑃𝑖,𝑘≠0
𝑛
𝑃𝑖,𝑘 𝑙𝑜𝑔2(𝑃𝑖,𝑘)
• −
49
54
𝑙𝑜𝑔2(
49
54
) −
5
54
𝑙𝑜𝑔2(
5
54
) ≈ 0.445
 Entropy makes balanced tree
Gini or entropy
Interaction Lab., Kumoh National Institue of Technology 10
■Nonparametric model
 Model structure is free
 Limit the degree of freedom of the decision tree to avoid overfitting
 Regulatory parameters in keras
• min_samples_split
• min_samples_leaf
• min_weight_fraction_leaf
• max_leaf_nodes
• max_features
Regulatory parameters
Interaction Lab., Kumoh National Institue of Technology 11
■Decision tree regressor in sklearn
 DecisionTreeRegressor
Regression(1/2)
Interaction Lab., Kumoh National Institue of Technology 12
■CART algorithm
 Not gini, use mse for divide subsets
 Cost function
• 𝐽 𝑘, 𝑡𝑘 =
𝑚𝑙𝑒𝑓𝑡
𝑚
𝑀𝑆𝐸𝑙𝑒𝑓𝑡 +
𝑚𝑟𝑖𝑔ℎ𝑡
𝑚
𝑀𝑆𝐸𝑟𝑖𝑔ℎ𝑡
•
𝑀𝑆𝐸𝑛𝑜𝑑𝑒 = 𝑖∈𝑛𝑜𝑑𝑒(𝑦𝑛𝑜𝑑𝑒 − 𝑦(𝑖)
)2
𝑦𝑛𝑜𝑑𝑒 =
1
𝑚𝑛𝑜𝑑𝑒
𝑖∈𝑛𝑜𝑑𝑒 𝑦(𝑖)
Regression(2/2)
Interaction Lab., Kumoh National Institue of Technology 13
■Sensitive to rotation of training sets
Instability
Interaction Lab., Kumoh National Institue of Technology 14
Ensemble and random forest
Data Engineering Lab., Kumoh National Institue of Technology 15
■Ensemble
 Collect predictions from estimators and get better predictions
 Different algorithm same data
 Same data different algorithm
■Random forest
 Ensemble of decision trees
■Ensemble method
 Bagging
 Boosting
 Stacking
Intro
■Training several classifiers
Voting-based classifiers(1/3)
Interaction Lab., Kumoh National Institue of Technology 17
■Prediction several classifiers
 Weak learner
• Low performance, like random
 Strong learner
• High performance
Voting-based classifiers(2/3)
Interaction Lab., Kumoh National Institue of Technology 18
■Voting-based classifiers in sklearn
 Hard voting
• Decision by majority
• voting = ‘hard’
 Soft voting
• Decision by probability
• voting = ‘soft’
Voting-based classifiers(3/3)
Interaction Lab., Kumoh National Institue of Technology 19
■Same algorithm different data
 Bagging(bootstrap aggregating)
• Sampling by allowing redundancy in the training set
 Pasting
• Sampling without allowing redundancy in the training set
Bagging and pasting(1/2)
Interaction Lab., Kumoh National Institue of Technology 20
■Bagging and pasting in sklearn
Bagging and pasting(2/2)
Interaction Lab., Kumoh National Institue of Technology 21
■OOB
 Out Of Bag
• Unselected samples : 37%
• Use validation sets
OOB evaluation
Interaction Lab., Kumoh National Institue of Technology 22
■Ensemble of decision tree
 Generally, bagging
 max_leaf_node = 16, 500 trees
 Split tree node
• Find the best property among randomly selected property candidates
Random forest(1/3)
Interaction Lab., Kumoh National Institue of Technology 23
■Extra-trees
 Extremely random trees
 Find best property among randomly selected property candidates
 Fast than general random forest
 ExtraTrees in sklearn
• ExtraTreesClassifier()
• ExTreesRegressor()
Random forest(2/3)
Interaction Lab., Kumoh National Institue of Technology 24
■Property importance
 Ease of measuring the relative importance of property
 feature_importances_
 Property of the petals are more important than property of sepal
Random forest(3/3)
Interaction Lab., Kumoh National Institue of Technology 25
■Concept
 Connecting multiple weak learners to create a strong learner
 Learn the estimators by complementing the preceding model
■Popular kind
 AdaBoost(adaptive boosting)
 Gradient boosting
Boosting(1/6)
Interaction Lab., Kumoh National Institue of Technology 26
■AdaBoost
 Increasing the weight of training samples that previous models
were underfitting
 Making predictions in the same way as bagging and pasting
Boosting(2/6)
Interaction Lab., Kumoh National Institue of Technology 27
■ AdaBoost algorithm
 Weight(𝑤(𝑖)
) : initialize
1
𝑚
 Learn the first estimator
• Weighted error rate 𝑟1, calculated for this training set
 Error rate weighted by 𝑗𝑡ℎ estimator
• 𝑟
𝑗 =
𝑖=1
𝑦
𝑗
(𝑖)
≠𝑦(𝑖)
𝑚
𝑊(𝑖)
𝑖=1
𝑚 𝑤(𝑖)
 Estimator weight
• 𝛼𝑗 = (𝑒𝑡𝑎)𝑙𝑜𝑔
1−𝑟𝑗
𝑟𝑗
 Weight update rule
• 𝑊(𝑖)
←
𝑊(𝑖)
𝑦𝑗
(𝑖)
= 𝑦(𝑖)
𝑊(𝑖)
exp(𝛼𝑗) 𝑦𝑗
(𝑖)
≠ 𝑦(𝑖)
Boosting(3/6)
Interaction Lab., Kumoh National Institue of Technology 28
■Gradient boosting
 Learn with residual error from previous model
 Learn from quadratic curve data
Boosting(4/6)
Interaction Lab., Kumoh National Institue of Technology 29
■Gradient boosting
Boosting(5/6)
Interaction Lab., Kumoh National Institue of Technology 30
■Gradient boosting
 Learning rate
• Low requires a lot of trees
 Typical library
• XGBoost
Boosting(6/6)
Interaction Lab., Kumoh National Institue of Technology 31
■Concept
 Train a model that aggregates predictions
 Blender or meta learner
Stacking(1/3)
Interaction Lab., Kumoh National Institue of Technology 32
■Training
 Divide the data into two subsets
 Train the first layer with the first data
 Predict the second data with the first layer trained
Stacking(2/3)
Interaction Lab., Kumoh National Institue of Technology 33
■Multi layer stacking ensemble prediction
Stacking(3/3)
Interaction Lab., Kumoh National Institue of Technology 34

More Related Content

PDF
Ways to evaluate a machine learning model’s performance
PPTX
Ensemble methods in machine learning
PDF
Deep Feed Forward Neural Networks and Regularization
PPTX
Unsupervised learning
PPTX
04 Multi-layer Feedforward Networks
PDF
Cross-validation Tutorial: What, how and which?
PPTX
Genetic programming
PPT
Cure, Clustering Algorithm
Ways to evaluate a machine learning model’s performance
Ensemble methods in machine learning
Deep Feed Forward Neural Networks and Regularization
Unsupervised learning
04 Multi-layer Feedforward Networks
Cross-validation Tutorial: What, how and which?
Genetic programming
Cure, Clustering Algorithm

What's hot (20)

PDF
PPTX
Ensemble methods
PPTX
Introduction to Machine Learning
PPTX
Learning from imbalanced data
PPTX
Bagging.pptx
PPT
K mean-clustering
PPT
Decision tree
PPT
15857 cse422 unsupervised-learning
PDF
Naive Bayes Classifier Tutorial | Naive Bayes Classifier Example | Naive Baye...
PPT
Computational Learning Theory
PDF
PDF
Data clustering
PDF
Introduction to XGBoost
PPTX
Ensemble learning
PPTX
Ensemble methods
PPTX
임태현, Text-CNN을 이용한 Sentiment 분설모델 구현
PDF
Decision trees & random forests
PPTX
Module 4 part_1
PPTX
Naive bayes
Ensemble methods
Introduction to Machine Learning
Learning from imbalanced data
Bagging.pptx
K mean-clustering
Decision tree
15857 cse422 unsupervised-learning
Naive Bayes Classifier Tutorial | Naive Bayes Classifier Example | Naive Baye...
Computational Learning Theory
Data clustering
Introduction to XGBoost
Ensemble learning
Ensemble methods
임태현, Text-CNN을 이용한 Sentiment 분설모델 구현
Decision trees & random forests
Module 4 part_1
Naive bayes
Ad

Similar to hands on machine learning Chapter 6&7 decision tree, ensemble and random forest (20)

PDF
Introduction to conventional machine learning techniques
PPTX
Machine learning basics using trees algorithm (Random forest, Gradient Boosting)
PDF
Lecture 9 - Decision Trees and Ensemble Methods, a lecture in subject module ...
PPTX
Machine Learning Notes on Decision Trees.pptx
PPT
PPT
ai4.ppt
PPTX
Decision Tree - C4.5&CART
PPT
ai4.ppt
PPTX
Classification.pptx
PPT
classification in data warehouse and mining
PDF
Aaa ped-14-Ensemble Learning: About Ensemble Learning
PPTX
[Women in Data Science Meetup ATX] Decision Trees
PDF
2023 Supervised Learning for Orange3 from scratch
 
PPTX
Machine Learning Algorithms (Part 1)
PPTX
Decision tree, softmax regression and ensemble methods in machine learning
PPTX
DECISION TREE AND PROBABILISTIC MODELS.pptx
PPTX
Machine learning and decision trees
PPT
[ppt]
PPT
[ppt]
PPTX
Ensemble learning Techniques
Introduction to conventional machine learning techniques
Machine learning basics using trees algorithm (Random forest, Gradient Boosting)
Lecture 9 - Decision Trees and Ensemble Methods, a lecture in subject module ...
Machine Learning Notes on Decision Trees.pptx
ai4.ppt
Decision Tree - C4.5&CART
ai4.ppt
Classification.pptx
classification in data warehouse and mining
Aaa ped-14-Ensemble Learning: About Ensemble Learning
[Women in Data Science Meetup ATX] Decision Trees
2023 Supervised Learning for Orange3 from scratch
 
Machine Learning Algorithms (Part 1)
Decision tree, softmax regression and ensemble methods in machine learning
DECISION TREE AND PROBABILISTIC MODELS.pptx
Machine learning and decision trees
[ppt]
[ppt]
Ensemble learning Techniques
Ad

More from Jaey Jeong (16)

PPTX
Improving accuracy of binary neural networks using unbalanced activation dist...
PPTX
Gaze estimation using transformer
PPTX
Unsupervised representation learning for gaze estimation
PPTX
Mlp mixer an all-mlp architecture for vision
PPTX
핵심 딥러닝 입문 4장 RNN
PPTX
Neural networks for semantic gaze analysis in xr settings
PPTX
Gaze supported 3 d object manipulation in virtual reality
PPTX
hands on machine learning Chapter 4 model training
PPTX
Deep learning based gaze detection system for automobile drivers using nir ca...
PPTX
Appearance based gaze estimation using deep features and random forest regres...
PPTX
Tablet gaze unconstrained appearance based gaze estimation in mobile tablets
PPTX
deep learning from scratch chapter 7.cnn
PPTX
deep learning from scratch chapter 5.learning related skills
PPTX
deep learning from scratch chapter 6.backpropagation
PPTX
deep learning from scratch chapter 4.neural network learing
PPTX
deep learning from scratch chapter 3 neural network
Improving accuracy of binary neural networks using unbalanced activation dist...
Gaze estimation using transformer
Unsupervised representation learning for gaze estimation
Mlp mixer an all-mlp architecture for vision
핵심 딥러닝 입문 4장 RNN
Neural networks for semantic gaze analysis in xr settings
Gaze supported 3 d object manipulation in virtual reality
hands on machine learning Chapter 4 model training
Deep learning based gaze detection system for automobile drivers using nir ca...
Appearance based gaze estimation using deep features and random forest regres...
Tablet gaze unconstrained appearance based gaze estimation in mobile tablets
deep learning from scratch chapter 7.cnn
deep learning from scratch chapter 5.learning related skills
deep learning from scratch chapter 6.backpropagation
deep learning from scratch chapter 4.neural network learing
deep learning from scratch chapter 3 neural network

Recently uploaded (20)

PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
Website Design Services for Small Businesses.pdf
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
assetexplorer- product-overview - presentation
PPTX
GSA Content Generator Crack (2025 Latest)
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
iTop VPN Crack Latest Version Full Key 2025
PPTX
"Secure File Sharing Solutions on AWS".pptx
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
Cost to Outsource Software Development in 2025
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Website Design Services for Small Businesses.pdf
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
MCP Security Tutorial - Beginner to Advanced
Salesforce Agentforce AI Implementation.pdf
assetexplorer- product-overview - presentation
GSA Content Generator Crack (2025 Latest)
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
iTop VPN Crack Latest Version Full Key 2025
"Secure File Sharing Solutions on AWS".pptx
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
wealthsignaloriginal-com-DS-text-... (1).pdf
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Weekly report ppt - harsh dattuprasad patel.pptx
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Monitoring Stack: Grafana, Loki & Promtail
Cost to Outsource Software Development in 2025
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Embracing Complexity in Serverless! GOTO Serverless Bengaluru

hands on machine learning Chapter 6&7 decision tree, ensemble and random forest

  • 1. Interaction Lab. Kumoh National Institute of Technology Hands-On Machine Learning with Scikit-Learn, Keras & TensorFlow Chapter 6. Decision Tree Chapter 7. Ensemble and random forest Jeong jaeyeop
  • 2. ■Decision tree ■Ensemble and random forest Agenda Interaction Lab., Kumoh National Institue of Technology 2
  • 3. Decision tree Ensemble and random forest Data Engineering Lab., Kumoh National Institue of Technology 3
  • 4. ■Decision tree  Machine learning algorithms • Classification • Regression  Components of a random forest Intro Interaction Lab., Kumoh National Institue of Technology 4
  • 5. ■Decision tree training  Use iris datasets • Species : setosa, versicolor, virginica • Property : sepal length, sepal width, petal length, petal width Decision tree training and visualization(1/2) Interaction Lab., Kumoh National Institue of Technology 5
  • 6. ■Decision tree visualization  Use export_graphviz in sklearn Decision tree training and visualization(2/2) Interaction Lab., Kumoh National Institue of Technology 6
  • 7. ■How to tree make prediction?  Start root node(depth = 0)  Samples are value  Value is number of samples  Gini is impurity • If gini is 0, that node is pure  Class is predicted value Prediction(1/2) Interaction Lab., Kumoh National Institue of Technology 7
  • 8. ■Gini calculation method  1 − 0 54 2 − 49 54 2 − 5 54 2 ≈ 0.168  𝐺𝑖 = 1 − 𝑘=1 𝑛 𝑃𝑖,𝑘 2 Prediction(2/2) Interaction Lab., Kumoh National Institue of Technology 8
  • 9. ■CART algorithm  Decision tree training in sklearn • Divide subset using property 𝑘 and threshold 𝑡𝑘  Cost function • 𝐽 𝑘, 𝑡𝑘 = 𝑚𝑙𝑒𝑓𝑡 𝑚 𝐺𝑙𝑒𝑓𝑡 + 𝑚𝑟𝑖𝑔ℎ𝑡 𝑚 𝐺𝑟𝑖𝑔ℎ𝑡 • 𝐺𝑙𝑒𝑓𝑡/𝑟𝑖𝑔ℎ𝑡 𝑖𝑠 𝑙𝑒𝑓𝑡/𝑟𝑖𝑔ℎ𝑡 𝑖𝑚𝑝𝑢𝑟𝑖𝑡𝑦 𝑜𝑓 𝑠𝑢𝑏𝑠𝑒𝑡𝑠 𝑚𝑙𝑒𝑓𝑡/𝑟𝑖𝑔ℎ𝑡 𝑖𝑠 𝑙𝑒𝑓𝑡/𝑟𝑖𝑔ℎ𝑡 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑠𝑎𝑚𝑝𝑙𝑒𝑠  Repeat until limited max depth, cannot divide CART training algorithm Interaction Lab., Kumoh National Institue of Technology 9
  • 10. ■Determination of impurity  Default setup is gini  Entropy • Determination of impurity in machine learning • If it is stable and orderly, the entropy is 0 • If a set contains only one class of samples, the entropy is 0 • 𝐻𝑖 = − 𝑘=1 𝑃𝑖,𝑘≠0 𝑛 𝑃𝑖,𝑘 𝑙𝑜𝑔2(𝑃𝑖,𝑘) • − 49 54 𝑙𝑜𝑔2( 49 54 ) − 5 54 𝑙𝑜𝑔2( 5 54 ) ≈ 0.445  Entropy makes balanced tree Gini or entropy Interaction Lab., Kumoh National Institue of Technology 10
  • 11. ■Nonparametric model  Model structure is free  Limit the degree of freedom of the decision tree to avoid overfitting  Regulatory parameters in keras • min_samples_split • min_samples_leaf • min_weight_fraction_leaf • max_leaf_nodes • max_features Regulatory parameters Interaction Lab., Kumoh National Institue of Technology 11
  • 12. ■Decision tree regressor in sklearn  DecisionTreeRegressor Regression(1/2) Interaction Lab., Kumoh National Institue of Technology 12
  • 13. ■CART algorithm  Not gini, use mse for divide subsets  Cost function • 𝐽 𝑘, 𝑡𝑘 = 𝑚𝑙𝑒𝑓𝑡 𝑚 𝑀𝑆𝐸𝑙𝑒𝑓𝑡 + 𝑚𝑟𝑖𝑔ℎ𝑡 𝑚 𝑀𝑆𝐸𝑟𝑖𝑔ℎ𝑡 • 𝑀𝑆𝐸𝑛𝑜𝑑𝑒 = 𝑖∈𝑛𝑜𝑑𝑒(𝑦𝑛𝑜𝑑𝑒 − 𝑦(𝑖) )2 𝑦𝑛𝑜𝑑𝑒 = 1 𝑚𝑛𝑜𝑑𝑒 𝑖∈𝑛𝑜𝑑𝑒 𝑦(𝑖) Regression(2/2) Interaction Lab., Kumoh National Institue of Technology 13
  • 14. ■Sensitive to rotation of training sets Instability Interaction Lab., Kumoh National Institue of Technology 14
  • 15. Ensemble and random forest Data Engineering Lab., Kumoh National Institue of Technology 15
  • 16. ■Ensemble  Collect predictions from estimators and get better predictions  Different algorithm same data  Same data different algorithm ■Random forest  Ensemble of decision trees ■Ensemble method  Bagging  Boosting  Stacking Intro
  • 17. ■Training several classifiers Voting-based classifiers(1/3) Interaction Lab., Kumoh National Institue of Technology 17
  • 18. ■Prediction several classifiers  Weak learner • Low performance, like random  Strong learner • High performance Voting-based classifiers(2/3) Interaction Lab., Kumoh National Institue of Technology 18
  • 19. ■Voting-based classifiers in sklearn  Hard voting • Decision by majority • voting = ‘hard’  Soft voting • Decision by probability • voting = ‘soft’ Voting-based classifiers(3/3) Interaction Lab., Kumoh National Institue of Technology 19
  • 20. ■Same algorithm different data  Bagging(bootstrap aggregating) • Sampling by allowing redundancy in the training set  Pasting • Sampling without allowing redundancy in the training set Bagging and pasting(1/2) Interaction Lab., Kumoh National Institue of Technology 20
  • 21. ■Bagging and pasting in sklearn Bagging and pasting(2/2) Interaction Lab., Kumoh National Institue of Technology 21
  • 22. ■OOB  Out Of Bag • Unselected samples : 37% • Use validation sets OOB evaluation Interaction Lab., Kumoh National Institue of Technology 22
  • 23. ■Ensemble of decision tree  Generally, bagging  max_leaf_node = 16, 500 trees  Split tree node • Find the best property among randomly selected property candidates Random forest(1/3) Interaction Lab., Kumoh National Institue of Technology 23
  • 24. ■Extra-trees  Extremely random trees  Find best property among randomly selected property candidates  Fast than general random forest  ExtraTrees in sklearn • ExtraTreesClassifier() • ExTreesRegressor() Random forest(2/3) Interaction Lab., Kumoh National Institue of Technology 24
  • 25. ■Property importance  Ease of measuring the relative importance of property  feature_importances_  Property of the petals are more important than property of sepal Random forest(3/3) Interaction Lab., Kumoh National Institue of Technology 25
  • 26. ■Concept  Connecting multiple weak learners to create a strong learner  Learn the estimators by complementing the preceding model ■Popular kind  AdaBoost(adaptive boosting)  Gradient boosting Boosting(1/6) Interaction Lab., Kumoh National Institue of Technology 26
  • 27. ■AdaBoost  Increasing the weight of training samples that previous models were underfitting  Making predictions in the same way as bagging and pasting Boosting(2/6) Interaction Lab., Kumoh National Institue of Technology 27
  • 28. ■ AdaBoost algorithm  Weight(𝑤(𝑖) ) : initialize 1 𝑚  Learn the first estimator • Weighted error rate 𝑟1, calculated for this training set  Error rate weighted by 𝑗𝑡ℎ estimator • 𝑟 𝑗 = 𝑖=1 𝑦 𝑗 (𝑖) ≠𝑦(𝑖) 𝑚 𝑊(𝑖) 𝑖=1 𝑚 𝑤(𝑖)  Estimator weight • 𝛼𝑗 = (𝑒𝑡𝑎)𝑙𝑜𝑔 1−𝑟𝑗 𝑟𝑗  Weight update rule • 𝑊(𝑖) ← 𝑊(𝑖) 𝑦𝑗 (𝑖) = 𝑦(𝑖) 𝑊(𝑖) exp(𝛼𝑗) 𝑦𝑗 (𝑖) ≠ 𝑦(𝑖) Boosting(3/6) Interaction Lab., Kumoh National Institue of Technology 28
  • 29. ■Gradient boosting  Learn with residual error from previous model  Learn from quadratic curve data Boosting(4/6) Interaction Lab., Kumoh National Institue of Technology 29
  • 30. ■Gradient boosting Boosting(5/6) Interaction Lab., Kumoh National Institue of Technology 30
  • 31. ■Gradient boosting  Learning rate • Low requires a lot of trees  Typical library • XGBoost Boosting(6/6) Interaction Lab., Kumoh National Institue of Technology 31
  • 32. ■Concept  Train a model that aggregates predictions  Blender or meta learner Stacking(1/3) Interaction Lab., Kumoh National Institue of Technology 32
  • 33. ■Training  Divide the data into two subsets  Train the first layer with the first data  Predict the second data with the first layer trained Stacking(2/3) Interaction Lab., Kumoh National Institue of Technology 33
  • 34. ■Multi layer stacking ensemble prediction Stacking(3/3) Interaction Lab., Kumoh National Institue of Technology 34

Editor's Notes

  • #11: 분자의 무질서함을 측정하는 것으로 원래 열역학의 개념 분자가 안정되고 질서 정연하면 엔트로피가 0에 가까움