diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs000.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs000.html index f6d45fa73..a0cf685f0 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs000.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs000.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -178,7 +176,7 @@ MathJax.Hub.Config({
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

    -

    Dec 17, 2018

    +

    Oct 24, 2019


    @@ -202,7 +200,7 @@ MathJax.Hub.Config({

  • 9
  • 10
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • @@ -220,7 +218,7 @@ MathJax.Hub.Config({
    - © 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license + © 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
    diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs001.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs001.html index db93b083a..aca7dd021 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs001.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs001.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -207,7 +205,7 @@ and leaf nodes which are then connected by branches.
  • 10
  • 11
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs002.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs002.html index 1b9c5c621..4325e1da4 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs002.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs002.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -192,7 +190,7 @@ Then we are essentially done!
  • 11
  • 12
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs003.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs003.html index f8e73dc90..ea02583d2 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs003.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs003.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -271,7 +269,7 @@ plt.show()
  • 12
  • 13
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs004.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs004.html index 7f1ab9b71..b82959053 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs004.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs004.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,104 +157,35 @@ MathJax.Hub.Config({ -

    Maxwell-Boltzmann velocity distribution

    +

    Building a tree, regression

    +There are mainly two steps - -

    # Program to test the Metropolis algorithm with one particle at given temp in
    -# one dimension
    -#!/usr/bin/env python
    -import numpy as np
    -import matplotlib.mlab as mlab
    -import matplotlib.pyplot as plt
    -import random
    -from math import sqrt, exp, log
    -from sklearn.preprocessing import PolynomialFeatures
    -from sklearn.linear_model import LinearRegression
    -# initialize the rng with a seed
    -random.seed()
    -# Hard coding of input parameters
    -MCcycles = 100000
    -Temperature = 2.0
    -beta = 1./Temperature
    -InitialVelocity = -2.0
    -CurrentVelocity = InitialVelocity
    -Energy = 0.5*InitialVelocity*InitialVelocity
    -VelocityRange = 10*sqrt(Temperature)
    -VelocityStep = 2*VelocityRange/10.
    -AverageEnergy = Energy
    -AverageEnergy2 = Energy*Energy
    -VelocityValues = np.zeros(MCcycles)
    -# The Monte Carlo sampling with Metropolis starts here
    -for i in range (1, MCcycles, 1):
    -    TrialVelocity = CurrentVelocity + (2.0*random.random() - 1.0)*VelocityStep
    -    EnergyChange = 0.5*(TrialVelocity*TrialVelocity -CurrentVelocity*CurrentVelocity);
    -    if random.random() <= exp(-beta*EnergyChange):
    -        CurrentVelocity = TrialVelocity
    -        Energy += EnergyChange
    -        VelocityValues[i] = CurrentVelocity
    -    AverageEnergy += Energy
    -    AverageEnergy2 += Energy*Energy
    -#Final averages
    -AverageEnergy = AverageEnergy/MCcycles
    -AverageEnergy2 = AverageEnergy2/MCcycles
    -Variance = AverageEnergy2 - AverageEnergy*AverageEnergy
    -print(AverageEnergy, Variance)
    -n, bins, patches = plt.hist(VelocityValues, 400, facecolor='green')
    +
      +
    1. We split the predictor space (the set of possible values \( x_1,x_2,\dots, x_p \)) into \( J \)
    2. +
    -plt.xlabel('$v$') -plt.ylabel('Velocity distribution P(v)') -plt.title(r'Velocity histogram at $k_BT=2$') -plt.axis([-5, 5, 0, 600]) -plt.grid(True) -from collections import Counter +distinct and non-non-overlapping regions, \( R_1,R_2,\dots,R_J \). -#print (Counter(VelocityValues)) +
      +
    1. For every observation that falls into the region \( R_j \) , we make the same prediction, which is simply the mean of the response values for the training observations in \( R_j \).
    2. +
    -print (VelocityValues[:20]) -VelocityValues=list(Counter(VelocityValues).keys()) -d=list(Counter(VelocityValues).values()) +How do we construct the regions \( R_1,\dots,R_J \)? +In theory, the regions could have any shape. However, we +choose to divide the predictor space into high-dimensional rectangles, +or boxes, for simplicity and for ease of interpretation of the +resulting predic- tive model. The goal is to find boxes \( R_1,\dots,R_J \) +that minimize the MSE, given by +$$ +\sum_{j=1}^J\sum_{i\in R_j}(y_i-\overline{y}_{R_j})^2, +$$ -VelocityValues=np.asarray(VelocityValues)[:, np.newaxis] -d=np.asarray(d) -print (VelocityValues.shape, d.shape) +where \( \overline{y}_{R_j} \) is the mean response for the training observations +within the $j$th +box. -plt.scatter(VelocityValues, d) -plt.show() - -#2nd Degree Polynomial -poly_feat=PolynomialFeatures(degree=20, include_bias=False) -X_poly=poly_feat.fit_transform(VelocityValues) -lin_reg=LinearRegression() -poly_fit=lin_reg.fit(X_poly,d) - -y_plot=poly_fit.predict(X_poly) -plt.title("Polynomial Fit") -plt.plot(VelocityValues, y_plot, color='black', label="Fit") -plt.show() - -#Decision Trees - -from sklearn.tree import DecisionTreeRegressor -regr_1=DecisionTreeRegressor(max_depth=2) -regr_2=DecisionTreeRegressor(max_depth=5) -regr_3=DecisionTreeRegressor(max_depth=7) -regr_1.fit(VelocityValues, d) -regr_2.fit(VelocityValues, d) -regr_3.fit(VelocityValues, d) - -X_test = np.arange(0.0, MCcycles, 0.01)[:, np.newaxis] -y_1=regr_1.predict(X_test) -y_2=regr_2.predict(X_test) -y_3=regr_3.predict(X_test) - -plt.title("Decision Tree") -plt.plot(X_test, y_1, color="red", label="max_depth=2", linewidth=2) -plt.plot(X_test, y_2, color="green", label="max_depth=5", linewidth=2) -plt.plot(X_test, y_3, color="m", label="max_depth=7", linewidth=2) -plt.show() -

    @@ -277,7 +206,7 @@ plt.show()

  • 13
  • 14
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs005.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs005.html index 9f9c578ed..b71aa18b4 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs005.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs005.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,34 +157,21 @@ MathJax.Hub.Config({ -

    Building a tree, regression

    +

    A top-down approach, recursive binary splitting

    -There are mainly two steps +Unfortunately, it is computationally infeasible to consider every +possible partition of the feature space into \( J \) boxes. +The common strategy is to take a top-down approach -

      -
    1. We split the predictor space (the set of possible values \( x_1,x_2,\dots, x_p \)) into \( J \)
    2. -
    - -distinct and non-non-overlapping regions, \( R_1,R_2,\dots,R_J \). - -
      -
    1. For every observation that falls into the region \( R_j \) , we make the same prediction, which is simply the mean of the response values for the training observations in \( R_j \).
    2. -
    - -How do we construct the regions \( R_1,\dots,R_J \)? -In theory, the regions could have any shape. However, we -choose to divide the predictor space into high-dimensional rectangles, -or boxes, for simplicity and for ease of interpretation of the -resulting predic- tive model. The goal is to find boxes \( R_1,\dots,R_J \) -that minimize the MSE, given by -$$ -\sum_{j=1}^J\sum_{i\in R_j}(y_i-\overline{y}_{R_j})^2, -$$ - -where \( \overline{y}_{R_j} \) is the mean response for the training observations -within the $j$th -box. +

    +The approach is top-down because it begins at the top of the tree (all +observations belong to a single region) and then successively splits +the predictor space; each split is indicated via two new branches +further down on the tree. It is greedy because at each step of the +tree-building process, the best split is made at that particular step, +rather than looking ahead and picking a split that will lead to a +better tree in some future step.

    @@ -209,7 +194,7 @@ box.

  • 14
  • 15
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs006.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs006.html index 3058546ab..16e303e1f 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs006.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs006.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,21 +157,49 @@ MathJax.Hub.Config({ -

    A top-down approach, recursive binary splitting

    +

    Making a tree

    -Unfortunately, it is computationally infeasible to consider every -possible partition of the feature space into \( J \) boxes. -The common strategy is to take a top-down approach +In order to implement the recursive binary splitting we start by selecting +the predictor \( x_j \) and a cutpoint \( s \) that splits the predictor space into two regions \( R_1 \) and \( R_2 \) +$$ +\left\{X\vert x_j < s\right\}, +$$ + +and +$$ +\left\{X\vert x_j \geq s\right\}, +$$ + +so that we obtain the lowest MSE, that is +$$ +\sum_{i:x_i\in R_j}(y_i-\overline{y}_{R_1})^2+\sum_{i:x_i\in R_2}(y_i-\overline{y}_{R_2})^2, +$$ + +which we want to minimize by considering all predictors \( x_1,x_2,\dots,x_p \). +We consider also all possible values of \( s \) for each predictor. These values could be determined by randomly assigned numbers or by starting at the midpoint and then proceed till we find an optimal value.

    -The approach is top-down because it begins at the top of the tree (all -observations belong to a single region) and then successively splits -the predictor space; each split is indicated via two new branches -further down on the tree. It is greedy because at each step of the -tree-building process, the best split is made at that particular step, -rather than looking ahead and picking a split that will lead to a -better tree in some future step. +For any \( j \) and \( s \), we define the pair of +half-planes where \( \overline{y}_{R_1} \) is the mean response for the training +observations in \( R_1(j,s) \), and \( \overline{y}_{R_2} \) is the mean response for the +training observations in \( R_2(j,s) \). + +

    +Finding the values of j and s that +minimize the above equation can be done quite quickly, especially when the number +of features \( p \) is not too large. + +

    +Next, we repeat the process, looking +for the best predictor and best cutpoint in order to split the data +further so as to minimize the MSE within each of the resulting +regions. However, this time, instead of splitting the entire predictor +space, we split one of the two previously identified regions. We now +have three regions. Again, we look to split one of these three regions +further, so as to minimize the MSE. The process continues until a +stopping criterion is reached; for instance, we may continue until no +region contains more than five observations.

    @@ -197,7 +223,7 @@ better tree in some future step.

  • 15
  • 16
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs007.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs007.html index 1c0366b4e..5108d19bc 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs007.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs007.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -157,51 +155,23 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Making a tree

    +

    Pruning the tree

    -In order to implement the recursive binary splitting we start by selecting -the predictor \( x_j \) and a cutpoint \( s \) that splits the predictor space into two regions \( R_1 \) and \( R_2 \) -$$ -\left\{X\vert x_j < s\right\}, -$$ - -and -$$ -\left\{X\vert x_j \geq s\right\}, -$$ - -so that we obtain the lowest MSE, that is -$$ -\sum_{i:x_i\in R_j}(y_i-\overline{y}_{R_1})^2+\sum_{i:x_i\in R_2}(y_i-\overline{y}_{R_2})^2, -$$ - -which we want to minimize by considering all predictors \( x_1,x_2,\dots,x_p \). -We consider also all possible values of \( s \) for each predictor. These values could be determined by randomly assigned numbers or by starting at the midpoint and then proceed till we find an optimal value. +The above procedure is rather straightforward, but leads often to +overfitting and unnecessarily large and complicated trees. The basic +idea is to grow a large tree \( T_0 \) and then prune it back in order to +obtain a subtree. A smaller tree with fewer splits (fewer regions) can +lead to smaller variance and better interpretation at the cost of a +little more bias.

    -For any \( j \) and \( s \), we define the pair of -half-planes where \( \overline{y}_{R_1} \) is the mean response for the training -observations in \( R_1(j,s) \), and \( \overline{y}_{R_2} \) is the mean response for the -training observations in \( R_2(j,s) \). - -

    -Finding the values of j and s that -minimize the above equation can be done quite quickly, especially when the number -of features \( p \) is not too large. - -

    -Next, we repeat the process, looking -for the best predictor and best cutpoint in order to split the data -further so as to minimize the MSE within each of the resulting -regions. However, this time, instead of splitting the entire predictor -space, we split one of the two previously identified regions. We now -have three regions. Again, we look to split one of these three regions -further, so as to minimize the MSE. The process continues until a -stopping criterion is reached; for instance, we may continue until no -region contains more than five observations. +The so-called Cost complexity pruning algorithm gives us a +way to do just this. Rather than considering every possible subtree, +we consider a sequence of trees indexed by a nonnegative tuning +parameter \( \alpha \).

    @@ -226,7 +196,7 @@ region contains more than five observations.

  • 16
  • 17
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs008.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs008.html index 1cbec4eec..62f58548f 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs008.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs008.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -157,23 +155,35 @@ MathJax.Hub.Config({

     

     

     

    - + -

    Pruning the tree

    +

    Cost complexity pruning

    +For each value of \( \alpha \) there corresponds a subtree \( T \in T_0 \) such that +$$ +\sum_{m=1}^{\overline{T}}\sum_{i:x_i\in R_m}(y_i-\overline{y}_{R_m})^2+\alpha\overline{T}, +$$ + +is as small as possible. Here \( \overline{T} \) is +the number of terminal nodes of the tree \( T \) , \( R_m \) is the +rectangle (i.e. the subset of predictor space) corresponding to the \( m \)-th terminal node.

    -The above procedure is rather straightforward, but leads often to -overfitting and unnecessarily large and complicated trees. The basic -idea is to grow a large tree \( T_0 \) and then prune it back in order to -obtain a subtree. A smaller tree with fewer splits (fewer regions) can -lead to smaller variance and better interpretation at the cost of a -little more bias. +The tuning parameter \( \alpha \) controls a trade-off between the subtree’s +com- plexity and its fit to the training data. When \( \alpha = 0 \), then the +subtree \( T \) will simply equal \( T_0 \), +because then the above equation just measures the +training error. +However, as \( \alpha \) increases, there is a price to pay for +having a tree with many terminal nodes. The above equation will +tend to be minimized for a smaller subtree.

    -The so-called Cost complexity pruning algorithm gives us a -way to do just this. Rather than considering every possible subtree, -we consider a sequence of trees indexed by a nonnegative tuning -parameter \( \alpha \). +It turns out that as we increase \( \alpha \) from zero +branches get pruned from the tree in a nested and predictable fashion, +so obtaining the whole sequence of subtrees as a function of \( \alpha \) is +easy. We can select a value of \( \alpha \) using a validation set or using +cross-validation. We then return to the full data set and obtain the +subtree corresponding to \( \alpha \).

    @@ -199,7 +209,7 @@ parameter \( \alpha \).

  • 17
  • 18
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs009.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs009.html index eed0b48da..e5fed5a4b 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs009.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs009.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,33 +157,29 @@ MathJax.Hub.Config({ -

    Cost complexity pruning

    -For each value of \( \alpha \) there corresponds a subtree \( T \in T_0 \) such that -$$ -\sum_{m=1}^{\overline{T}}\sum_{i:x_i\in R_m}(y_i-\overline{y}_{R_m})^2+\alpha\overline{T}, -$$ - -is as small as possible. Here \( \overline{T} \) is -the number of terminal nodes of the tree \( T \) , \( R_m \) is the -rectangle (i.e. the subset of predictor space) corresponding to the \( m \)-th terminal node. +

    A schematic procedure

    -The tuning parameter \( \alpha \) controls a trade-off between the subtree’s -com- plexity and its fit to the training data. When \( \alpha = 0 \), then the -subtree \( T \) will simply equal \( T_0 \), -because then the above equation just measures the -training error. -However, as \( \alpha \) increases, there is a price to pay for -having a tree with many terminal nodes. The above equation will -tend to be minimized for a smaller subtree. +

    +
    +

    + +

      +
    1. Use recursive binary splitting to grow a large tree on the training data, stopping only when each terminal node has fewer than some minimum number of observations.
    2. +
    3. Apply cost complexity pruning to the large tree in order to obtain a sequence of best subtrees, as a function of \( \alpha \).
    4. +
    5. Use for example \( K \)-fold cross-validation to choose \( \alpha \). Divide the training observations into \( K \) folds. For each \( k=1,2,\dots,K \) we:
    6. + +
        +
      • repeat steps 1 and 2 on all but the \( k \)-th fold of the training data.
      • +
      • Then we valuate the mean squared prediction error on the data in the left-out \( k \)-th fold, as a function of \( \alpha \).
      • +
      • Finally we average the results for each value of \( \alpha \), and pick \( \alpha \) to minimize the average error.
      • +
      + +
    7. Return the subtree from Step 2 that corresponds to the chosen value of \( \alpha \).
    8. +
    +
    +
    -

    -It turns out that as we increase \( \alpha \) from zero -branches get pruned from the tree in a nested and predictable fashion, -so obtaining the whole sequence of subtrees as a function of \( \alpha \) is -easy. We can select a value of \( \alpha \) using a validation set or using -cross-validation. We then return to the full data set and obtain the -subtree corresponding to \( \alpha \).

    @@ -212,7 +206,7 @@ subtree corresponding to \( \alpha \).

  • 18
  • 19
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs010.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs010.html index cbaa14489..24b2522be 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs010.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs010.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,29 +157,21 @@ MathJax.Hub.Config({ -

    A schematic procedure

    +

    A classification tree

    -

    -
    -

    - -

      -
    1. Use recursive binary splitting to grow a large tree on the training data, stopping only when each terminal node has fewer than some minimum number of observations.
    2. -
    3. Apply cost complexity pruning to the large tree in order to obtain a sequence of best subtrees, as a function of \( \alpha \).
    4. -
    5. Use for example \( K \)-fold cross-validation to choose \( \alpha \). Divide the training observations into \( K \) folds. For each \( k=1,2,\dots,K \) we:
    6. - -
        -
      • repeat steps 1 and 2 on all but the \( k \)-th fold of the training data.
      • -
      • Then we valuate the mean squared prediction error on the data in the left-out \( k \)-th fold, as a function of \( \alpha \).
      • -
      • Finally we average the results for each value of \( \alpha \), and pick \( \alpha \) to minimize the average error.
      • -
      - -
    7. Return the subtree from Step 2 that corresponds to the chosen value of \( \alpha \).
    8. -
    -
    -
    - +A classification tree is very similar to a regression tree, except +that it is used to predict a qualitative response rather than a +quantitative one. Recall that for a regression tree, the predicted +response for an observation is given by the mean response of the +training observations that belong to the same terminal node. In +contrast, for a classification tree, we predict that each observation +belongs to the most commonly occurring class of training observations +in the region to which it belongs. In interpreting the results of a +classification tree, we are often interested not only in the class +prediction corresponding to a particular terminal node region, but +also in the class proportions among the training observations that +fall into that region.

    @@ -209,7 +199,7 @@ MathJax.Hub.Config({

  • 19
  • 20
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs011.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs011.html index ea4584c4f..47ae20d8d 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs011.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs011.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,21 +157,26 @@ MathJax.Hub.Config({ -

    A classification tree

    +

    Growing a classification tree

    -A classification tree is very similar to a regression tree, except -that it is used to predict a qualitative response rather than a -quantitative one. Recall that for a regression tree, the predicted -response for an observation is given by the mean response of the -training observations that belong to the same terminal node. In -contrast, for a classification tree, we predict that each observation -belongs to the most commonly occurring class of training observations -in the region to which it belongs. In interpreting the results of a -classification tree, we are often interested not only in the class -prediction corresponding to a particular terminal node region, but -also in the class proportions among the training observations that -fall into that region. +The task of growing a +classification tree is quite similar to the task of growing a +regression tree. Just as in the regression setting, we use recursive +binary splitting to grow a classification tree. However, in the +classification setting, the MSE cannot be used as a criterion for making +the binary splits. A natural alternative to MSE is the classification +error rate. Since we plan to assign an observation in a given region +to the most commonly occurring error rate class of training +observations in that region, the classification error rate is simply +the fraction of the training observations in that region that do not +belong to the most common class. + +

    +When building a classification tree, either the Gini index or the +entropy are typically used to evaluate the quality of a particular +split, since these two approaches are more sensitive to node purity +than is the classification error rate.

    @@ -201,7 +204,7 @@ fall into that region.

  • 20
  • 21
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs012.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs012.html index 9153fb3cb..5ec800104 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs012.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs012.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,26 +157,44 @@ MathJax.Hub.Config({ -

    Growing a classification tree

    +

    Classification tree, how to split nodes

    +If our targets are the outcome of a classification process that takes for example +\( k=1,2,\dots,K \) values, the only thing we need to think of is to set up the splitting criteria for each node.

    -The task of growing a -classification tree is quite similar to the task of growing a -regression tree. Just as in the regression setting, we use recursive -binary splitting to grow a classification tree. However, in the -classification setting, the MSE cannot be used as a criterion for making -the binary splits. A natural alternative to MSE is the classification -error rate. Since we plan to assign an observation in a given region -to the most commonly occurring error rate class of training -observations in that region, the classification error rate is simply -the fraction of the training observations in that region that do not -belong to the most common class. +We define a PDF \( p_{mk} \) that represents the number of observations of a class \( k \) in a region \( R_m \) with \( N_m \) observations. We represent this likelihood function in terms of the proportion \( I(y_i=k) \) of observations of this class in the region \( R_m \) as +$$ +p_{mk} = \frac{1}{N_m}\sum_{x_i\in R_m}I(y_i=k). +$$

    -When building a classification tree, either the Gini index or the -entropy are typically used to evaluate the quality of a particular -split, since these two approaches are more sensitive to node purity -than is the classification error rate. +We let \( p_{mk} \) represent the majority class of observations in region \( m \). The three most common ways of splitting a node are given by + +

    + +$$ +p_{mk} = \frac{1}{N_m}\sum_{x_i\in R_m}I(y_i\ne k) = 1-p_{mk}. +$$ + + + + +$$ +g = \sum_{k=1}^K p_{mk}(1-p_{mk}). +$$ + + + + +$$ +s = -\sum_{k=1}^K p_{mk}\log{p_{mk}}. +$$

    @@ -206,7 +222,7 @@ than is the classification error rate.

  • 21
  • 22
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs013.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs013.html index c18bb8895..72b7a0f29 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs013.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs013.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,44 +157,10 @@ MathJax.Hub.Config({ -

    Classification tree, how to split nodes

    -If our targets are the outcome of a classification process that takes for example -\( k=1,2,\dots,K \) values, the only thing we need to think of is to set up the splitting criteria for each node. +

    Entropy and the ID3 algorithm

    -We define a PDF \( p_{mk} \) that represents the number of observations of a class \( k \) in a region \( R_m \) with \( N_m \) observations. We represent this likelihood function in terms of the proportion \( I(y_i=k) \) of observations of this class in the region \( R_m \) as -$$ -p_{mk} = \frac{1}{N_m}\sum_{x_i\in R_m}I(y_i=k). -$$ - -

    -We let \( p_{mk} \) represent the majority class of observations in region \( m \). The three most common ways of splitting a node are given by - -

    - -$$ -p_{mk} = \frac{1}{N_m}\sum_{x_i\in R_m}I(y_i\ne k) = 1-p_{mk}. -$$ - - - - -$$ -g = \sum_{k=1}^K p_{mk}(1-p_{mk}). -$$ - - - - -$$ -s = -\sum_{k=1}^K p_{mk}\log{p_{mk}}. -$$ +More text to come here.

    @@ -224,7 +188,7 @@ $$

  • 22
  • 23
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs014.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs014.html index 6c3ebff5d..4f5db444f 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs014.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs014.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,8 +157,95 @@ MathJax.Hub.Config({ -

    Entropy and the ID3 algorithm

    +

    Writing your own code for a classification tree

    +

    + + +

    def entropy(target_col):
    +    """
    +    Calculate the entropy of a dataset.
    +    The only parameter of this function is the target_col parameter which specifies the target column
    +    """
    +    elements,counts = np.unique(target_col,return_counts = True)
    +    entropy = np.sum([(-counts[i]/np.sum(counts))*np.log2(counts[i]/np.sum(counts)) for i in range(len(elements))])
    +    return entropy
    +
    +def InfoGain(data,split_attribute_name,target_name="class"):
    +    """
    +    Calculate the information gain of a dataset. This function takes three parameters:
    +    1. data = The dataset for whose feature the IG should be calculated
    +    2. split_attribute_name = the name of the feature for which the information gain should be calculated
    +    3. target_name = the name of the target feature. The default for this example is "class"
    +    """    
    +    #Calculate the entropy of the total dataset
    +    total_entropy = entropy(data[target_name])
    +    
    +    ##Calculate the entropy of the dataset
    +    
    +    #Calculate the values and the corresponding counts for the split attribute 
    +    vals,counts= np.unique(data[split_attribute_name],return_counts=True)
    +    
    +    #Calculate the weighted entropy
    +    Weighted_Entropy = np.sum([(counts[i]/np.sum(counts))*entropy(data.where(data[split_attribute_name]==vals[i]).dropna()[target_name]) for i in range(len(vals))])
    +    
    +    #Calculate the information gain
    +    Information_Gain = total_entropy - Weighted_Entropy
    +    return Information_Gain
    +       
    +
    +def ID3(data,originaldata,features,target_attribute_name="class",parent_node_class = None):
    +    #Define the stopping criteria --> If one of this is satisfied, we want to return a leaf node#
    +    
    +    #If all target_values have the same value, return this value
    +    if len(np.unique(data[target_attribute_name])) <= 1:
    +        return np.unique(data[target_attribute_name])[0]
    +    
    +    #If the dataset is empty, return the mode target feature value in the original dataset
    +    elif len(data)==0:
    +        return np.unique(originaldata[target_attribute_name])[np.argmax(np.unique(originaldata[target_attribute_name],return_counts=True)[1])]
    +    
    +    #If the feature space is empty, return the mode target feature value of the direct parent node --> Note that
    +    #the direct parent node is that node which has called the current run of the ID3 algorithm and hence
    +    #the mode target feature value is stored in the parent_node_class variable.
    +    
    +    elif len(features) ==0:
    +        return parent_node_class
    +    
    +    #If none of the above holds true, grow the tree!
    +    
    +    else:
    +        #Set the default value for this node --> The mode target feature value of the current node
    +        parent_node_class = np.unique(data[target_attribute_name])[np.argmax(np.unique(data[target_attribute_name],return_counts=True)[1])]
    +        
    +        #Select the feature which best splits the dataset
    +        item_values = [InfoGain(data,feature,target_attribute_name) for feature in features] #Return the information gain values for the features in the dataset
    +        best_feature_index = np.argmax(item_values)
    +        best_feature = features[best_feature_index]
    +        
    +        #Create the tree structure. The root gets the name of the feature (best_feature) with the maximum information
    +        #gain in the first run
    +        tree = {best_feature:{}}
    +        
    +        
    +        #Remove the feature with the best inforamtion gain from the feature space
    +        features = [i for i in features if i != best_feature]
    +        
    +        #Grow a branch under the root node for each possible value of the root node feature
    +        
    +        for value in np.unique(data[best_feature]):
    +            value = value
    +            #Split the dataset along the value of the feature with the largest information gain and therwith create sub_datasets
    +            sub_data = data.where(data[best_feature] == value).dropna()
    +            
    +            #Call the ID3 algorithm for each of those sub_datasets with the new parameters --> Here the recursion comes in!
    +            subtree = ID3(sub_data,dataset,features,target_attribute_name,parent_node_class)
    +            
    +            #Add the sub tree, grown from the sub_dataset to the tree under the root node
    +            tree[best_feature][value] = subtree
    +            
    +        return(tree)    
    +

    @@ -187,7 +272,7 @@ MathJax.Hub.Config({

  • 23
  • 24
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs015.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs015.html index 26084a604..7e14bb536 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs015.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs015.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,94 +157,74 @@ MathJax.Hub.Config({ -

    Writing your own code for a classification tree

    - +

    Back to moons again

    -

    def entropy(target_col):
    -    """
    -    Calculate the entropy of a dataset.
    -    The only parameter of this function is the target_col parameter which specifies the target column
    -    """
    -    elements,counts = np.unique(target_col,return_counts = True)
    -    entropy = np.sum([(-counts[i]/np.sum(counts))*np.log2(counts[i]/np.sum(counts)) for i in range(len(elements))])
    -    return entropy
    +
    from __future__ import division, print_function, unicode_literals
     
    -def InfoGain(data,split_attribute_name,target_name="class"):
    -    """
    -    Calculate the information gain of a dataset. This function takes three parameters:
    -    1. data = The dataset for whose feature the IG should be calculated
    -    2. split_attribute_name = the name of the feature for which the information gain should be calculated
    -    3. target_name = the name of the target feature. The default for this example is "class"
    -    """    
    -    #Calculate the entropy of the total dataset
    -    total_entropy = entropy(data[target_name])
    -    
    -    ##Calculate the entropy of the dataset
    -    
    -    #Calculate the values and the corresponding counts for the split attribute 
    -    vals,counts= np.unique(data[split_attribute_name],return_counts=True)
    -    
    -    #Calculate the weighted entropy
    -    Weighted_Entropy = np.sum([(counts[i]/np.sum(counts))*entropy(data.where(data[split_attribute_name]==vals[i]).dropna()[target_name]) for i in range(len(vals))])
    -    
    -    #Calculate the information gain
    -    Information_Gain = total_entropy - Weighted_Entropy
    -    return Information_Gain
    -       
    +# Common imports
    +import numpy as np
    +import os
     
    -def ID3(data,originaldata,features,target_attribute_name="class",parent_node_class = None):
    -    #Define the stopping criteria --> If one of this is satisfied, we want to return a leaf node#
    -    
    -    #If all target_values have the same value, return this value
    -    if len(np.unique(data[target_attribute_name])) <= 1:
    -        return np.unique(data[target_attribute_name])[0]
    -    
    -    #If the dataset is empty, return the mode target feature value in the original dataset
    -    elif len(data)==0:
    -        return np.unique(originaldata[target_attribute_name])[np.argmax(np.unique(originaldata[target_attribute_name],return_counts=True)[1])]
    -    
    -    #If the feature space is empty, return the mode target feature value of the direct parent node --> Note that
    -    #the direct parent node is that node which has called the current run of the ID3 algorithm and hence
    -    #the mode target feature value is stored in the parent_node_class variable.
    -    
    -    elif len(features) ==0:
    -        return parent_node_class
    -    
    -    #If none of the above holds true, grow the tree!
    -    
    +# to make this notebook's output stable across runs
    +np.random.seed(42)
    +
    +# To plot pretty figures
    +import matplotlib
    +import matplotlib.pyplot as plt
    +from matplotlib.colors import ListedColormap
    +plt.rcParams['axes.labelsize'] = 14
    +plt.rcParams['xtick.labelsize'] = 12
    +plt.rcParams['ytick.labelsize'] = 12
    +
    +
    +from sklearn.svm import SVC
    +from sklearn import datasets
    +from sklearn.tree import DecisionTreeClassifier
    +from sklearn.datasets import make_moons
    +from sklearn.tree import export_graphviz
    +
    +Xm, ym = make_moons(n_samples=100, noise=0.25, random_state=53)
    +
    +deep_tree_clf1 = DecisionTreeClassifier(random_state=42)
    +deep_tree_clf2 = DecisionTreeClassifier(min_samples_leaf=4, random_state=42)
    +deep_tree_clf1.fit(Xm, ym)
    +deep_tree_clf2.fit(Xm, ym)
    +
    +
    +def plot_decision_boundary(clf, X, y, axes=[0, 7.5, 0, 3], iris=True, legend=False, plot_training=True):
    +    x1s = np.linspace(axes[0], axes[1], 100)
    +    x2s = np.linspace(axes[2], axes[3], 100)
    +    x1, x2 = np.meshgrid(x1s, x2s)
    +    X_new = np.c_[x1.ravel(), x2.ravel()]
    +    y_pred = clf.predict(X_new).reshape(x1.shape)
    +    custom_cmap = ListedColormap(['#fafab0','#9898ff','#a0faa0'])
    +    plt.contourf(x1, x2, y_pred, alpha=0.3, cmap=custom_cmap)
    +    if not iris:
    +        custom_cmap2 = ListedColormap(['#7d7d58','#4c4c7f','#507d50'])
    +        plt.contour(x1, x2, y_pred, cmap=custom_cmap2, alpha=0.8)
    +    if plot_training:
    +        plt.plot(X[:, 0][y==0], X[:, 1][y==0], "yo", label="Iris-Setosa")
    +        plt.plot(X[:, 0][y==1], X[:, 1][y==1], "bs", label="Iris-Versicolor")
    +        plt.plot(X[:, 0][y==2], X[:, 1][y==2], "g^", label="Iris-Virginica")
    +        plt.axis(axes)
    +    if iris:
    +        plt.xlabel("Petal length", fontsize=14)
    +        plt.ylabel("Petal width", fontsize=14)
         else:
    -        #Set the default value for this node --> The mode target feature value of the current node
    -        parent_node_class = np.unique(data[target_attribute_name])[np.argmax(np.unique(data[target_attribute_name],return_counts=True)[1])]
    -        
    -        #Select the feature which best splits the dataset
    -        item_values = [InfoGain(data,feature,target_attribute_name) for feature in features] #Return the information gain values for the features in the dataset
    -        best_feature_index = np.argmax(item_values)
    -        best_feature = features[best_feature_index]
    -        
    -        #Create the tree structure. The root gets the name of the feature (best_feature) with the maximum information
    -        #gain in the first run
    -        tree = {best_feature:{}}
    -        
    -        
    -        #Remove the feature with the best inforamtion gain from the feature space
    -        features = [i for i in features if i != best_feature]
    -        
    -        #Grow a branch under the root node for each possible value of the root node feature
    -        
    -        for value in np.unique(data[best_feature]):
    -            value = value
    -            #Split the dataset along the value of the feature with the largest information gain and therwith create sub_datasets
    -            sub_data = data.where(data[best_feature] == value).dropna()
    -            
    -            #Call the ID3 algorithm for each of those sub_datasets with the new parameters --> Here the recursion comes in!
    -            subtree = ID3(sub_data,dataset,features,target_attribute_name,parent_node_class)
    -            
    -            #Add the sub tree, grown from the sub_dataset to the tree under the root node
    -            tree[best_feature][value] = subtree
    -            
    -        return(tree)    
    +        plt.xlabel(r"$x_1$", fontsize=18)
    +        plt.ylabel(r"$x_2$", fontsize=18, rotation=0)
    +    if legend:
    +        plt.legend(loc="lower right", fontsize=14)
    +plt.figure(figsize=(11, 4))
    +plt.subplot(121)
    +plot_decision_boundary(deep_tree_clf1, Xm, ym, axes=[-1.5, 2.5, -1, 1.5], iris=False)
    +plt.title("No restrictions", fontsize=16)
    +plt.subplot(122)
    +plot_decision_boundary(deep_tree_clf2, Xm, ym, axes=[-1.5, 2.5, -1, 1.5], iris=False)
    +plt.title("min_samples_leaf = {}".format(deep_tree_clf2.min_samples_leaf), fontsize=14)
    +plt.show()
     

    @@ -274,7 +252,7 @@ MathJax.Hub.Config({

  • 24
  • 25
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs016.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs016.html index 1e8c39de6..5d4fb0a2c 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs016.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs016.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,73 +157,29 @@ MathJax.Hub.Config({ -

    Back to moons again

    +

    Playing around with regions

    -

    from __future__ import division, print_function, unicode_literals
    +
    np.random.seed(6)
    +Xs = np.random.rand(100, 2) - 0.5
    +ys = (Xs[:, 0] > 0).astype(np.float32) * 2
     
    -# Common imports
    -import numpy as np
    -import os
    +angle = np.pi / 4
    +rotation_matrix = np.array([[np.cos(angle), -np.sin(angle)], [np.sin(angle), np.cos(angle)]])
    +Xsr = Xs.dot(rotation_matrix)
     
    -# to make this notebook's output stable across runs
    -np.random.seed(42)
    +tree_clf_s = DecisionTreeClassifier(random_state=42)
    +tree_clf_s.fit(Xs, ys)
    +tree_clf_sr = DecisionTreeClassifier(random_state=42)
    +tree_clf_sr.fit(Xsr, ys)
     
    -# To plot pretty figures
    -import matplotlib
    -import matplotlib.pyplot as plt
    -from matplotlib.colors import ListedColormap
    -plt.rcParams['axes.labelsize'] = 14
    -plt.rcParams['xtick.labelsize'] = 12
    -plt.rcParams['ytick.labelsize'] = 12
    -
    -
    -from sklearn.svm import SVC
    -from sklearn import datasets
    -from sklearn.tree import DecisionTreeClassifier
    -from sklearn.datasets import make_moons
    -from sklearn.tree import export_graphviz
    -
    -Xm, ym = make_moons(n_samples=100, noise=0.25, random_state=53)
    -
    -deep_tree_clf1 = DecisionTreeClassifier(random_state=42)
    -deep_tree_clf2 = DecisionTreeClassifier(min_samples_leaf=4, random_state=42)
    -deep_tree_clf1.fit(Xm, ym)
    -deep_tree_clf2.fit(Xm, ym)
    -
    -
    -def plot_decision_boundary(clf, X, y, axes=[0, 7.5, 0, 3], iris=True, legend=False, plot_training=True):
    -    x1s = np.linspace(axes[0], axes[1], 100)
    -    x2s = np.linspace(axes[2], axes[3], 100)
    -    x1, x2 = np.meshgrid(x1s, x2s)
    -    X_new = np.c_[x1.ravel(), x2.ravel()]
    -    y_pred = clf.predict(X_new).reshape(x1.shape)
    -    custom_cmap = ListedColormap(['#fafab0','#9898ff','#a0faa0'])
    -    plt.contourf(x1, x2, y_pred, alpha=0.3, cmap=custom_cmap)
    -    if not iris:
    -        custom_cmap2 = ListedColormap(['#7d7d58','#4c4c7f','#507d50'])
    -        plt.contour(x1, x2, y_pred, cmap=custom_cmap2, alpha=0.8)
    -    if plot_training:
    -        plt.plot(X[:, 0][y==0], X[:, 1][y==0], "yo", label="Iris-Setosa")
    -        plt.plot(X[:, 0][y==1], X[:, 1][y==1], "bs", label="Iris-Versicolor")
    -        plt.plot(X[:, 0][y==2], X[:, 1][y==2], "g^", label="Iris-Virginica")
    -        plt.axis(axes)
    -    if iris:
    -        plt.xlabel("Petal length", fontsize=14)
    -        plt.ylabel("Petal width", fontsize=14)
    -    else:
    -        plt.xlabel(r"$x_1$", fontsize=18)
    -        plt.ylabel(r"$x_2$", fontsize=18, rotation=0)
    -    if legend:
    -        plt.legend(loc="lower right", fontsize=14)
     plt.figure(figsize=(11, 4))
     plt.subplot(121)
    -plot_decision_boundary(deep_tree_clf1, Xm, ym, axes=[-1.5, 2.5, -1, 1.5], iris=False)
    -plt.title("No restrictions", fontsize=16)
    +plot_decision_boundary(tree_clf_s, Xs, ys, axes=[-0.7, 0.7, -0.7, 0.7], iris=False)
     plt.subplot(122)
    -plot_decision_boundary(deep_tree_clf2, Xm, ym, axes=[-1.5, 2.5, -1, 1.5], iris=False)
    -plt.title("min_samples_leaf = {}".format(deep_tree_clf2.min_samples_leaf), fontsize=14)
    +plot_decision_boundary(tree_clf_sr, Xsr, ys, axes=[-0.7, 0.7, -0.7, 0.7], iris=False)
    +
     plt.show()
     

    @@ -254,7 +208,7 @@ plt.show()

  • 25
  • 26
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs017.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs017.html index 3e9fe5cf7..ec193ce57 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs017.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs017.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,30 +157,24 @@ MathJax.Hub.Config({ -

    Playing around with regions

    +

    Regression trees

    -

    np.random.seed(6)
    -Xs = np.random.rand(100, 2) - 0.5
    -ys = (Xs[:, 0] > 0).astype(np.float32) * 2
    +
    # Quadratic training set + noise
    +np.random.seed(42)
    +m = 200
    +X = np.random.rand(m, 1)
    +y = 4 * (X - 0.5) ** 2
    +y = y + np.random.randn(m, 1) / 10
    +
    +

    -angle = np.pi / 4 -rotation_matrix = np.array([[np.cos(angle), -np.sin(angle)], [np.sin(angle), np.cos(angle)]]) -Xsr = Xs.dot(rotation_matrix) + +

    from sklearn.tree import DecisionTreeRegressor
     
    -tree_clf_s = DecisionTreeClassifier(random_state=42)
    -tree_clf_s.fit(Xs, ys)
    -tree_clf_sr = DecisionTreeClassifier(random_state=42)
    -tree_clf_sr.fit(Xsr, ys)
    -
    -plt.figure(figsize=(11, 4))
    -plt.subplot(121)
    -plot_decision_boundary(tree_clf_s, Xs, ys, axes=[-0.7, 0.7, -0.7, 0.7], iris=False)
    -plt.subplot(122)
    -plot_decision_boundary(tree_clf_sr, Xsr, ys, axes=[-0.7, 0.7, -0.7, 0.7], iris=False)
    -
    -plt.show()
    +tree_reg = DecisionTreeRegressor(max_depth=2, random_state=42)
    +tree_reg.fit(X, y)
     

    @@ -210,7 +202,7 @@ plt.show()

  • 26
  • 27
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs018.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs018.html index 384dd85f4..98b2ef9dd 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs018.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs018.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,24 +157,80 @@ MathJax.Hub.Config({ -

    Regression trees

    -

    - - -

    # Quadratic training set + noise
    -np.random.seed(42)
    -m = 200
    -X = np.random.rand(m, 1)
    -y = 4 * (X - 0.5) ** 2
    -y = y + np.random.randn(m, 1) / 10
    -
    +

    Final regressor code

    from sklearn.tree import DecisionTreeRegressor
     
    -tree_reg = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg.fit(X, y)
    +tree_reg1 = DecisionTreeRegressor(random_state=42, max_depth=2)
    +tree_reg2 = DecisionTreeRegressor(random_state=42, max_depth=3)
    +tree_reg1.fit(X, y)
    +tree_reg2.fit(X, y)
    +
    +def plot_regression_predictions(tree_reg, X, y, axes=[0, 1, -0.2, 1], ylabel="$y$"):
    +    x1 = np.linspace(axes[0], axes[1], 500).reshape(-1, 1)
    +    y_pred = tree_reg.predict(x1)
    +    plt.axis(axes)
    +    plt.xlabel("$x_1$", fontsize=18)
    +    if ylabel:
    +        plt.ylabel(ylabel, fontsize=18, rotation=0)
    +    plt.plot(X, y, "b.")
    +    plt.plot(x1, y_pred, "r.-", linewidth=2, label=r"$\hat{y}$")
    +
    +plt.figure(figsize=(11, 4))
    +plt.subplot(121)
    +plot_regression_predictions(tree_reg1, X, y)
    +for split, style in ((0.1973, "k-"), (0.0917, "k--"), (0.7718, "k--")):
    +    plt.plot([split, split], [-0.2, 1], style, linewidth=2)
    +plt.text(0.21, 0.65, "Depth=0", fontsize=15)
    +plt.text(0.01, 0.2, "Depth=1", fontsize=13)
    +plt.text(0.65, 0.8, "Depth=1", fontsize=13)
    +plt.legend(loc="upper center", fontsize=18)
    +plt.title("max_depth=2", fontsize=14)
    +
    +plt.subplot(122)
    +plot_regression_predictions(tree_reg2, X, y, ylabel=None)
    +for split, style in ((0.1973, "k-"), (0.0917, "k--"), (0.7718, "k--")):
    +    plt.plot([split, split], [-0.2, 1], style, linewidth=2)
    +for split in (0.0458, 0.1298, 0.2873, 0.9040):
    +    plt.plot([split, split], [-0.2, 1], "k:", linewidth=1)
    +plt.text(0.3, 0.5, "Depth=2", fontsize=13)
    +plt.title("max_depth=3", fontsize=14)
    +
    +plt.show()
    +
    +

    + + +

    tree_reg1 = DecisionTreeRegressor(random_state=42)
    +tree_reg2 = DecisionTreeRegressor(random_state=42, min_samples_leaf=10)
    +tree_reg1.fit(X, y)
    +tree_reg2.fit(X, y)
    +
    +x1 = np.linspace(0, 1, 500).reshape(-1, 1)
    +y_pred1 = tree_reg1.predict(x1)
    +y_pred2 = tree_reg2.predict(x1)
    +
    +plt.figure(figsize=(11, 4))
    +
    +plt.subplot(121)
    +plt.plot(X, y, "b.")
    +plt.plot(x1, y_pred1, "r.-", linewidth=2, label=r"$\hat{y}$")
    +plt.axis([0, 1, -0.2, 1.1])
    +plt.xlabel("$x_1$", fontsize=18)
    +plt.ylabel("$y$", fontsize=18, rotation=0)
    +plt.legend(loc="upper center", fontsize=18)
    +plt.title("No restrictions", fontsize=14)
    +
    +plt.subplot(122)
    +plt.plot(X, y, "b.")
    +plt.plot(x1, y_pred2, "r.-", linewidth=2, label=r"$\hat{y}$")
    +plt.axis([0, 1, -0.2, 1.1])
    +plt.xlabel("$x_1$", fontsize=18)
    +plt.title("min_samples_leaf={}".format(tree_reg2.min_samples_leaf), fontsize=14)
    +
    +plt.show()
     

    @@ -204,7 +258,7 @@ tree_reg.fit(X, y)

  • 27
  • 28
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs019.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs019.html index 85c978f0c..506826513 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs019.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs019.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,80 +157,30 @@ MathJax.Hub.Config({ -

    Final regressor code

    +

    Classification again: The zoo data

    -

    from sklearn.tree import DecisionTreeRegressor
    +
    import pandas as pd
    +import numpy as np
    +from pprint import pprint
    +from sklearn.tree import DecisionTreeClassifier
     
    -tree_reg1 = DecisionTreeRegressor(random_state=42, max_depth=2)
    -tree_reg2 = DecisionTreeRegressor(random_state=42, max_depth=3)
    -tree_reg1.fit(X, y)
    -tree_reg2.fit(X, y)
    -
    -def plot_regression_predictions(tree_reg, X, y, axes=[0, 1, -0.2, 1], ylabel="$y$"):
    -    x1 = np.linspace(axes[0], axes[1], 500).reshape(-1, 1)
    -    y_pred = tree_reg.predict(x1)
    -    plt.axis(axes)
    -    plt.xlabel("$x_1$", fontsize=18)
    -    if ylabel:
    -        plt.ylabel(ylabel, fontsize=18, rotation=0)
    -    plt.plot(X, y, "b.")
    -    plt.plot(x1, y_pred, "r.-", linewidth=2, label=r"$\hat{y}$")
    -
    -plt.figure(figsize=(11, 4))
    -plt.subplot(121)
    -plot_regression_predictions(tree_reg1, X, y)
    -for split, style in ((0.1973, "k-"), (0.0917, "k--"), (0.7718, "k--")):
    -    plt.plot([split, split], [-0.2, 1], style, linewidth=2)
    -plt.text(0.21, 0.65, "Depth=0", fontsize=15)
    -plt.text(0.01, 0.2, "Depth=1", fontsize=13)
    -plt.text(0.65, 0.8, "Depth=1", fontsize=13)
    -plt.legend(loc="upper center", fontsize=18)
    -plt.title("max_depth=2", fontsize=14)
    -
    -plt.subplot(122)
    -plot_regression_predictions(tree_reg2, X, y, ylabel=None)
    -for split, style in ((0.1973, "k-"), (0.0917, "k--"), (0.7718, "k--")):
    -    plt.plot([split, split], [-0.2, 1], style, linewidth=2)
    -for split in (0.0458, 0.1298, 0.2873, 0.9040):
    -    plt.plot([split, split], [-0.2, 1], "k:", linewidth=1)
    -plt.text(0.3, 0.5, "Depth=2", fontsize=13)
    -plt.title("max_depth=3", fontsize=14)
    -
    -plt.show()
    -
    -

    - - -

    tree_reg1 = DecisionTreeRegressor(random_state=42)
    -tree_reg2 = DecisionTreeRegressor(random_state=42, min_samples_leaf=10)
    -tree_reg1.fit(X, y)
    -tree_reg2.fit(X, y)
    -
    -x1 = np.linspace(0, 1, 500).reshape(-1, 1)
    -y_pred1 = tree_reg1.predict(x1)
    -y_pred2 = tree_reg2.predict(x1)
    -
    -plt.figure(figsize=(11, 4))
    -
    -plt.subplot(121)
    -plt.plot(X, y, "b.")
    -plt.plot(x1, y_pred1, "r.-", linewidth=2, label=r"$\hat{y}$")
    -plt.axis([0, 1, -0.2, 1.1])
    -plt.xlabel("$x_1$", fontsize=18)
    -plt.ylabel("$y$", fontsize=18, rotation=0)
    -plt.legend(loc="upper center", fontsize=18)
    -plt.title("No restrictions", fontsize=14)
    -
    -plt.subplot(122)
    -plt.plot(X, y, "b.")
    -plt.plot(x1, y_pred2, "r.-", linewidth=2, label=r"$\hat{y}$")
    -plt.axis([0, 1, -0.2, 1.1])
    -plt.xlabel("$x_1$", fontsize=18)
    -plt.title("min_samples_leaf={}".format(tree_reg2.min_samples_leaf), fontsize=14)
    -
    -plt.show()
    +#Import the dataset 
    +dataset = pd.read_csv('data/zoo.csv')
    +#We drop the animal names since this is not a good feature to split the data on
    +#dataset=dataset.drop('animal_name',axis=1)
    +#Split the data into a training and a testing set
    +train_features = dataset.iloc[:80,:-1]
    +test_features = dataset.iloc[80:,:-1]
    +train_targets = dataset.iloc[:80,-1]
    +test_targets = dataset.iloc[80:,-1]
    +#Train the model
    +tree = DecisionTreeClassifier(criterion = 'entropy').fit(train_features,train_targets)
    +#Predict the classes of new, unseen data
    +prediction = tree.predict(test_features)
    +#Check the accuracy
    +print("The prediction accuracy is: ",tree.score(test_features,test_targets)*100,"%")
     

    @@ -260,7 +208,7 @@ plt.show()

  • 28
  • 29
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs020.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs020.html index e686c925f..9ab46fe5c 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs020.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs020.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,32 +157,18 @@ MathJax.Hub.Config({ -

    Classification again: The zoo data

    -

    +

    Pros and cons of trees, pros

    - -
    import pandas as pd
    -import numpy as np
    -from pprint import pprint
    -from sklearn.tree import DecisionTreeClassifier
    +
      +
    • White box, easy to interpret model. Some people believe that decision trees more closely mirror human decision-making than do the regression and classification approaches discussed earlier (think of support vector machines)
    • +
    • Trees are very easy to explain to people. In fact, they are even easier to explain than linear regression!
    • +
    • No feature normalization needed
    • +
    • Tree models can handle both continuous and categorical data (Classification and Regression Trees)
    • +
    • Can model nonlinear relationships
    • +
    • Can model interactions between the different descriptive features
    • +
    • Trees can be displayed graphically, and are easily interpreted even by a non-expert (especially if they are small)
    • +
    -#Import the dataset -dataset = pd.read_csv('data/zoo.csv') -#We drop the animal names since this is not a good feature to split the data on -#dataset=dataset.drop('animal_name',axis=1) -#Split the data into a training and a testing set -train_features = dataset.iloc[:80,:-1] -test_features = dataset.iloc[80:,:-1] -train_targets = dataset.iloc[:80,-1] -test_targets = dataset.iloc[80:,-1] -#Train the model -tree = DecisionTreeClassifier(criterion = 'entropy').fit(train_features,train_targets) -#Predict the classes of new, unseen data -prediction = tree.predict(test_features) -#Check the accuracy -print("The prediction accuracy is: ",tree.score(test_features,test_targets)*100,"%") -
    -

      @@ -209,8 +193,6 @@ prediction = tree28
    • 29
    • 30
    • -
    • ...
    • -
    • 31
    • »
    diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs021.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs021.html index 5c1df2db5..6fc473476 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs021.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs021.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,18 +157,21 @@ MathJax.Hub.Config({ -

    Pros and cons of trees, pros

    +

    Disadvantages

      -
    • White box, easy to interpret model. Some people believe that decision trees more closely mirror human decision-making than do the regression and classification approaches discussed earlier (think of support vector machines)
    • -
    • Trees are very easy to explain to people. In fact, they are even easier to explain than linear regression!
    • -
    • No feature normalization needed
    • -
    • Tree models can handle both continuous and categorical data (Classification and Regression Trees)
    • -
    • Can model nonlinear relationships
    • -
    • Can model interactions between the different descriptive features
    • -
    • Trees can be displayed graphically, and are easily interpreted even by a non-expert (especially if they are small)
    • +
    • Unfortunately, trees generally do not have the same level of predictive accuracy as some of the other regression and classification approaches
    • +
    • If continuous features are used the tree may become quite large and hence less interpretable
    • +
    • Decision trees are prone to overfit the training data and hence do not well generalize the data if no stopping criteria or improvements like pruning, boosting or bagging are implemented
    • +
    • Small changes in the data may lead to a completely different tree. This issue can be addressed by using ensemble methods like bagging, boosting or random forests
    • +
    • Unbalanced datasets where some target feature values occur much more frequently than others may lead to biased trees since the frequently occurring feature values are preferred over the less frequently occurring ones.
    • +
    • If the number of features is relatively large (high dimensional) and the number of instances is relatively low, the tree might overfit the data
    • +
    • Features with many levels may be preferred over features with less levels since for them it is more easy to split the dataset such that the sub datasets only contain pure target feature values. This issue can be addressed by preferring for instance the information gain ratio as splitting criteria over information gain
    +However, by aggregating many decision trees, using methods like bagging, random forests, and boosting, the predictive performance of trees can be substantially improved. + +

      @@ -194,7 +195,6 @@ MathJax.Hub.Config({
    • 28
    • 29
    • 30
    • -
    • 31
    • »
    diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs022.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs022.html index c3c11825b..6772a27cd 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs022.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs022.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,19 +157,45 @@ MathJax.Hub.Config({ -

    Disadvantages

    +

    Bagging

    -
      -
    • Unfortunately, trees generally do not have the same level of predictive accuracy as some of the other regression and classification approaches
    • -
    • If continuous features are used the tree may become quite large and hence less interpretable
    • -
    • Decision trees are prone to overfit the training data and hence do not well generalize the data if no stopping criteria or improvements like pruning, boosting or bagging are implemented
    • -
    • Small changes in the data may lead to a completely different tree. This issue can be addressed by using ensemble methods like bagging, boosting or random forests
    • -
    • Unbalanced datasets where some target feature values occur much more frequently than others may lead to biased trees since the frequently occurring feature values are preferred over the less frequently occurring ones.
    • -
    • If the number of features is relatively large (high dimensional) and the number of instances is relatively low, the tree might overfit the data
    • -
    • Features with many levels may be preferred over features with less levels since for them it is more easy to split the dataset such that the sub datasets only contain pure target feature values. This issue can be addressed by preferring for instance the information gain ratio as splitting criteria over information gain
    • -
    +

    +The plain decision trees suffer from high +variance. This means that if we split the training data into two parts +at random, and fit a decision tree to both halves, the results that we +get could be quite different. In contrast, a procedure with low +variance will yield similar results if applied repeatedly to distinct +data sets; linear regression tends to have low variance, if the ratio +of \( n \) to \( p \) is moderately large. -However, by aggregating many decision trees, using methods like bagging, random forests, and boosting, the predictive performance of trees can be substantially improved. +

    +Bootstrap aggregation, or just bagging, is a +general-purpose procedure for reducing the variance of a statistical +learning method. + +

    +Bagging typically results in improved accuracy +over prediction using a single tree. Unfortunately, however, it can be +difficult to interpret the resulting model. Recall that one of the +advantages of decision trees is the attractive and easily interpreted +diagram that results. + +

    +However, when we bag a large number of trees, it is no longer +possible to represent the resulting statistical learning procedure +using a single tree, and it is no longer clear which variables are +most important to the procedure. Thus, bagging improves prediction +accuracy at the expense of interpretability. Although the collection +of bagged trees is much more difficult to interpret than a single +tree, one can obtain an overall summary of the importance of each +predictor using the MSE (for bagging regression trees) or the Gini +index (for bagging classification trees). In the case of bagging +regression trees, we can record the total amount that the MSE is +decreased due to splits over a given predictor, averaged over all \( B \) possible +trees. A large value indicates an important predictor. Similarly, in +the context of bagging classification trees, we can add up the total +amount that the Gini index is decreased by splits over a given +predictor, averaged over all \( B \) trees.

    @@ -196,7 +220,6 @@ However, by aggregating many decision trees, using methods like bagging, random

  • 28
  • 29
  • 30
  • -
  • 31
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs023.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs023.html index 0901345dd..25c3b3946 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs023.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs023.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,46 +157,23 @@ MathJax.Hub.Config({ -

    Bagging

    - +

    Simple example, head or tail

    -The plain decision trees suffer from high -variance. This means that if we split the training data into two parts -at random, and fit a decision tree to both halves, the results that we -get could be quite different. In contrast, a procedure with low -variance will yield similar results if applied repeatedly to distinct -data sets; linear regression tends to have low variance, if the ratio -of \( n \) to \( p \) is moderately large. - -

    -Bootstrap aggregation, or just bagging, is a -general-purpose procedure for reducing the variance of a statistical -learning method. - -

    -Bagging typically results in improved accuracy -over prediction using a single tree. Unfortunately, however, it can be -difficult to interpret the resulting model. Recall that one of the -advantages of decision trees is the attractive and easily interpreted -diagram that results. - -

    -However, when we bag a large number of trees, it is no longer -possible to represent the resulting statistical learning procedure -using a single tree, and it is no longer clear which variables are -most important to the procedure. Thus, bagging improves prediction -accuracy at the expense of interpretability. Although the collection -of bagged trees is much more difficult to interpret than a single -tree, one can obtain an overall summary of the importance of each -predictor using the MSE (for bagging regression trees) or the Gini -index (for bagging classification trees). In the case of bagging -regression trees, we can record the total amount that the MSE is -decreased due to splits over a given predictor, averaged over all \( B \) possible -trees. A large value indicates an important predictor. Similarly, in -the context of bagging classification trees, we can add up the total -amount that the Gini index is decreased by splits over a given -predictor, averaged over all \( B \) trees. + +

    heads_proba = 0.51
    +coin_tosses = (np.random.rand(10000, 10) < heads_proba).astype(np.int32)
    +cumulative_heads_ratio = np.cumsum(coin_tosses, axis=0) / np.arange(1, 10001).reshape(-1, 1)
    +plt.figure(figsize=(8,3.5))
    +plt.plot(cumulative_heads_ratio)
    +plt.plot([0, 10000], [0.51, 0.51], "k--", linewidth=2, label="51%")
    +plt.plot([0, 10000], [0.5, 0.5], "k-", label="50%")
    +plt.xlabel("Number of coin tosses")
    +plt.ylabel("Heads ratio")
    +plt.legend(loc="lower right")
    +plt.axis([0, 10000, 0.42, 0.58])
    +plt.show()
    +

    @@ -221,7 +196,6 @@ predictor, averaged over all \( B \) trees.

  • 28
  • 29
  • 30
  • -
  • 31
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs024.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs024.html index e48d86a0a..cd6c1a0b1 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs024.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs024.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,23 +157,45 @@ MathJax.Hub.Config({ -

    Simple example, head or tail

    -

    +

    Random forests

    + +

    +Random forests provide an improvement over bagged trees by way of a +small tweak that decorrelates the trees. + +

    +As in bagging, we build a +number of decision trees on bootstrapped training samples. But when +building these decision trees, each time a split in a tree is +considered, a random sample of \( m \) predictors is chosen as split +candidates from the full set of \( p \) predictors. The split is allowed to +use only one of those \( m \) predictors. + +

    +A fresh sample of \( m \) predictors is +taken at each split, and typically we choose +$$ +m\approx \sqrt{p}. +$$ + +In building a random forest, at +each split in the tree, the algorithm is not even allowed to consider +a majority of the available predictors. + +

    +The reason for this is rather clever. Suppose that there is one very +strong predictor in the data set, along with a number of other +moderately strong predictors. Then in the collection of bagged +variable importance random forest trees, most or all of the trees will +use this strong predictor in the top split. Consequently, all of the +bagged trees will look quite similar to each other. Hence the +predictions from the bagged trees will be highly correlated. +Unfortunately, averaging many highly correlated quantities does not lead +to as large of a reduction in variance as averaging many uncorrelated +quanti- ties. In particular, this means that bagging will not lead to +a substantial reduction in variance over a single tree in this +setting. - -

    heads_proba = 0.51
    -coin_tosses = (np.random.rand(10000, 10) < heads_proba).astype(np.int32)
    -cumulative_heads_ratio = np.cumsum(coin_tosses, axis=0) / np.arange(1, 10001).reshape(-1, 1)
    -plt.figure(figsize=(8,3.5))
    -plt.plot(cumulative_heads_ratio)
    -plt.plot([0, 10000], [0.51, 0.51], "k--", linewidth=2, label="51%")
    -plt.plot([0, 10000], [0.5, 0.5], "k-", label="50%")
    -plt.xlabel("Number of coin tosses")
    -plt.ylabel("Heads ratio")
    -plt.legend(loc="lower right")
    -plt.axis([0, 10000, 0.42, 0.58])
    -plt.show()
    -

    @@ -197,7 +217,6 @@ plt.show()

  • 28
  • 29
  • 30
  • -
  • 31
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs025.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs025.html index f4e0333bf..2cd89ccce 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs025.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs025.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,45 +157,21 @@ MathJax.Hub.Config({ -

    Random forests

    - +

    A simple scikit-learn example

    -Random forests provide an improvement over bagged trees by way of a -small tweak that decorrelates the trees. - -

    -As in bagging, we build a -number of decision trees on bootstrapped training samples. But when -building these decision trees, each time a split in a tree is -considered, a random sample of \( m \) predictors is chosen as split -candidates from the full set of \( p \) predictors. The split is allowed to -use only one of those \( m \) predictors. - -

    -A fresh sample of \( m \) predictors is -taken at each split, and typically we choose -$$ -m\approx \sqrt{p}. -$$ - -In building a random forest, at -each split in the tree, the algorithm is not even allowed to consider -a majority of the available predictors. - -

    -The reason for this is rather clever. Suppose that there is one very -strong predictor in the data set, along with a number of other -moderately strong predictors. Then in the collection of bagged -variable importance random forest trees, most or all of the trees will -use this strong predictor in the top split. Consequently, all of the -bagged trees will look quite similar to each other. Hence the -predictions from the bagged trees will be highly correlated. -Unfortunately, averaging many highly correlated quantities does not lead -to as large of a reduction in variance as averaging many uncorrelated -quanti- ties. In particular, this means that bagging will not lead to -a substantial reduction in variance over a single tree in this -setting. + +

    from sklearn.ensemble import RandomForestClassifier
    +from sklearn.preprocessing import LabelEncoder
    +from sklearn.model_selection import cross_validate
    +# Data set not specificied
    +X = dataset.XXX
    +Y = dataset.YYY
    +#Instantiate the model with 100 trees and entropy as splitting criteria
    +Random_Forest_model = RandomForestClassifier(n_estimators=100,criterion="entropy")
    +#Cross validation
    +accuracy = cross_validate(Random_Forest_model,X,Y,cv=10)['test_score']
    +

    @@ -218,7 +192,6 @@ setting.

  • 28
  • 29
  • 30
  • -
  • 31
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs026.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs026.html index 3f9a1e3f6..ab42056d9 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs026.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs026.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,20 +157,60 @@ MathJax.Hub.Config({ -

    A simple scikit-learn example

    +

    Please, not the moons again!

    -

    from sklearn.ensemble import RandomForestClassifier
    -from sklearn.preprocessing import LabelEncoder
    -from sklearn.model_selection import cross_validate
    -# Data set not specificied
    -X = dataset.XXX
    -Y = dataset.YYY
    -#Instantiate the model with 100 trees and entropy as splitting criteria
    -Random_Forest_model = RandomForestClassifier(n_estimators=100,criterion="entropy")
    -#Cross validation
    -accuracy = cross_validate(Random_Forest_model,X,Y,cv=10)['test_score']
    +
    from sklearn.model_selection import train_test_split
    +from sklearn.datasets import make_moons
    +
    +X, y = make_moons(n_samples=500, noise=0.30, random_state=42)
    +X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42)
    +from sklearn.ensemble import RandomForestClassifier
    +from sklearn.ensemble import VotingClassifier
    +from sklearn.linear_model import LogisticRegression
    +from sklearn.svm import SVC
    +
    +log_clf = LogisticRegression(random_state=42)
    +rnd_clf = RandomForestClassifier(random_state=42)
    +svm_clf = SVC(random_state=42)
    +
    +voting_clf = VotingClassifier(
    +    estimators=[('lr', log_clf), ('rf', rnd_clf), ('svc', svm_clf)],
    +    voting='hard')
    +voting_clf.fit(X_train, y_train)
    +
    +

    + + +

    from sklearn.metrics import accuracy_score
    +
    +for clf in (log_clf, rnd_clf, svm_clf, voting_clf):
    +    clf.fit(X_train, y_train)
    +    y_pred = clf.predict(X_test)
    +    print(clf.__class__.__name__, accuracy_score(y_test, y_pred))
    +
    +

    + + +

    log_clf = LogisticRegression(random_state=42)
    +rnd_clf = RandomForestClassifier(random_state=42)
    +svm_clf = SVC(probability=True, random_state=42)
    +
    +voting_clf = VotingClassifier(
    +    estimators=[('lr', log_clf), ('rf', rnd_clf), ('svc', svm_clf)],
    +    voting='soft')
    +voting_clf.fit(X_train, y_train)
    +
    +

    + + +

    from sklearn.metrics import accuracy_score
    +
    +for clf in (log_clf, rnd_clf, svm_clf, voting_clf):
    +    clf.fit(X_train, y_train)
    +    y_pred = clf.predict(X_test)
    +    print(clf.__class__.__name__, accuracy_score(y_test, y_pred))
     

    @@ -193,7 +231,6 @@ accuracy = cross_validate(Random_Forest_mode

  • 28
  • 29
  • 30
  • -
  • 31
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs027.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs027.html index 752824988..0b8137717 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs027.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs027.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,60 +157,63 @@ MathJax.Hub.Config({ -

    Please, not the moons again!

    +

    Bagging examples

    +

    -

    from sklearn.model_selection import train_test_split
    -from sklearn.datasets import make_moons
    +
    from sklearn.ensemble import BaggingClassifier
    +from sklearn.tree import DecisionTreeClassifier
     
    -X, y = make_moons(n_samples=500, noise=0.30, random_state=42)
    -X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42)
    -from sklearn.ensemble import RandomForestClassifier
    -from sklearn.ensemble import VotingClassifier
    -from sklearn.linear_model import LogisticRegression
    -from sklearn.svm import SVC
    -
    -log_clf = LogisticRegression(random_state=42)
    -rnd_clf = RandomForestClassifier(random_state=42)
    -svm_clf = SVC(random_state=42)
    -
    -voting_clf = VotingClassifier(
    -    estimators=[('lr', log_clf), ('rf', rnd_clf), ('svc', svm_clf)],
    -    voting='hard')
    -voting_clf.fit(X_train, y_train)
    +bag_clf = BaggingClassifier(
    +    DecisionTreeClassifier(random_state=42), n_estimators=500,
    +    max_samples=100, bootstrap=True, n_jobs=-1, random_state=42)
    +bag_clf.fit(X_train, y_train)
    +y_pred = bag_clf.predict(X_test)
     

    from sklearn.metrics import accuracy_score
    -
    -for clf in (log_clf, rnd_clf, svm_clf, voting_clf):
    -    clf.fit(X_train, y_train)
    -    y_pred = clf.predict(X_test)
    -    print(clf.__class__.__name__, accuracy_score(y_test, y_pred))
    +print(accuracy_score(y_test, y_pred))
     

    -

    log_clf = LogisticRegression(random_state=42)
    -rnd_clf = RandomForestClassifier(random_state=42)
    -svm_clf = SVC(probability=True, random_state=42)
    -
    -voting_clf = VotingClassifier(
    -    estimators=[('lr', log_clf), ('rf', rnd_clf), ('svc', svm_clf)],
    -    voting='soft')
    -voting_clf.fit(X_train, y_train)
    +
    tree_clf = DecisionTreeClassifier(random_state=42)
    +tree_clf.fit(X_train, y_train)
    +y_pred_tree = tree_clf.predict(X_test)
    +print(accuracy_score(y_test, y_pred_tree))
     

    -

    from sklearn.metrics import accuracy_score
    +
    from matplotlib.colors import ListedColormap
     
    -for clf in (log_clf, rnd_clf, svm_clf, voting_clf):
    -    clf.fit(X_train, y_train)
    -    y_pred = clf.predict(X_test)
    -    print(clf.__class__.__name__, accuracy_score(y_test, y_pred))
    +def plot_decision_boundary(clf, X, y, axes=[-1.5, 2.5, -1, 1.5], alpha=0.5, contour=True):
    +    x1s = np.linspace(axes[0], axes[1], 100)
    +    x2s = np.linspace(axes[2], axes[3], 100)
    +    x1, x2 = np.meshgrid(x1s, x2s)
    +    X_new = np.c_[x1.ravel(), x2.ravel()]
    +    y_pred = clf.predict(X_new).reshape(x1.shape)
    +    custom_cmap = ListedColormap(['#fafab0','#9898ff','#a0faa0'])
    +    plt.contourf(x1, x2, y_pred, alpha=0.3, cmap=custom_cmap)
    +    if contour:
    +        custom_cmap2 = ListedColormap(['#7d7d58','#4c4c7f','#507d50'])
    +        plt.contour(x1, x2, y_pred, cmap=custom_cmap2, alpha=0.8)
    +    plt.plot(X[:, 0][y==0], X[:, 1][y==0], "yo", alpha=alpha)
    +    plt.plot(X[:, 0][y==1], X[:, 1][y==1], "bs", alpha=alpha)
    +    plt.axis(axes)
    +    plt.xlabel(r"$x_1$", fontsize=18)
    +    plt.ylabel(r"$x_2$", fontsize=18, rotation=0)
    +plt.figure(figsize=(11,4))
    +plt.subplot(121)
    +plot_decision_boundary(tree_clf, X, y)
    +plt.title("Decision Tree", fontsize=14)
    +plt.subplot(122)
    +plot_decision_boundary(bag_clf, X, y)
    +plt.title("Decision Trees with Bagging", fontsize=14)
    +plt.show()
     

    @@ -232,7 +233,6 @@ voting_clf.fit(X_train, y_train)

  • 28
  • 29
  • 30
  • -
  • 31
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs028.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs028.html index deda392b9..806ee8294 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs028.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs028.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -159,63 +157,24 @@ MathJax.Hub.Config({ -

    Bagging examples

    - +

    Then random forests

    -

    from sklearn.ensemble import BaggingClassifier
    -from sklearn.tree import DecisionTreeClassifier
    +
    bag_clf = BaggingClassifier(
    +    DecisionTreeClassifier(splitter="random", max_leaf_nodes=16, random_state=42),
    +    n_estimators=500, max_samples=1.0, bootstrap=True, n_jobs=-1, random_state=42)
    +
    +

    -bag_clf = BaggingClassifier( - DecisionTreeClassifier(random_state=42), n_estimators=500, - max_samples=100, bootstrap=True, n_jobs=-1, random_state=42) -bag_clf.fit(X_train, y_train) + +

    bag_clf.fit(X_train, y_train)
     y_pred = bag_clf.predict(X_test)
    -
    -

    - - -

    from sklearn.metrics import accuracy_score
    -print(accuracy_score(y_test, y_pred))
    -
    -

    - - -

    tree_clf = DecisionTreeClassifier(random_state=42)
    -tree_clf.fit(X_train, y_train)
    -y_pred_tree = tree_clf.predict(X_test)
    -print(accuracy_score(y_test, y_pred_tree))
    -
    -

    - - -

    from matplotlib.colors import ListedColormap
    -
    -def plot_decision_boundary(clf, X, y, axes=[-1.5, 2.5, -1, 1.5], alpha=0.5, contour=True):
    -    x1s = np.linspace(axes[0], axes[1], 100)
    -    x2s = np.linspace(axes[2], axes[3], 100)
    -    x1, x2 = np.meshgrid(x1s, x2s)
    -    X_new = np.c_[x1.ravel(), x2.ravel()]
    -    y_pred = clf.predict(X_new).reshape(x1.shape)
    -    custom_cmap = ListedColormap(['#fafab0','#9898ff','#a0faa0'])
    -    plt.contourf(x1, x2, y_pred, alpha=0.3, cmap=custom_cmap)
    -    if contour:
    -        custom_cmap2 = ListedColormap(['#7d7d58','#4c4c7f','#507d50'])
    -        plt.contour(x1, x2, y_pred, cmap=custom_cmap2, alpha=0.8)
    -    plt.plot(X[:, 0][y==0], X[:, 1][y==0], "yo", alpha=alpha)
    -    plt.plot(X[:, 0][y==1], X[:, 1][y==1], "bs", alpha=alpha)
    -    plt.axis(axes)
    -    plt.xlabel(r"$x_1$", fontsize=18)
    -    plt.ylabel(r"$x_2$", fontsize=18, rotation=0)
    -plt.figure(figsize=(11,4))
    -plt.subplot(121)
    -plot_decision_boundary(tree_clf, X, y)
    -plt.title("Decision Tree", fontsize=14)
    -plt.subplot(122)
    -plot_decision_boundary(bag_clf, X, y)
    -plt.title("Decision Trees with Bagging", fontsize=14)
    -plt.show()
    +from sklearn.ensemble import RandomForestClassifier
    +rnd_clf = RandomForestClassifier(n_estimators=500, max_leaf_nodes=16, n_jobs=-1, random_state=42)
    +rnd_clf.fit(X_train, y_train)
    +y_pred_rf = rnd_clf.predict(X_test)
    +np.sum(y_pred == y_pred_rf) / len(y_pred) 
     

    @@ -234,7 +193,6 @@ plt.show()

  • 28
  • 29
  • 30
  • -
  • 31
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs029.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs029.html index 6967b3f16..b2684c0b1 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs029.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs029.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -157,28 +155,13 @@ MathJax.Hub.Config({

     

     

     

    - + + +

    Boosting and more

    +More material to come here. -

    Then random forests

    - -

    bag_clf = BaggingClassifier(
    -    DecisionTreeClassifier(splitter="random", max_leaf_nodes=16, random_state=42),
    -    n_estimators=500, max_samples=1.0, bootstrap=True, n_jobs=-1, random_state=42)
    -
    -

    - - -

    bag_clf.fit(X_train, y_train)
    -y_pred = bag_clf.predict(X_test)
    -from sklearn.ensemble import RandomForestClassifier
    -rnd_clf = RandomForestClassifier(n_estimators=500, max_leaf_nodes=16, n_jobs=-1, random_state=42)
    -rnd_clf.fit(X_train, y_train)
    -y_pred_rf = rnd_clf.predict(X_test)
    -np.sum(y_pred == y_pred_rf) / len(y_pred) 
    -
    -

      @@ -194,8 +177,6 @@ np.sum(y_pred =
    • 28
    • 29
    • 30
    • -
    • 31
    • -
    • »
    diff --git a/doc/pub/DecisionTrees/html/DecisionTrees-bs.html b/doc/pub/DecisionTrees/html/DecisionTrees-bs.html index f6d45fa73..a0cf685f0 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees-bs.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees-bs.html @@ -44,39 +44,38 @@ Automatically generated HTML file from DocOnce source 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -117,33 +116,32 @@ MathJax.Hub.Config({
  • Decision trees, overarching aims
  • How do we set it up?
  • Decision trees and Regression
  • -
  • Maxwell-Boltzmann velocity distribution
  • -
  • Building a tree, regression
  • -
  • A top-down approach, recursive binary splitting
  • -
  • Making a tree
  • -
  • Pruning the tree
  • -
  • Cost complexity pruning
  • -
  • A schematic procedure
  • -
  • A classification tree
  • -
  • Growing a classification tree
  • -
  • Classification tree, how to split nodes
  • -
  • Entropy and the ID3 algorithm
  • -
  • Writing your own code for a classification tree
  • -
  • Back to moons again
  • -
  • Playing around with regions
  • -
  • Regression trees
  • -
  • Final regressor code
  • -
  • Classification again: The zoo data
  • -
  • Pros and cons of trees, pros
  • -
  • Disadvantages
  • -
  • Bagging
  • -
  • Simple example, head or tail
  • -
  • Random forests
  • -
  • A simple scikit-learn example
  • -
  • Please, not the moons again!
  • -
  • Bagging examples
  • -
  • Then random forests
  • -
  • Boosting and more
  • +
  • Building a tree, regression
  • +
  • A top-down approach, recursive binary splitting
  • +
  • Making a tree
  • +
  • Pruning the tree
  • +
  • Cost complexity pruning
  • +
  • A schematic procedure
  • +
  • A classification tree
  • +
  • Growing a classification tree
  • +
  • Classification tree, how to split nodes
  • +
  • Entropy and the ID3 algorithm
  • +
  • Writing your own code for a classification tree
  • +
  • Back to moons again
  • +
  • Playing around with regions
  • +
  • Regression trees
  • +
  • Final regressor code
  • +
  • Classification again: The zoo data
  • +
  • Pros and cons of trees, pros
  • +
  • Disadvantages
  • +
  • Bagging
  • +
  • Simple example, head or tail
  • +
  • Random forests
  • +
  • A simple scikit-learn example
  • +
  • Please, not the moons again!
  • +
  • Bagging examples
  • +
  • Then random forests
  • +
  • Boosting and more
  • @@ -178,7 +176,7 @@ MathJax.Hub.Config({
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

    -

    Dec 17, 2018

    +

    Oct 24, 2019


    @@ -202,7 +200,7 @@ MathJax.Hub.Config({

  • 9
  • 10
  • ...
  • -
  • 31
  • +
  • 30
  • »
  • @@ -220,7 +218,7 @@ MathJax.Hub.Config({
    - © 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license + © 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
    diff --git a/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html b/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html index 61ecf6b6a..3cd494223 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html @@ -148,12 +148,12 @@ MathJax.Hub.Config({
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

     
    -

    Dec 17, 2018

    +

    Oct 24, 2019


    - © 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license + © 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
    @@ -309,109 +309,7 @@ plt.show()
    -

    Maxwell-Boltzmann velocity distribution

    - -

    - - -

    # Program to test the Metropolis algorithm with one particle at given temp in
    -# one dimension
    -#!/usr/bin/env python
    -import numpy as np
    -import matplotlib.mlab as mlab
    -import matplotlib.pyplot as plt
    -import random
    -from math import sqrt, exp, log
    -from sklearn.preprocessing import PolynomialFeatures
    -from sklearn.linear_model import LinearRegression
    -# initialize the rng with a seed
    -random.seed()
    -# Hard coding of input parameters
    -MCcycles = 100000
    -Temperature = 2.0
    -beta = 1./Temperature
    -InitialVelocity = -2.0
    -CurrentVelocity = InitialVelocity
    -Energy = 0.5*InitialVelocity*InitialVelocity
    -VelocityRange = 10*sqrt(Temperature)
    -VelocityStep = 2*VelocityRange/10.
    -AverageEnergy = Energy
    -AverageEnergy2 = Energy*Energy
    -VelocityValues = np.zeros(MCcycles)
    -# The Monte Carlo sampling with Metropolis starts here
    -for i in range (1, MCcycles, 1):
    -    TrialVelocity = CurrentVelocity + (2.0*random.random() - 1.0)*VelocityStep
    -    EnergyChange = 0.5*(TrialVelocity*TrialVelocity -CurrentVelocity*CurrentVelocity);
    -    if random.random() <= exp(-beta*EnergyChange):
    -        CurrentVelocity = TrialVelocity
    -        Energy += EnergyChange
    -        VelocityValues[i] = CurrentVelocity
    -    AverageEnergy += Energy
    -    AverageEnergy2 += Energy*Energy
    -#Final averages
    -AverageEnergy = AverageEnergy/MCcycles
    -AverageEnergy2 = AverageEnergy2/MCcycles
    -Variance = AverageEnergy2 - AverageEnergy*AverageEnergy
    -print(AverageEnergy, Variance)
    -n, bins, patches = plt.hist(VelocityValues, 400, facecolor='green')
    -
    -plt.xlabel('$v$')
    -plt.ylabel('Velocity distribution P(v)')
    -plt.title(r'Velocity histogram at $k_BT=2$')
    -plt.axis([-5, 5, 0, 600])
    -plt.grid(True)
    -from collections import Counter
    -
    -#print (Counter(VelocityValues))
    -
    -print (VelocityValues[:20])
    -VelocityValues=list(Counter(VelocityValues).keys())
    -d=list(Counter(VelocityValues).values())
    -
    -VelocityValues=np.asarray(VelocityValues)[:, np.newaxis]
    -d=np.asarray(d)
    -print (VelocityValues.shape, d.shape)
    -
    -plt.scatter(VelocityValues, d)
    -plt.show()
    -
    -#2nd Degree Polynomial
    -poly_feat=PolynomialFeatures(degree=20, include_bias=False)
    -X_poly=poly_feat.fit_transform(VelocityValues)
    -lin_reg=LinearRegression()
    -poly_fit=lin_reg.fit(X_poly,d)
    -
    -y_plot=poly_fit.predict(X_poly)
    -plt.title("Polynomial Fit")
    -plt.plot(VelocityValues, y_plot, color='black', label="Fit")
    -plt.show()
    -
    -#Decision Trees
    -
    -from sklearn.tree import DecisionTreeRegressor
    -regr_1=DecisionTreeRegressor(max_depth=2)
    -regr_2=DecisionTreeRegressor(max_depth=5)
    -regr_3=DecisionTreeRegressor(max_depth=7)
    -regr_1.fit(VelocityValues, d)
    -regr_2.fit(VelocityValues, d)
    -regr_3.fit(VelocityValues, d)
    -
    -X_test = np.arange(0.0, MCcycles, 0.01)[:, np.newaxis]
    -y_1=regr_1.predict(X_test)
    -y_2=regr_2.predict(X_test)
    -y_3=regr_3.predict(X_test)
    -
    -plt.title("Decision Tree")
    -plt.plot(X_test, y_1, color="red", label="max_depth=2", linewidth=2)
    -plt.plot(X_test, y_2, color="green", label="max_depth=5", linewidth=2)
    -plt.plot(X_test, y_3, color="m", label="max_depth=7", linewidth=2)
    -plt.show()
    -
    -
    - - -
    -

    Building a tree, regression

    +

    Building a tree, regression

    There are mainly two steps @@ -447,7 +345,7 @@ box.

    -

    A top-down approach, recursive binary splitting

    +

    A top-down approach, recursive binary splitting

    Unfortunately, it is computationally infeasible to consider every @@ -466,7 +364,7 @@ better tree in some future step.

    -

    Making a tree

    +

    Making a tree

    In order to implement the recursive binary splitting we start by selecting @@ -519,7 +417,7 @@ region contains more than five observations.

    -

    Pruning the tree

    +

    Pruning the tree

    The above procedure is rather straightforward, but leads often to @@ -538,7 +436,7 @@ parameter \( \alpha \).

    -

    Cost complexity pruning

    +

    Cost complexity pruning

    For each value of \( \alpha \) there corresponds a subtree \( T \in T_0 \) such that

     
    $$ @@ -571,7 +469,7 @@ subtree corresponding to \( \alpha \).

    -

    A schematic procedure

    +

    A schematic procedure

    @@ -596,7 +494,7 @@ subtree corresponding to \( \alpha \).
    -

    A classification tree

    +

    A classification tree

    A classification tree is very similar to a regression tree, except @@ -615,7 +513,7 @@ fall into that region.

    -

    Growing a classification tree

    +

    Growing a classification tree

    The task of growing a @@ -639,7 +537,7 @@ than is the classification error rate.

    -

    Classification tree, how to split nodes

    +

    Classification tree, how to split nodes

    If our targets are the outcome of a classification process that takes for example \( k=1,2,\dots,K \) values, the only thing we need to think of is to set up the splitting criteria for each node. @@ -686,12 +584,15 @@ $$
    -

    Entropy and the ID3 algorithm

    +

    Entropy and the ID3 algorithm

    + +

    +More text to come here.

    -

    Writing your own code for a classification tree

    +

    Writing your own code for a classification tree

    @@ -784,7 +685,7 @@ $$

    -

    Back to moons again

    +

    Back to moons again

    @@ -857,7 +758,7 @@ plt.show()

    -

    Playing around with regions

    +

    Playing around with regions

    @@ -886,7 +787,7 @@ plt.show()

    -

    Regression trees

    +

    Regression trees

    @@ -909,7 +810,7 @@ tree_reg.fit(X, y)

    -

    Final regressor code

    +

    Final regressor code

    @@ -988,7 +889,7 @@ plt.show()

    -

    Classification again: The zoo data

    +

    Classification again: The zoo data

    @@ -1017,7 +918,7 @@ prediction = tree.predict(test_features)

    -

    Pros and cons of trees, pros

    +

    Pros and cons of trees, pros

    • White box, easy to interpret model. Some people believe that decision trees more closely mirror human decision-making than do the regression and classification approaches discussed earlier (think of support vector machines)
    • @@ -1032,7 +933,7 @@ prediction = tree.predict(test_features)
      -

      Disadvantages

      +

      Disadvantages

      • Unfortunately, trees generally do not have the same level of predictive accuracy as some of the other regression and classification approaches
      • @@ -1050,7 +951,7 @@ However, by aggregating many decision trees, using methods like bagging, random
        -

        Bagging

        +

        Bagging

        The plain decision trees suffer from high @@ -1093,7 +994,7 @@ predictor, averaged over all \( B \) trees.

        -

        Simple example, head or tail

        +

        Simple example, head or tail

        @@ -1114,7 +1015,7 @@ plt.show()

        -

        Random forests

        +

        Random forests

        Random forests provide an improvement over bagged trees by way of a @@ -1158,7 +1059,7 @@ setting.

        -

        A simple scikit-learn example

        +

        A simple scikit-learn example

        @@ -1177,7 +1078,7 @@ accuracy = cross_validate(Random_Forest_model,X,Y,cv=Please, not the moons again! +

        Please, not the moons again!

        @@ -1236,7 +1137,7 @@ voting_clf.fit(X_train, y_train)

        -

        Bagging examples

        +

        Bagging examples

        @@ -1298,7 +1199,7 @@ plt.show()

        -

        Then random forests

        +

        Then random forests

        @@ -1321,7 +1222,7 @@ np.sum(y_pred == y_pred_rf) / len(y_pred)

        -

        Boosting and more

        +

        Boosting and more

        More material to come here.
        diff --git a/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html b/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html index 996c64b27..47508df7b 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html @@ -64,39 +64,38 @@ div { text-align: justify; text-justify: inter-word; } 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -138,7 +137,7 @@ MathJax.Hub.Config({
        [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

        -

        Dec 17, 2018

        +

        Oct 24, 2019












        @@ -291,108 +290,7 @@ plt.show()











        -

        Maxwell-Boltzmann velocity distribution

        - -

        - - -

        # Program to test the Metropolis algorithm with one particle at given temp in
        -# one dimension
        -#!/usr/bin/env python
        -import numpy as np
        -import matplotlib.mlab as mlab
        -import matplotlib.pyplot as plt
        -import random
        -from math import sqrt, exp, log
        -from sklearn.preprocessing import PolynomialFeatures
        -from sklearn.linear_model import LinearRegression
        -# initialize the rng with a seed
        -random.seed()
        -# Hard coding of input parameters
        -MCcycles = 100000
        -Temperature = 2.0
        -beta = 1./Temperature
        -InitialVelocity = -2.0
        -CurrentVelocity = InitialVelocity
        -Energy = 0.5*InitialVelocity*InitialVelocity
        -VelocityRange = 10*sqrt(Temperature)
        -VelocityStep = 2*VelocityRange/10.
        -AverageEnergy = Energy
        -AverageEnergy2 = Energy*Energy
        -VelocityValues = np.zeros(MCcycles)
        -# The Monte Carlo sampling with Metropolis starts here
        -for i in range (1, MCcycles, 1):
        -    TrialVelocity = CurrentVelocity + (2.0*random.random() - 1.0)*VelocityStep
        -    EnergyChange = 0.5*(TrialVelocity*TrialVelocity -CurrentVelocity*CurrentVelocity);
        -    if random.random() <= exp(-beta*EnergyChange):
        -        CurrentVelocity = TrialVelocity
        -        Energy += EnergyChange
        -        VelocityValues[i] = CurrentVelocity
        -    AverageEnergy += Energy
        -    AverageEnergy2 += Energy*Energy
        -#Final averages
        -AverageEnergy = AverageEnergy/MCcycles
        -AverageEnergy2 = AverageEnergy2/MCcycles
        -Variance = AverageEnergy2 - AverageEnergy*AverageEnergy
        -print(AverageEnergy, Variance)
        -n, bins, patches = plt.hist(VelocityValues, 400, facecolor='green')
        -
        -plt.xlabel('$v$')
        -plt.ylabel('Velocity distribution P(v)')
        -plt.title(r'Velocity histogram at $k_BT=2$')
        -plt.axis([-5, 5, 0, 600])
        -plt.grid(True)
        -from collections import Counter
        -
        -#print (Counter(VelocityValues))
        -
        -print (VelocityValues[:20])
        -VelocityValues=list(Counter(VelocityValues).keys())
        -d=list(Counter(VelocityValues).values())
        -
        -VelocityValues=np.asarray(VelocityValues)[:, np.newaxis]
        -d=np.asarray(d)
        -print (VelocityValues.shape, d.shape)
        -
        -plt.scatter(VelocityValues, d)
        -plt.show()
        -
        -#2nd Degree Polynomial
        -poly_feat=PolynomialFeatures(degree=20, include_bias=False)
        -X_poly=poly_feat.fit_transform(VelocityValues)
        -lin_reg=LinearRegression()
        -poly_fit=lin_reg.fit(X_poly,d)
        -
        -y_plot=poly_fit.predict(X_poly)
        -plt.title("Polynomial Fit")
        -plt.plot(VelocityValues, y_plot, color='black', label="Fit")
        -plt.show()
        -
        -#Decision Trees
        -
        -from sklearn.tree import DecisionTreeRegressor
        -regr_1=DecisionTreeRegressor(max_depth=2)
        -regr_2=DecisionTreeRegressor(max_depth=5)
        -regr_3=DecisionTreeRegressor(max_depth=7)
        -regr_1.fit(VelocityValues, d)
        -regr_2.fit(VelocityValues, d)
        -regr_3.fit(VelocityValues, d)
        -
        -X_test = np.arange(0.0, MCcycles, 0.01)[:, np.newaxis]
        -y_1=regr_1.predict(X_test)
        -y_2=regr_2.predict(X_test)
        -y_3=regr_3.predict(X_test)
        -
        -plt.title("Decision Tree")
        -plt.plot(X_test, y_1, color="red", label="max_depth=2", linewidth=2)
        -plt.plot(X_test, y_2, color="green", label="max_depth=5", linewidth=2)
        -plt.plot(X_test, y_3, color="m", label="max_depth=7", linewidth=2)
        -plt.show()
        -
        -

        -









        - -

        Building a tree, regression

        +

        Building a tree, regression

        There are mainly two steps @@ -424,7 +322,7 @@ box.











        -

        A top-down approach, recursive binary splitting

        +

        A top-down approach, recursive binary splitting

        Unfortunately, it is computationally infeasible to consider every @@ -443,7 +341,7 @@ better tree in some future step.











        -

        Making a tree

        +

        Making a tree

        In order to implement the recursive binary splitting we start by selecting @@ -490,7 +388,7 @@ region contains more than five observations.

        -

        Pruning the tree

        +

        Pruning the tree

        The above procedure is rather straightforward, but leads often to @@ -509,7 +407,7 @@ parameter \( \alpha \).











        -

        Cost complexity pruning

        +

        Cost complexity pruning

        For each value of \( \alpha \) there corresponds a subtree \( T \in T_0 \) such that $$ \sum_{m=1}^{\overline{T}}\sum_{i:x_i\in R_m}(y_i-\overline{y}_{R_m})^2+\alpha\overline{T}, @@ -540,7 +438,7 @@ subtree corresponding to \( \alpha \).











        -

        A schematic procedure

        +

        A schematic procedure

        @@ -566,7 +464,7 @@ subtree corresponding to \( \alpha \).











        -

        A classification tree

        +

        A classification tree

        A classification tree is very similar to a regression tree, except @@ -585,7 +483,7 @@ fall into that region.











        -

        Growing a classification tree

        +

        Growing a classification tree

        The task of growing a @@ -609,7 +507,7 @@ than is the classification error rate.











        -

        Classification tree, how to split nodes

        +

        Classification tree, how to split nodes

        If our targets are the outcome of a classification process that takes for example \( k=1,2,\dots,K \) values, the only thing we need to think of is to set up the splitting criteria for each node. @@ -651,12 +549,15 @@ $$











        -

        Entropy and the ID3 algorithm

        +

        Entropy and the ID3 algorithm

        + +

        +More text to come here.











        -

        Writing your own code for a classification tree

        +

        Writing your own code for a classification tree

        @@ -748,7 +649,7 @@ $$











        -

        Back to moons again

        +

        Back to moons again

        @@ -820,7 +721,7 @@ plt.show()











        -

        Playing around with regions

        +

        Playing around with regions

        @@ -848,7 +749,7 @@ plt.show()











        -

        Regression trees

        +

        Regression trees

        @@ -870,7 +771,7 @@ tree_reg.fit(X, y)











        -

        Final regressor code

        +

        Final regressor code

        @@ -948,7 +849,7 @@ plt.show()











        -

        Classification again: The zoo data

        +

        Classification again: The zoo data

        @@ -976,7 +877,7 @@ prediction = tree.predict(test_features)











        -

        Pros and cons of trees, pros

        +

        Pros and cons of trees, pros

        • White box, easy to interpret model. Some people believe that decision trees more closely mirror human decision-making than do the regression and classification approaches discussed earlier (think of support vector machines)
        • @@ -990,7 +891,7 @@ prediction = tree.predict(test_features)









          -

          Disadvantages

          +

          Disadvantages

          • Unfortunately, trees generally do not have the same level of predictive accuracy as some of the other regression and classification approaches
          • @@ -1007,7 +908,7 @@ However, by aggregating many decision trees, using methods like bagging, random











            -

            Bagging

            +

            Bagging

            The plain decision trees suffer from high @@ -1050,7 +951,7 @@ predictor, averaged over all \( B \) trees.











            -

            Simple example, head or tail

            +

            Simple example, head or tail

            @@ -1070,7 +971,7 @@ plt.show()











            -

            Random forests

            +

            Random forests

            Random forests provide an improvement over bagged trees by way of a @@ -1112,7 +1013,7 @@ setting.











            -

            A simple scikit-learn example

            +

            A simple scikit-learn example

            @@ -1130,7 +1031,7 @@ accuracy = cross_validate(Random_Forest_model,X,Y,cv=Please, not the moons again! +

            Please, not the moons again!

            @@ -1188,7 +1089,7 @@ voting_clf.fit(X_train, y_train)











            -

            Bagging examples

            +

            Bagging examples

            @@ -1249,7 +1150,7 @@ plt.show()











            -

            Then random forests

            +

            Then random forests

            @@ -1271,7 +1172,7 @@ np.sum(y_pred == y_pred_rf) / len(y_pred)

            -

            Boosting and more

            +

            Boosting and more

            More material to come here.

            @@ -1280,7 +1181,7 @@ More material to come here.

            - © 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license + © 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
            diff --git a/doc/pub/DecisionTrees/html/DecisionTrees.html b/doc/pub/DecisionTrees/html/DecisionTrees.html index e5eede0b4..024723f43 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees.html @@ -69,39 +69,38 @@ div { text-align: justify; text-justify: inter-word; } 'sections': [('Decision trees, overarching aims', 2, None, '___sec0'), ('How do we set it up?', 2, None, '___sec1'), ('Decision trees and Regression', 2, None, '___sec2'), - ('Maxwell-Boltzmann velocity distribution', 2, None, '___sec3'), - ('Building a tree, regression', 2, None, '___sec4'), + ('Building a tree, regression', 2, None, '___sec3'), ('A top-down approach, recursive binary splitting', 2, None, - '___sec5'), - ('Making a tree', 2, None, '___sec6'), - ('Pruning the tree', 2, None, '___sec7'), - ('Cost complexity pruning', 2, None, '___sec8'), - ('A schematic procedure', 2, None, '___sec9'), - ('A classification tree', 2, None, '___sec10'), - ('Growing a classification tree', 2, None, '___sec11'), - ('Classification tree, how to split nodes', 2, None, '___sec12'), - ('Entropy and the ID3 algorithm', 2, None, '___sec13'), + '___sec4'), + ('Making a tree', 2, None, '___sec5'), + ('Pruning the tree', 2, None, '___sec6'), + ('Cost complexity pruning', 2, None, '___sec7'), + ('A schematic procedure', 2, None, '___sec8'), + ('A classification tree', 2, None, '___sec9'), + ('Growing a classification tree', 2, None, '___sec10'), + ('Classification tree, how to split nodes', 2, None, '___sec11'), + ('Entropy and the ID3 algorithm', 2, None, '___sec12'), ('Writing your own code for a classification tree', 2, None, - '___sec14'), - ('Back to moons again', 2, None, '___sec15'), - ('Playing around with regions', 2, None, '___sec16'), - ('Regression trees', 2, None, '___sec17'), - ('Final regressor code', 2, None, '___sec18'), - ('Classification again: The zoo data', 2, None, '___sec19'), - ('Pros and cons of trees, pros', 2, None, '___sec20'), - ('Disadvantages', 2, None, '___sec21'), - ('Bagging', 2, None, '___sec22'), - ('Simple example, head or tail', 2, None, '___sec23'), - ('Random forests', 2, None, '___sec24'), - ('A simple scikit-learn example', 2, None, '___sec25'), - ('Please, not the moons again!', 2, None, '___sec26'), - ('Bagging examples', 2, None, '___sec27'), - ('Then random forests', 2, None, '___sec28'), - ('Boosting and more', 2, None, '___sec29')]} + '___sec13'), + ('Back to moons again', 2, None, '___sec14'), + ('Playing around with regions', 2, None, '___sec15'), + ('Regression trees', 2, None, '___sec16'), + ('Final regressor code', 2, None, '___sec17'), + ('Classification again: The zoo data', 2, None, '___sec18'), + ('Pros and cons of trees, pros', 2, None, '___sec19'), + ('Disadvantages', 2, None, '___sec20'), + ('Bagging', 2, None, '___sec21'), + ('Simple example, head or tail', 2, None, '___sec22'), + ('Random forests', 2, None, '___sec23'), + ('A simple scikit-learn example', 2, None, '___sec24'), + ('Please, not the moons again!', 2, None, '___sec25'), + ('Bagging examples', 2, None, '___sec26'), + ('Then random forests', 2, None, '___sec27'), + ('Boosting and more', 2, None, '___sec28')]} end of tocinfo --> @@ -143,7 +142,7 @@ MathJax.Hub.Config({
            [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University

            -

            Dec 17, 2018

            +

            Oct 24, 2019












            @@ -296,108 +295,7 @@ plt.show()











            -

            Maxwell-Boltzmann velocity distribution

            - -

            - - -

            # Program to test the Metropolis algorithm with one particle at given temp in
            -# one dimension
            -#!/usr/bin/env python
            -import numpy as np
            -import matplotlib.mlab as mlab
            -import matplotlib.pyplot as plt
            -import random
            -from math import sqrt, exp, log
            -from sklearn.preprocessing import PolynomialFeatures
            -from sklearn.linear_model import LinearRegression
            -# initialize the rng with a seed
            -random.seed()
            -# Hard coding of input parameters
            -MCcycles = 100000
            -Temperature = 2.0
            -beta = 1./Temperature
            -InitialVelocity = -2.0
            -CurrentVelocity = InitialVelocity
            -Energy = 0.5*InitialVelocity*InitialVelocity
            -VelocityRange = 10*sqrt(Temperature)
            -VelocityStep = 2*VelocityRange/10.
            -AverageEnergy = Energy
            -AverageEnergy2 = Energy*Energy
            -VelocityValues = np.zeros(MCcycles)
            -# The Monte Carlo sampling with Metropolis starts here
            -for i in range (1, MCcycles, 1):
            -    TrialVelocity = CurrentVelocity + (2.0*random.random() - 1.0)*VelocityStep
            -    EnergyChange = 0.5*(TrialVelocity*TrialVelocity -CurrentVelocity*CurrentVelocity);
            -    if random.random() <= exp(-beta*EnergyChange):
            -        CurrentVelocity = TrialVelocity
            -        Energy += EnergyChange
            -        VelocityValues[i] = CurrentVelocity
            -    AverageEnergy += Energy
            -    AverageEnergy2 += Energy*Energy
            -#Final averages
            -AverageEnergy = AverageEnergy/MCcycles
            -AverageEnergy2 = AverageEnergy2/MCcycles
            -Variance = AverageEnergy2 - AverageEnergy*AverageEnergy
            -print(AverageEnergy, Variance)
            -n, bins, patches = plt.hist(VelocityValues, 400, facecolor='green')
            -
            -plt.xlabel('$v$')
            -plt.ylabel('Velocity distribution P(v)')
            -plt.title(r'Velocity histogram at $k_BT=2$')
            -plt.axis([-5, 5, 0, 600])
            -plt.grid(True)
            -from collections import Counter
            -
            -#print (Counter(VelocityValues))
            -
            -print (VelocityValues[:20])
            -VelocityValues=list(Counter(VelocityValues).keys())
            -d=list(Counter(VelocityValues).values())
            -
            -VelocityValues=np.asarray(VelocityValues)[:, np.newaxis]
            -d=np.asarray(d)
            -print (VelocityValues.shape, d.shape)
            -
            -plt.scatter(VelocityValues, d)
            -plt.show()
            -
            -#2nd Degree Polynomial
            -poly_feat=PolynomialFeatures(degree=20, include_bias=False)
            -X_poly=poly_feat.fit_transform(VelocityValues)
            -lin_reg=LinearRegression()
            -poly_fit=lin_reg.fit(X_poly,d)
            -
            -y_plot=poly_fit.predict(X_poly)
            -plt.title("Polynomial Fit")
            -plt.plot(VelocityValues, y_plot, color='black', label="Fit")
            -plt.show()
            -
            -#Decision Trees
            -
            -from sklearn.tree import DecisionTreeRegressor
            -regr_1=DecisionTreeRegressor(max_depth=2)
            -regr_2=DecisionTreeRegressor(max_depth=5)
            -regr_3=DecisionTreeRegressor(max_depth=7)
            -regr_1.fit(VelocityValues, d)
            -regr_2.fit(VelocityValues, d)
            -regr_3.fit(VelocityValues, d)
            -
            -X_test = np.arange(0.0, MCcycles, 0.01)[:, np.newaxis]
            -y_1=regr_1.predict(X_test)
            -y_2=regr_2.predict(X_test)
            -y_3=regr_3.predict(X_test)
            -
            -plt.title("Decision Tree")
            -plt.plot(X_test, y_1, color="red", label="max_depth=2", linewidth=2)
            -plt.plot(X_test, y_2, color="green", label="max_depth=5", linewidth=2)
            -plt.plot(X_test, y_3, color="m", label="max_depth=7", linewidth=2)
            -plt.show()
            -
            -

            -









            - -

            Building a tree, regression

            +

            Building a tree, regression

            There are mainly two steps @@ -429,7 +327,7 @@ box.











            -

            A top-down approach, recursive binary splitting

            +

            A top-down approach, recursive binary splitting

            Unfortunately, it is computationally infeasible to consider every @@ -448,7 +346,7 @@ better tree in some future step.











            -

            Making a tree

            +

            Making a tree

            In order to implement the recursive binary splitting we start by selecting @@ -495,7 +393,7 @@ region contains more than five observations.

            -

            Pruning the tree

            +

            Pruning the tree

            The above procedure is rather straightforward, but leads often to @@ -514,7 +412,7 @@ parameter \( \alpha \).











            -

            Cost complexity pruning

            +

            Cost complexity pruning

            For each value of \( \alpha \) there corresponds a subtree \( T \in T_0 \) such that $$ \sum_{m=1}^{\overline{T}}\sum_{i:x_i\in R_m}(y_i-\overline{y}_{R_m})^2+\alpha\overline{T}, @@ -545,7 +443,7 @@ subtree corresponding to \( \alpha \).











            -

            A schematic procedure

            +

            A schematic procedure

            @@ -571,7 +469,7 @@ subtree corresponding to \( \alpha \).











            -

            A classification tree

            +

            A classification tree

            A classification tree is very similar to a regression tree, except @@ -590,7 +488,7 @@ fall into that region.











            -

            Growing a classification tree

            +

            Growing a classification tree

            The task of growing a @@ -614,7 +512,7 @@ than is the classification error rate.











            -

            Classification tree, how to split nodes

            +

            Classification tree, how to split nodes

            If our targets are the outcome of a classification process that takes for example \( k=1,2,\dots,K \) values, the only thing we need to think of is to set up the splitting criteria for each node. @@ -656,12 +554,15 @@ $$











            -

            Entropy and the ID3 algorithm

            +

            Entropy and the ID3 algorithm

            + +

            +More text to come here.











            -

            Writing your own code for a classification tree

            +

            Writing your own code for a classification tree

            @@ -753,7 +654,7 @@ $$











            -

            Back to moons again

            +

            Back to moons again

            @@ -825,7 +726,7 @@ plt.show()











            -

            Playing around with regions

            +

            Playing around with regions

            @@ -853,7 +754,7 @@ plt.show()











            -

            Regression trees

            +

            Regression trees

            @@ -875,7 +776,7 @@ tree_reg.fit(X, y)











            -

            Final regressor code

            +

            Final regressor code

            @@ -953,7 +854,7 @@ plt.show()











            -

            Classification again: The zoo data

            +

            Classification again: The zoo data

            @@ -981,7 +882,7 @@ prediction = treePros and cons of trees, pros +

            Pros and cons of trees, pros

            • White box, easy to interpret model. Some people believe that decision trees more closely mirror human decision-making than do the regression and classification approaches discussed earlier (think of support vector machines)
            • @@ -995,7 +896,7 @@ prediction = treeDisadvantages +

              Disadvantages

              • Unfortunately, trees generally do not have the same level of predictive accuracy as some of the other regression and classification approaches
              • @@ -1012,7 +913,7 @@ However, by aggregating many decision trees, using methods like bagging, random











                -

                Bagging

                +

                Bagging

                The plain decision trees suffer from high @@ -1055,7 +956,7 @@ predictor, averaged over all \( B \) trees.











                -

                Simple example, head or tail

                +

                Simple example, head or tail

                @@ -1075,7 +976,7 @@ plt.show()











                -

                Random forests

                +

                Random forests

                Random forests provide an improvement over bagged trees by way of a @@ -1117,7 +1018,7 @@ setting.











                -

                A simple scikit-learn example

                +

                A simple scikit-learn example

                @@ -1135,7 +1036,7 @@ accuracy = cross_validate(Random_Forest_mode











                -

                Please, not the moons again!

                +

                Please, not the moons again!

                @@ -1193,7 +1094,7 @@ voting_clf.fit(X_train, y_train)











                -

                Bagging examples

                +

                Bagging examples

                @@ -1254,7 +1155,7 @@ plt.show()











                -

                Then random forests

                +

                Then random forests

                @@ -1276,7 +1177,7 @@ np.sum(y_pred =

                -

                Boosting and more

                +

                Boosting and more

                More material to come here.

                @@ -1285,7 +1186,7 @@ More material to come here.

                - © 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license + © 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
                diff --git a/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb b/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb index 34e8a668e..43e094f05 100644 --- a/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb +++ b/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb @@ -10,9 +10,9 @@ " \n", "**Morten Hjorth-Jensen**, Department of Physics, University of Oslo and Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University\n", "\n", - "Date: **Dec 17, 2018**\n", + "Date: **Oct 24, 2019**\n", "\n", - "Copyright 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license\n", + "Copyright 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license\n", "\n", "\n", "\n", @@ -73,39 +73,10 @@ { "cell_type": "code", "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2nd degree coefficients:\n", - "zero power: -5.3396743101437965\n", - "first power: 0.12395206655103709\n", - "second power: -0.0003817214992490569\n" - ] - }, - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEWCAYAAABxMXBSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAIABJREFUeJzsnXlcFOUbwL8viKDCgrforqJ5HxweiJLmgUem5pmVppZZmlaaZf6sPMq80vJMszwyzay8Kq2880LzzDuvEBYR8IAFBAT2/f0xu+sCyymCwHw/n/mwM/POO8/MLvPM877PIaSUqKioqKioZBe7ghZARUVFRaVwoSoOFRUVFZUcoSoOFRUVFZUcoSoOFRUVFZUcoSoOFRUVFZUcoSoOFRUVFZUcoSoOlccWIcQUIcSagpbDGiHEQCHE9my2fezkz0uEEOeEEO0KWg6V/EdVHCqPHCFEkBAiXggRK4QIF0KsEkI4F7RcuUFKuVZK2flh+xFCtBNCGE33JEYI8a8Q4uW8kDG/kFI2klLuLWg5VPIfVXGo5Bc9pJTOQFOgOfBhAcvzOHDDdE80wFjgayFEvbw+iRCiRF73qVK8URWHSr4ipQwFfgcaAwghqgohfhFC3BFCXBFCDLd1nBBiqxDizTTbTgsheps+SyHECCHEZSFElBBisRBCmPbZCSE+FEJcF0JECCF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UkQ2YuVOOtVr/5te3yPdy18C/xaR27GKjClKiyIm3AIoSiRjjKkAlgPL3ZbCzTUOEWCJMWZCfZeouWyMuUNEhgOXAetFZJgxJi+wkitK01GLQ1GaiIicISJ9vDYNAX4ACrBKewKsBkZ5zV8kicjpXudc7/W9yn3MacaYr40x07EsGe/U2IoSdtTiUJSm0xZ4VkTaAeVYpTknAROA/4pIrjHmfPfw1Zsi0sZ93iNYmZgB0kRkM1DqPg/gKbdCEqwsr5tC0htF8RGdHFeUMOE9iR5uWRTFH3SoSlEURfELtTgURVEUv1CLQ1EURfELVRyKoiiKX6jiUBRFUfxCFYeiKIriF6o4FEVRFL/4/+bMPf26Ou10AAAAAElFTkSuQmCC\n", - "text/plain": [ - "
                " - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEWCAYAAABxMXBSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAIABJREFUeJzsnXd8VFX2wL9nJglJSIAACS1AolQpiYSOi7ooomgUy9pFXNay6voDV1fBjRLFXRVBRVhlVbCguCpCLChVsSFFiUhRWoBQQye9zP398d5MJskkmSTTktxvPvPJzH333XveezPvvHPvueeIUgqNRqPRaNzF4m8BNBqNRlO/0IpDo9FoNDVCKw6NRqPR1AitODQajUZTI7Ti0Gg0Gk2N0IpDo9FoNDVCKw5NQCMiS0RkrBv1skXkLF/IpHEPEfmniLzibzk0nkf0Og5NXRGRDKANUAyUAFuAt4A5SimbH0WrEyKS7fQxHCjAOD6Au5RS873cfybQyuwzG/gcuF8plePNfjWa6tAWh8ZTXKGUigQ6A/8G/gG87l+R6oZSKsL+AvZiHKO9rILSEJEgL4hxqdl/P2Ag8LAX+kBErN5oV9Mw0YpD41GUUqeUUmn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2FfHKNhZwH+v+i+hF4Z6tK8TW06QtykPi7I02EyJWnFo6j8efuotOVLCB89/QFhR2cWE86+fT6urWwGw+evNnNpzii9v/JLw3uGsf249rSNbU/BYAUGWICxSf26qNaV04t9SbywOO82aNKNbq25stGykgAJiW8TSspVnQ6ZsDdtKHobiaIhTAaCHqvzGE088wbRp0yrdvmjRIrZs2eJDiTR2bHtshBWFURRURFjXMMK6htH8D81pdUErQqwhhFhDsAQZP50ggghSxvOXBImxrQErDShVHKoeKQ77DVwwlZ5pCHjD+83epkVZUNSP81NTtMURoCxatIjLL7+cc87R+TndpoqhqppgKzLuKgfiD3Dx7xe77spamuJVFZs3peAG6oJbHoderD9zHOVv4MpmXrNapPetDnuboqTBWhxacfiQqVOn8uabbxITE0PHjh1JSkriv//9L3PmzKGwsJAuXbrw9ttvs3HjRtLS0vj666956qmn+Oijj1i5cmWFepVFyNWUUni4kENvHcKWXzrWHHVxFM0HN690H7sisFmrGJ82Xf8Pv3uYkGjD20aCGofisFgNzVGf5jjs2Ff5O1LzeuMQzDYttoZrcdS/K+9DPOm3d06CAAAgAElEQVRHv2HDBhYsWMDGjRv5/PPPWbduHWBEm123bh3p6en07NmT119/naFDh5KcnMxzzz3Hxo0bOfvss13W05hU8VS399m97Hp4FxkpGY7XluurHgK0FRsKoyrFYQ8ncWT+ETJfyCxT1tCpj3Mcfhuqqifnp6b4/ZsuIhnAGaAEKC7vRyzGI8KLwGVALnC7UuonX8iWkpJCeno6KSkpdfZu+eabbxgzZozDSrC39+uvv/LYY49x8uRJsrOzueQS126c7tbTlKX4pOE223J0S5r2bMq+afsoOV1S5T72+EXKWvmPPv7JeMK7h5fGOhJofVVrzwgd4DgsK1V/FEd57ENV3rQ4REmDtTj8rjhMLlRKHa1k26VAV/M1CPiP+d/rpKamkpKS4tU0kLfffjuLFi0iISGBefPm8dVXX9WpXqPG1RyH+WQZfU000VdHs2/avtKbRiXYimxYsVZpcYSdFUZcSlwdhK2/1EuLw7yBOwJSms8O3pz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bplHunVBFlzMZjYD+D3gVYbAse4VLwzwcVbiGHoudfe5wALgVjO7rPtKD9q4BX2N9lCIMfQT4DygCmgC7o+2OrlhZqOBJ4Bvu/vR7usK8VgniXfAj7MSR6ARmN7t/dnhsoLj7o3h8wHgKYKma3O8yR4+H4iuhjmTKsaCPfbu3uzuXe4eAx7mZDdFwcRsZsUEP6I/c/cnw8UFe6yTxRvFcVbiCLwGzDazmWY2ArgOqIm4TllnZmVmNib+GrgS2E4Q69fDYl8Hfh5NDXMqVYw1wNfCK24uAT7p1s2R13r1319NcKwhiPk6Mysxs5nAbOA3A12//jIzA34KvOPuP+y2qiCPdap4IznOUV8pMFgeBFdcvEtw5cHKqOuToxhnEVxlUQe8HY8TOAt4EdgFvABMjLqu/YxzPUGTvYOgX/fGVDESXGHzYHjc3wLmRV3/LMb8X2FMb4Y/IpXdyq8MY94JLIi6/mcY86UE3VBvAtvCx8JCPdZ9xDvgx1lTjoiISEbUVSUiIhlR4hARkYwocYiISEaUOEREJCNKHCIikhElDpF+MrOucFbSt82szsxuN7M+/7bMbIaZLR2oOopkkxKHSP+1unuVu38WuIJgOpd7TrPNDECJQ/KSxnGI9JOZtbj76G7vZxHMRlAOnEswQKssXL3C3X9tZluA3wE+IJjB9alk5QYoBJGMKHGI9FPvxBEuOwJcABwDYu7eZmazgfXuPs/M/pDgHgp/FpYflazcwEYikp6iqCsgUuCKgR+ZWRXQBZzfz3IikVPiEMmysKuqi2BW1nuAZmAOwTnFthSb3ZZmOZHI6eS4SBaZ2STgIeBHHvQDjwOaPJjy+qsEtymGoAtrTLdNU5UTGXR0jkOkn8ysi2B20mKgk+Ak9w/dPRaer3iCYFbTZ4Fb3X10eF+F5whmcl0LPJ2s3EDHIpIOJQ4REcmIuqpERCQjShwiIpIRJQ4REcmIEoeIiGREiUNERDKixCEiIhlR4hARkYz8P0Lg5v1SHDUPAAAAAElFTkSuQmCC\n", - "text/plain": [ - "
                " - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "metadata": { + "collapsed": false + }, + "outputs": [], "source": [ "%matplotlib inline\n", "\n", @@ -199,113 +170,6 @@ "plt.show()" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Maxwell-Boltzmann velocity distribution" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "# Program to test the Metropolis algorithm with one particle at given temp in\n", - "# one dimension\n", - "#!/usr/bin/env python\n", - "import numpy as np\n", - "import matplotlib.mlab as mlab\n", - "import matplotlib.pyplot as plt\n", - "import random\n", - "from math import sqrt, exp, log\n", - "from sklearn.preprocessing import PolynomialFeatures\n", - "from sklearn.linear_model import LinearRegression\n", - "# initialize the rng with a seed\n", - "random.seed()\n", - "# Hard coding of input parameters\n", - "MCcycles = 100000\n", - "Temperature = 2.0\n", - "beta = 1./Temperature\n", - "InitialVelocity = -2.0\n", - "CurrentVelocity = InitialVelocity\n", - "Energy = 0.5*InitialVelocity*InitialVelocity\n", - "VelocityRange = 10*sqrt(Temperature)\n", - "VelocityStep = 2*VelocityRange/10.\n", - "AverageEnergy = Energy\n", - "AverageEnergy2 = Energy*Energy\n", - "VelocityValues = np.zeros(MCcycles)\n", - "# The Monte Carlo sampling with Metropolis starts here\n", - "for i in range (1, MCcycles, 1):\n", - " TrialVelocity = CurrentVelocity + (2.0*random.random() - 1.0)*VelocityStep\n", - " EnergyChange = 0.5*(TrialVelocity*TrialVelocity -CurrentVelocity*CurrentVelocity);\n", - " if random.random() <= exp(-beta*EnergyChange):\n", - " CurrentVelocity = TrialVelocity\n", - " Energy += EnergyChange\n", - " VelocityValues[i] = CurrentVelocity\n", - " AverageEnergy += Energy\n", - " AverageEnergy2 += Energy*Energy\n", - "#Final averages\n", - "AverageEnergy = AverageEnergy/MCcycles\n", - "AverageEnergy2 = AverageEnergy2/MCcycles\n", - "Variance = AverageEnergy2 - AverageEnergy*AverageEnergy\n", - "print(AverageEnergy, Variance)\n", - "n, bins, patches = plt.hist(VelocityValues, 400, facecolor='green')\n", - "\n", - "plt.xlabel('$v$')\n", - "plt.ylabel('Velocity distribution P(v)')\n", - "plt.title(r'Velocity histogram at $k_BT=2$')\n", - "plt.axis([-5, 5, 0, 600])\n", - "plt.grid(True)\n", - "from collections import Counter\n", - "\n", - "#print (Counter(VelocityValues))\n", - "\n", - "print (VelocityValues[:20])\n", - "VelocityValues=list(Counter(VelocityValues).keys())\n", - "d=list(Counter(VelocityValues).values())\n", - "\n", - "VelocityValues=np.asarray(VelocityValues)[:, np.newaxis]\n", - "d=np.asarray(d)\n", - "print (VelocityValues.shape, d.shape)\n", - "\n", - "plt.scatter(VelocityValues, d)\n", - "plt.show()\n", - "\n", - "#2nd Degree Polynomial\n", - "poly_feat=PolynomialFeatures(degree=20, include_bias=False)\n", - "X_poly=poly_feat.fit_transform(VelocityValues)\n", - "lin_reg=LinearRegression()\n", - "poly_fit=lin_reg.fit(X_poly,d)\n", - "\n", - "y_plot=poly_fit.predict(X_poly)\n", - "plt.title(\"Polynomial Fit\")\n", - "plt.plot(VelocityValues, y_plot, color='black', label=\"Fit\")\n", - "plt.show()\n", - "\n", - "#Decision Trees\n", - "\n", - "from sklearn.tree import DecisionTreeRegressor\n", - "regr_1=DecisionTreeRegressor(max_depth=2)\n", - "regr_2=DecisionTreeRegressor(max_depth=5)\n", - "regr_3=DecisionTreeRegressor(max_depth=7)\n", - "regr_1.fit(VelocityValues, d)\n", - "regr_2.fit(VelocityValues, d)\n", - "regr_3.fit(VelocityValues, d)\n", - "\n", - "X_test = np.arange(0.0, MCcycles, 0.01)[:, np.newaxis]\n", - "y_1=regr_1.predict(X_test)\n", - "y_2=regr_2.predict(X_test)\n", - "y_3=regr_3.predict(X_test)\n", - "\n", - "plt.title(\"Decision Tree\")\n", - "plt.plot(X_test, y_1, color=\"red\", label=\"max_depth=2\", linewidth=2)\n", - "plt.plot(X_test, y_2, color=\"green\", label=\"max_depth=5\", linewidth=2)\n", - "plt.plot(X_test, y_3, color=\"m\", label=\"max_depth=7\", linewidth=2)\n", - "plt.show()" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -612,14 +476,17 @@ "source": [ "## Entropy and the ID3 algorithm\n", "\n", + "More text to come here.\n", "\n", "## Writing your own code for a classification tree" ] }, { "cell_type": "code", - "execution_count": 3, - "metadata": {}, + "execution_count": 2, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "def entropy(target_col):\n", @@ -716,8 +583,10 @@ }, { "cell_type": "code", - "execution_count": 4, - "metadata": {}, + "execution_count": 3, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from __future__ import division, print_function, unicode_literals\n", @@ -795,8 +664,10 @@ }, { "cell_type": "code", - "execution_count": 5, - "metadata": {}, + "execution_count": 4, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "np.random.seed(6)\n", @@ -830,8 +701,10 @@ }, { "cell_type": "code", - "execution_count": 6, - "metadata": {}, + "execution_count": 5, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "# Quadratic training set + noise\n", @@ -844,8 +717,10 @@ }, { "cell_type": "code", - "execution_count": 7, - "metadata": {}, + "execution_count": 6, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from sklearn.tree import DecisionTreeRegressor\n", @@ -863,8 +738,10 @@ }, { "cell_type": "code", - "execution_count": 8, - "metadata": {}, + "execution_count": 7, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from sklearn.tree import DecisionTreeRegressor\n", @@ -909,8 +786,10 @@ }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, + "execution_count": 8, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "tree_reg1 = DecisionTreeRegressor(random_state=42)\n", @@ -952,8 +831,10 @@ }, { "cell_type": "code", - "execution_count": 10, - "metadata": {}, + "execution_count": 9, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "import pandas as pd\n", @@ -1058,8 +939,10 @@ }, { "cell_type": "code", - "execution_count": 11, - "metadata": {}, + "execution_count": 10, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "heads_proba = 0.51\n", @@ -1131,8 +1014,10 @@ }, { "cell_type": "code", - "execution_count": 12, - "metadata": {}, + "execution_count": 11, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from sklearn.ensemble import RandomForestClassifier\n", @@ -1156,8 +1041,10 @@ }, { "cell_type": "code", - "execution_count": 13, - "metadata": {}, + "execution_count": 12, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from sklearn.model_selection import train_test_split\n", @@ -1182,8 +1069,10 @@ }, { "cell_type": "code", - "execution_count": 14, - "metadata": {}, + "execution_count": 13, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from sklearn.metrics import accuracy_score\n", @@ -1196,8 +1085,10 @@ }, { "cell_type": "code", - "execution_count": 15, - "metadata": {}, + "execution_count": 14, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "log_clf = LogisticRegression(random_state=42)\n", @@ -1212,8 +1103,10 @@ }, { "cell_type": "code", - "execution_count": 16, - "metadata": {}, + "execution_count": 15, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from sklearn.metrics import accuracy_score\n", @@ -1233,8 +1126,10 @@ }, { "cell_type": "code", - "execution_count": 17, - "metadata": {}, + "execution_count": 16, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from sklearn.ensemble import BaggingClassifier\n", @@ -1249,8 +1144,10 @@ }, { "cell_type": "code", - "execution_count": 18, - "metadata": {}, + "execution_count": 17, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from sklearn.metrics import accuracy_score\n", @@ -1259,8 +1156,10 @@ }, { "cell_type": "code", - "execution_count": 19, - "metadata": {}, + "execution_count": 18, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "tree_clf = DecisionTreeClassifier(random_state=42)\n", @@ -1271,8 +1170,10 @@ }, { "cell_type": "code", - "execution_count": 20, - "metadata": {}, + "execution_count": 19, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from matplotlib.colors import ListedColormap\n", @@ -1312,8 +1213,10 @@ }, { "cell_type": "code", - "execution_count": 21, - "metadata": {}, + "execution_count": 20, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "bag_clf = BaggingClassifier(\n", @@ -1323,8 +1226,10 @@ }, { "cell_type": "code", - "execution_count": 22, - "metadata": {}, + "execution_count": 21, + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "bag_clf.fit(X_train, y_train)\n", @@ -1346,25 +1251,7 @@ ] } ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 2 } diff --git a/doc/pub/DecisionTrees/ipynb/ipynb-DecisionTrees-src.tar.gz b/doc/pub/DecisionTrees/ipynb/ipynb-DecisionTrees-src.tar.gz index bae108079..3759fecb2 100644 Binary files a/doc/pub/DecisionTrees/ipynb/ipynb-DecisionTrees-src.tar.gz and b/doc/pub/DecisionTrees/ipynb/ipynb-DecisionTrees-src.tar.gz differ diff --git a/doc/pub/DecisionTrees/pdf/DecisionTrees-minted.pdf b/doc/pub/DecisionTrees/pdf/DecisionTrees-minted.pdf index 3cfbcbc6b..2b4b245a4 100644 Binary files a/doc/pub/DecisionTrees/pdf/DecisionTrees-minted.pdf and b/doc/pub/DecisionTrees/pdf/DecisionTrees-minted.pdf differ diff --git a/doc/src/DecisionTrees/DecisionTrees.do.txt b/doc/src/DecisionTrees/DecisionTrees.do.txt index 076b9017d..f1ef0071e 100644 --- a/doc/src/DecisionTrees/DecisionTrees.do.txt +++ b/doc/src/DecisionTrees/DecisionTrees.do.txt @@ -149,104 +149,6 @@ plt.show() !ec -!split -===== Maxwell-Boltzmann velocity distribution ===== - -!bc pycod -# Program to test the Metropolis algorithm with one particle at given temp in -# one dimension -#!/usr/bin/env python -import numpy as np -import matplotlib.mlab as mlab -import matplotlib.pyplot as plt -import random -from math import sqrt, exp, log -from sklearn.preprocessing import PolynomialFeatures -from sklearn.linear_model import LinearRegression -# initialize the rng with a seed -random.seed() -# Hard coding of input parameters -MCcycles = 100000 -Temperature = 2.0 -beta = 1./Temperature -InitialVelocity = -2.0 -CurrentVelocity = InitialVelocity -Energy = 0.5*InitialVelocity*InitialVelocity -VelocityRange = 10*sqrt(Temperature) -VelocityStep = 2*VelocityRange/10. -AverageEnergy = Energy -AverageEnergy2 = Energy*Energy -VelocityValues = np.zeros(MCcycles) -# The Monte Carlo sampling with Metropolis starts here -for i in range (1, MCcycles, 1): - TrialVelocity = CurrentVelocity + (2.0*random.random() - 1.0)*VelocityStep - EnergyChange = 0.5*(TrialVelocity*TrialVelocity -CurrentVelocity*CurrentVelocity); - if random.random() <= exp(-beta*EnergyChange): - CurrentVelocity = TrialVelocity - Energy += EnergyChange - VelocityValues[i] = CurrentVelocity - AverageEnergy += Energy - AverageEnergy2 += Energy*Energy -#Final averages -AverageEnergy = AverageEnergy/MCcycles -AverageEnergy2 = AverageEnergy2/MCcycles -Variance = AverageEnergy2 - AverageEnergy*AverageEnergy -print(AverageEnergy, Variance) -n, bins, patches = plt.hist(VelocityValues, 400, facecolor='green') - -plt.xlabel('$v$') -plt.ylabel('Velocity distribution P(v)') -plt.title(r'Velocity histogram at $k_BT=2$') -plt.axis([-5, 5, 0, 600]) -plt.grid(True) -from collections import Counter - -#print (Counter(VelocityValues)) - -print (VelocityValues[:20]) -VelocityValues=list(Counter(VelocityValues).keys()) -d=list(Counter(VelocityValues).values()) - -VelocityValues=np.asarray(VelocityValues)[:, np.newaxis] -d=np.asarray(d) -print (VelocityValues.shape, d.shape) - -plt.scatter(VelocityValues, d) -plt.show() - -#2nd Degree Polynomial -poly_feat=PolynomialFeatures(degree=20, include_bias=False) -X_poly=poly_feat.fit_transform(VelocityValues) -lin_reg=LinearRegression() -poly_fit=lin_reg.fit(X_poly,d) - -y_plot=poly_fit.predict(X_poly) -plt.title("Polynomial Fit") -plt.plot(VelocityValues, y_plot, color='black', label="Fit") -plt.show() - -#Decision Trees - -from sklearn.tree import DecisionTreeRegressor -regr_1=DecisionTreeRegressor(max_depth=2) -regr_2=DecisionTreeRegressor(max_depth=5) -regr_3=DecisionTreeRegressor(max_depth=7) -regr_1.fit(VelocityValues, d) -regr_2.fit(VelocityValues, d) -regr_3.fit(VelocityValues, d) - -X_test = np.arange(0.0, MCcycles, 0.01)[:, np.newaxis] -y_1=regr_1.predict(X_test) -y_2=regr_2.predict(X_test) -y_3=regr_3.predict(X_test) - -plt.title("Decision Tree") -plt.plot(X_test, y_1, color="red", label="max_depth=2", linewidth=2) -plt.plot(X_test, y_2, color="green", label="max_depth=5", linewidth=2) -plt.plot(X_test, y_3, color="m", label="max_depth=7", linewidth=2) -plt.show() - -!ec !split @@ -463,6 +365,7 @@ s = -\sum_{k=1}^K p_{mk}\log{p_{mk}}. !split ===== Entropy and the ID3 algorithm ===== +More text to come here. !split ===== Writing your own code for a classification tree =====