diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs000.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs000.html index d31b30fcf..e0e5b5550 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs000.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs000.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -296,7 +304,7 @@ MathJax.Hub.Config({
  • 9
  • 10
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs001.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs001.html index 2afd33009..a888defaf 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs001.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs001.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -301,7 +309,7 @@ given some assumptions, make predictions about the target feature value
  • 10
  • 11
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs002.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs002.html index cbbd1c968..6f298e5ea 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs002.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs002.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -279,7 +287,7 @@ This tree was produced using the Wisconsin cancer data (discussed here as well,
  • 11
  • 12
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs003.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs003.html index 51832aeb7..7063f5a1c 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs003.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs003.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -287,7 +295,7 @@ node.
  • 12
  • 13
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs004.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs004.html index 8e264322d..d0fce1a33 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs004.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs004.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -288,7 +296,7 @@ Then we are essentially done!
  • 13
  • 14
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs005.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs005.html index 22decf3ee..bf7a721b9 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs005.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs005.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -367,7 +375,7 @@ plt.show()
  • 14
  • 15
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs006.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs006.html index 8b2fea7d8..be9495135 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs006.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs006.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -300,7 +308,7 @@ within box \( j \).
  • 15
  • 16
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs007.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs007.html index 80384b7ee..ae6d1fb91 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs007.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs007.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -292,7 +300,7 @@ better tree in some future step.
  • 16
  • 17
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs008.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs008.html index 862c152bb..00d431a57 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs008.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs008.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -325,7 +333,7 @@ region contains more than five observations.
  • 17
  • 18
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs009.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs009.html index 63c607dba..60b0c27b8 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs009.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs009.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -294,7 +302,7 @@ parameter \( \alpha \).
  • 18
  • 19
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs010.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs010.html index 4d2c470ea..57b04a8ba 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs010.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs010.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -307,7 +315,7 @@ subtree corresponding to \( \alpha \).
  • 19
  • 20
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs011.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs011.html index a0dfc1482..e77203ccb 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs011.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs011.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -303,7 +311,7 @@ MathJax.Hub.Config({
  • 20
  • 21
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs012.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs012.html index 307928c3b..17c28772e 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs012.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs012.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -295,7 +303,7 @@ fall into that region.
  • 21
  • 22
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs013.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs013.html index e83a0edee..2d70d5ee0 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs013.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs013.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -300,7 +308,7 @@ than is the classification error rate.
  • 22
  • 23
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs014.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs014.html index 1b54b1216..ae7f566e4 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs014.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs014.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -326,7 +334,7 @@ $$
  • 23
  • 24
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs015.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs015.html index f3b7886b8..ef768d85b 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs015.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs015.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -317,7 +325,7 @@ os.system(cmd)
  • 24
  • 25
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs016.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs016.html index db70db9c3..d8760b22f 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs016.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs016.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -308,7 +316,7 @@ os.system(cmd)
  • 25
  • 26
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs017.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs017.html index 97c12abd8..08a95f228 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs017.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs017.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -291,7 +299,7 @@ We discuss both algorithms with applications here. The popular library Scikit
  • 26
  • 27
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs018.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs018.html index 155449b1c..64712ebdf 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs018.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs018.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -281,7 +289,7 @@ MathJax.Hub.Config({
  • 27
  • 28
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs019.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs019.html index 87963dc06..82cbc14f8 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs019.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs019.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -281,7 +289,7 @@ MathJax.Hub.Config({
  • 28
  • 29
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs020.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs020.html index 320ecdc88..2a01165ad 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs020.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs020.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -321,7 +329,7 @@ The table here summarizes the various attributes and
  • 29
  • 30
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs021.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs021.html index f3ae0716d..68aad3519 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs021.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs021.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -352,7 +360,7 @@ os.system(cmd)
  • 30
  • 31
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs022.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs022.html index f0bb8b8cc..70628a021 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs022.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs022.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -354,7 +362,7 @@ split = get_split(dataset)
  • 31
  • 32
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs023.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs023.html index 5b989bab8..aaeccf360 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs023.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs023.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -312,7 +320,7 @@ attributes at each step while growing the tree.
  • 32
  • 33
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs024.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs024.html index dde04c8bf..025cd50cf 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs024.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs024.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -472,7 +480,7 @@ MathJax.Hub.Config({
  • 33
  • 34
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs025.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs025.html index 789101480..3f35cd4cd 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs025.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs025.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -325,7 +333,7 @@ deep_tree_clf.fit(X_train_scaled, y_train)
  • 34
  • 35
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs026.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs026.html index 278ccd3ac..688a8b7cf 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs026.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs026.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -348,7 +356,7 @@ plt.show()
  • 35
  • 36
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs027.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs027.html index 24fde23be..90d8e8172 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs027.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs027.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -304,7 +312,7 @@ plt.show()
  • 36
  • 37
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs028.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs028.html index 464a8b414..8b34df1b5 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs028.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs028.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -298,7 +306,7 @@ tree_reg.fit(X, y)
  • 37
  • 38
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs029.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs029.html index 873ef4b6d..77ddfe102 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs029.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs029.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -354,7 +362,7 @@ plt.show()
  • 38
  • 39
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs030.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs030.html index e22c46713..02e29297d 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs030.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs030.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -290,7 +298,7 @@ MathJax.Hub.Config({
  • 39
  • 40
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs031.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs031.html index 535763ff4..5287de334 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs031.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs031.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -293,7 +301,7 @@ However, by aggregating many decision trees, using methods like bagging, random
  • 40
  • 41
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs032.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs032.html index 4aa7638b3..d48fa8fa2 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs032.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs032.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -300,7 +308,7 @@ We discuss these methods here.
  • 41
  • 42
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs033.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs033.html index 8115eb7f9..92d3900c4 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs033.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs033.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -284,7 +292,7 @@ MathJax.Hub.Config({
  • 42
  • 43
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs034.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs034.html index f96456a4e..1d797fbef 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs034.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs034.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -295,7 +303,7 @@ learning method.
  • 43
  • 44
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs035.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs035.html index 45b0f7be8..34a2b635b 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs035.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs035.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -305,7 +313,7 @@ predictor, averaged over all \( B \) trees.
  • 44
  • 45
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs036.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs036.html index 052c35278..eace42fbd 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs036.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs036.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -296,7 +304,7 @@ plt.show()
  • 45
  • 46
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs037.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs037.html index f17c49156..4b2d4e885 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs037.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs037.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -327,7 +335,7 @@ voting_clf.fit(X_train, y_train)
  • 46
  • 47
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs038.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs038.html index 98e569faf..3906f7550 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs038.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs038.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -334,7 +342,7 @@ voting_clf.fit(X_train, y_train)
  • 47
  • 48
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs039.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs039.html index 96ba695ca..bcad02a86 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs039.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs039.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -337,7 +345,7 @@ plt.show()
  • 48
  • 49
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs040.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs040.html index 614a4fd0e..29ad457ea 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs040.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs040.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -335,7 +343,7 @@ plt.show()
  • 49
  • 50
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs041.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs041.html index a17eb4c62..39ad88d78 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs041.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs041.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -320,7 +328,7 @@ this setting.
  • 50
  • 51
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs042.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs042.html index b0e4b74ca..4ad66132f 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs042.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs042.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -302,7 +310,7 @@ We will grow of forest of say \( M \) trees.
  • 51
  • 52
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs043.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs043.html index f01bfcb7c..562b96059 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs043.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs043.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -349,7 +357,7 @@ plt.show()
  • 52
  • 53
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs044.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs044.html index 70c1bc490..8c72f9d61 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs044.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs044.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -298,7 +306,7 @@ np.sum(y_pred =
  • 53
  • 54
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs045.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs045.html index bf01d5de8..8fba28c37 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs045.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs045.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -293,7 +301,7 @@ them with a factor.
  • 54
  • 55
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs046.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs046.html index 4684f6bfa..4e99b9984 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs046.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs046.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -316,7 +324,7 @@ In iterative fitting or additive modeling, we minimize the cost function with re
  • 55
  • 56
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs047.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs047.html index 434279628..3e5ad4023 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs047.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs047.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -299,7 +307,7 @@ We could use any of the algorithms we have discussed till now. If we use trees,
  • 56
  • 57
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs048.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs048.html index 53c3c256c..4f7c2eaa4 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs048.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs048.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -310,7 +318,7 @@ $$
  • 57
  • 58
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs049.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs049.html index f4c85b9db..6e932b87b 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs049.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs049.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -304,7 +312,7 @@ where we have defined \( w_i^m= \exp{-(y_if_{m-1}(x_i))} \).
  • 58
  • 59
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs050.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs050.html index 5d38dfcdb..0fb2ffda3 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs050.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs050.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -281,7 +289,7 @@ $$ where we have redefined the error as $$ -\mathrm{\overline{err}}_m=\frac{1}{n}\frac{\sum_{i=0}^{n-1}w_i^mI(y_i\ne G(\boldsymbol{X}_{i*})}{\sum_{i=0}^{n-1}w_i^m}, +\mathrm{\overline{err}}_m=\frac{1}{n}\frac{\sum_{i=0}^{n-1}w_i^mI(y_i\ne G(x_i)}{\sum_{i=0}^{n-1}w_i^m}, $$ which leads to an update of @@ -318,6 +326,8 @@ $$
  • 58
  • 59
  • 60
  • +
  • ...
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs051.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs051.html index c59656a50..e13bc2556 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs051.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs051.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -296,6 +304,7 @@ where the function \( I() \) is one if we misclassify and zero if we classify co
  • 58
  • 59
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs052.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs052.html index 025ffee3a..0273afd61 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs052.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs052.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -265,7 +273,7 @@ The basic idea is to set up weights which will be used to scale the correctly cl $$ -\mathrm{err}=\frac{\sum_{i=0}^{n-1}w_iI(y_i\ne G(x_i})}{\sum_{i=0}^{n-1}w_i}, +\mathrm{\overline{err}}_m=\frac{\sum_{i=0}^{n-1}w_i^m I(y_i\ne G(x_i))}{\sum_{i=0}^{n-1}w_i}, $$ @@ -275,7 +283,7 @@ $$
    1. Fit then a given classifier to the training using the weights \( w_i \).
    2. Compute then \( \mathrm{err} \) and figure out which events are classified properly and which are classified wrongly.
    3. -
    4. Define a quantity \( \alpha_{m} = \log{(1-\mathrm{err})/\mathrm{err}} \)
    5. +
    6. Define a quantity \( \alpha_{m} = \log{(1-\mathrm{\overline{err}}_m)/\mathrm{\overline{err}}_m} \)
    7. Set the new weights to \( w_i = w_i\times \exp{(\alpha_m I(y_i\ne G(x_i)} \).
    @@ -313,6 +321,7 @@ observations that are missed in the previous iterations.
  • 58
  • 59
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs053.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs053.html index ee603a5aa..85f3962ed 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs053.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs053.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -305,6 +313,7 @@ plt.show()
  • 58
  • 59
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs054.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs054.html index d9a967a93..06730e732 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs054.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs054.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -265,6 +273,9 @@ In order to understand the method, let us illustrate its basics by bringing back the essential steps in linear regression, where our cost function was the least squares function. +

    +See discussion during lecture November 8. +

    @@ -286,6 +297,7 @@ function was the least squares function.

  • 58
  • 59
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs055.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs055.html index 29892cfcd..c7df4254c 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs055.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs055.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -269,7 +277,7 @@ The way we proceed in an iterative fashion is to
  • For \( m=1:M \), we
      -
    1. compute the negative gradient vector \( \boldsymbol{u}_m = -\partial C(\boldsymbol{y},\boldsymbol{f})/\partial \boldsymbol{f}(x) \) at $f(x) = f_{m-1}(x);
    2. +
    3. compute the negative gradient vector \( \boldsymbol{u}_m = -\partial C(\boldsymbol{y},\boldsymbol{f})/\partial \boldsymbol{f}(x) \) at \( f(x) = f_{m-1}(x) \);
    4. fit the so-called base-learner to the negative gradient \( h_m(u_m,x) \);
    5. update the estimate \( f_m(x) = f_{m-1}(x)+\nu h_m(u_m,x) \);
    @@ -296,6 +304,7 @@ The way we proceed in an iterative fashion is to
  • 58
  • 59
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs056.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs056.html index 3f89e4212..dce64e77d 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs056.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs056.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -253,91 +261,54 @@ MathJax.Hub.Config({ -

    Gradient Boosting, Examples

    +

    Gradient Boosting, Examples of Regression

    -

    np.random.seed(42)
    -X = np.random.rand(100, 1) - 0.5
    -y = 3*X[:, 0]**2 + 0.05 * np.random.randn(100)
    -
    -from sklearn.tree import DecisionTreeRegressor
    -
    -tree_reg1 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg1.fit(X, y)
    -
    -y2 = y - tree_reg1.predict(X)
    -tree_reg2 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg2.fit(X, y2)
    -
    -y3 = y2 - tree_reg2.predict(X)
    -tree_reg3 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg3.fit(X, y3)
    -
    -X_new = np.array([[0.8]])
    -y_pred = sum(tree.predict(X_new) for tree in (tree_reg1, tree_reg2, tree_reg3))
    -
    -def plot_predictions(regressors, X, y, axes, label=None, style="r-", data_style="b.", data_label=None):
    -    x1 = np.linspace(axes[0], axes[1], 500)
    -    y_pred = sum(regressor.predict(x1.reshape(-1, 1)) for regressor in regressors)
    -    plt.plot(X[:, 0], y, data_style, label=data_label)
    -    plt.plot(x1, y_pred, style, linewidth=2, label=label)
    -    if label or data_label:
    -        plt.legend(loc="upper center", fontsize=16)
    -    plt.axis(axes)
    -
    -plt.figure(figsize=(11,11))
    -
    -plt.subplot(321)
    -plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h_1(x_1)$", style="g-", data_label="Training set")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -plt.title("Residuals and tree predictions", fontsize=16)
    -
    -plt.subplot(322)
    -plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1)$", data_label="Training set")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -plt.title("Ensemble predictions", fontsize=16)
    -
    -plt.subplot(323)
    -plot_predictions([tree_reg2], X, y2, axes=[-0.5, 0.5, -0.5, 0.5], label="$h_2(x_1)$", style="g-", data_style="k+", data_label="Residuals")
    -plt.ylabel("$y - h_1(x_1)$", fontsize=16)
    -
    -plt.subplot(324)
    -plot_predictions([tree_reg1, tree_reg2], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1) + h_2(x_1)$")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -
    -plt.subplot(325)
    -plot_predictions([tree_reg3], X, y3, axes=[-0.5, 0.5, -0.5, 0.5], label="$h_3(x_1)$", style="g-", data_style="k+")
    -plt.ylabel("$y - h_1(x_1) - h_2(x_1)$", fontsize=16)
    -plt.xlabel("$x_1$", fontsize=16)
    -
    -plt.subplot(326)
    -plot_predictions([tree_reg1, tree_reg2, tree_reg3], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1) + h_2(x_1) + h_3(x_1)$")
    -plt.xlabel("$x_1$", fontsize=16)
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -
    -save_fig("gradient_boosting_plot")
    -plt.show()
    -
    +
    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import train_test_split
     from sklearn.ensemble import GradientBoostingRegressor
    +from sklearn.preprocessing import StandardScaler
    +import scikitplot as skplt
    +from sklearn.metrics import mean_squared_error
     
    -gbrt = GradientBoostingRegressor(max_depth=2, n_estimators=3, learning_rate=1.0, random_state=42)
    -gbrt.fit(X, y)
    +n = 100
    +maxdegree = 6
     
    -gbrt_slow = GradientBoostingRegressor(max_depth=2, n_estimators=200, learning_rate=0.1, random_state=42)
    -gbrt_slow.fit(X, y)
    +# Make data set.
    +x = np.linspace(-3, 3, n).reshape(-1, 1)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape)
     
    -plt.figure(figsize=(11,4))
    +error = np.zeros(maxdegree)
    +bias = np.zeros(maxdegree)
    +variance = np.zeros(maxdegree)
    +polydegree = np.zeros(maxdegree)
    +X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2)
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
     
    -plt.subplot(121)
    -plot_predictions([gbrt], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="Ensemble predictions")
    -plt.title("learning_rate={}, n_estimators={}".format(gbrt.learning_rate, gbrt.n_estimators), fontsize=14)
    +for degree in range(1,maxdegree):
    +    model = GradientBoostingRegressor(max_depth=degree, n_estimators=100, learning_rate=1.0)  
    +    model.fit(X_train_scaled,y_train)
    +    y_pred = model.predict(X_test_scaled)
    +    polydegree[degree] = degree
    +    error[degree] = np.mean( np.mean((y_test - y_pred)**2) )
    +    bias[degree] = np.mean( (y_test - np.mean(y_pred))**2 )
    +    variance[degree] = np.mean( np.var(y_pred) )
    +    print('Max depth:', degree)
    +    print('Error:', error[degree])
    +    print('Bias^2:', bias[degree])
    +    print('Var:', variance[degree])
    +    print('{} >= {} + {} = {}'.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree]))
     
    -plt.subplot(122)
    -plot_predictions([gbrt_slow], X, y, axes=[-0.5, 0.5, -0.1, 0.8])
    -plt.title("learning_rate={}, n_estimators={}".format(gbrt_slow.learning_rate, gbrt_slow.n_estimators), fontsize=14)
    -
    -save_fig("gbrt_learning_rate_plot")
    +plt.xlim(1,maxdegree-1)
    +plt.plot(polydegree, error, label='Error')
    +plt.plot(polydegree, bias, label='bias')
    +plt.plot(polydegree, variance, label='Variance')
    +plt.legend()
     plt.show()
     

    @@ -359,6 +330,7 @@ plt.show()

  • 58
  • 59
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs057.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs057.html index ed0000d63..92b6b8885 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs057.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs057.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -253,24 +261,48 @@ MathJax.Hub.Config({ -

    XGBoost: Extreme Gradient Boosting

    - +

    Gradient Boosting, Examples of Classification

    -XGBoost or Extreme Gradient -Boosting, is an optimized distributed gradient boosting library -designed to be highly efficient, flexible and portable. It implements -machine learning algorithms under the Gradient Boosting -framework. XGBoost provides a parallel tree boosting that solve many -data science problems in a fast and accurate way. See the article by Chen and Guestrin. -

    -The authors design and build a highly scalable end-to-end tree -boosting system. It has a theoretically justified weighted quantile -sketch for efficient proposal calculation. It introduces a novel sparsity-aware algorithm for parallel tree learning and an effective cache-aware block structure for out-of-core tree learning. + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +import scikitplot as skplt
    +from sklearn.ensemble import GradientBoostingClassifier
    +from sklearn.model_selection import cross_validate
     
    -

    -It is now the algorithm which wins essentially all ML competitions!!! +# Load the data +cancer = load_breast_cancer() +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0) +print(X_train.shape) +print(X_test.shape) +#now scale the data +from sklearn.preprocessing import StandardScaler +scaler = StandardScaler() +scaler.fit(X_train) +X_train_scaled = scaler.transform(X_train) +X_test_scaled = scaler.transform(X_test) + +gd_clf = GradientBoostingClassifier(max_depth=3, n_estimators=100, learning_rate=1.0) +gd_clf.fit(X_train_scaled, y_train) +#Cross validation +accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=10)['test_score'] +print(accuracy) +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(gd_clf.score(X_test_scaled,y_test))) + +import scikitplot as skplt +y_pred = gd_clf.predict(X_test_scaled) +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +plt.show() +y_probas = gd_clf.predict_proba(X_test_scaled) +skplt.metrics.plot_roc(y_test, y_probas) +plt.show() +skplt.metrics.plot_cumulative_gain(y_test, y_probas) +plt.show() +

    @@ -289,6 +321,7 @@ It is now the algorithm which wins essentially all ML competitions!!!

  • 58
  • 59
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/DecisionTrees-bs.html b/doc/pub/DecisionTrees/html/DecisionTrees-bs.html index d31b30fcf..e0e5b5550 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees-bs.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees-bs.html @@ -138,10 +138,17 @@ Automatically generated HTML file from DocOnce source ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -234,10 +241,11 @@ MathJax.Hub.Config({
  • AdaBoost Examples
  • Gradient boosting: Basics
  • Gradient Boosting, algorithm
  • -
  • Gradient Boosting, Examples
  • -
  • XGBoost: Extreme Gradient Boosting
  • -
  • Regression Case
  • -
  • Xgboost on the Cancer Data
  • +
  • Gradient Boosting, Examples of Regression
  • +
  • Gradient Boosting, Examples of Classification
  • +
  • XGBoost: Extreme Gradient Boosting
  • +
  • Regression Case
  • +
  • Xgboost on the Cancer Data
  • @@ -296,7 +304,7 @@ MathJax.Hub.Config({
  • 9
  • 10
  • ...
  • -
  • 60
  • +
  • 61
  • »
  • diff --git a/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html b/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html index cb3a30ebc..64672f5a8 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html @@ -2150,7 +2150,7 @@ $$ where we have redefined the error as

     
    $$ -\mathrm{\overline{err}}_m=\frac{1}{n}\frac{\sum_{i=0}^{n-1}w_i^mI(y_i\ne G(\boldsymbol{X}_{i*})}{\sum_{i=0}^{n-1}w_i^m}, +\mathrm{\overline{err}}_m=\frac{1}{n}\frac{\sum_{i=0}^{n-1}w_i^mI(y_i\ne G(x_i)}{\sum_{i=0}^{n-1}w_i^m}, $$

     
    @@ -2207,7 +2207,7 @@ The basic idea is to set up weights which will be used to scale the correctly cl

     
    $$ -\mathrm{err}=\frac{\sum_{i=0}^{n-1}w_iI(y_i\ne G(x_i})}{\sum_{i=0}^{n-1}w_i}, +\mathrm{\overline{err}}_m=\frac{\sum_{i=0}^{n-1}w_i^m I(y_i\ne G(x_i))}{\sum_{i=0}^{n-1}w_i}, $$

     
    @@ -2218,7 +2218,7 @@ $$

    1. Fit then a given classifier to the training using the weights \( w_i \).
    2. Compute then \( \mathrm{err} \) and figure out which events are classified properly and which are classified wrongly.
    3. -

    4. Define a quantity \( \alpha_{m} = \log{(1-\mathrm{err})/\mathrm{err}} \)
    5. +

    6. Define a quantity \( \alpha_{m} = \log{(1-\mathrm{\overline{err}}_m)/\mathrm{\overline{err}}_m} \)
    7. Set the new weights to \( w_i = w_i\times \exp{(\alpha_m I(y_i\ne G(x_i)} \).

  • Compute the new classifier \( G(x)= \sum_{i=0}^{n-1}\alpha_m I(y_i\ne G(x_i) \).
  • @@ -2281,6 +2281,9 @@ method via a series of iterations. In order to understand the method, let us illustrate its basics by bringing back the essential steps in linear regression, where our cost function was the least squares function. + +

    +See discussion during lecture November 8. @@ -2303,7 +2306,7 @@ The way we proceed in an iterative fashion is to

  • For \( m=1:M \), we
      -

    1. compute the negative gradient vector \( \boldsymbol{u}_m = -\partial C(\boldsymbol{y},\boldsymbol{f})/\partial \boldsymbol{f}(x) \) at $f(x) = f_{m-1}(x);
    2. +

    3. compute the negative gradient vector \( \boldsymbol{u}_m = -\partial C(\boldsymbol{y},\boldsymbol{f})/\partial \boldsymbol{f}(x) \) at \( f(x) = f_{m-1}(x) \);
    4. fit the so-called base-learner to the negative gradient \( h_m(u_m,x) \);
    5. update the estimate \( f_m(x) = f_{m-1}(x)+\nu h_m(u_m,x) \);
    @@ -2313,98 +2316,107 @@ The way we proceed in an iterative fashion is to
    -

    Gradient Boosting, Examples

    +

    Gradient Boosting, Examples of Regression

    -

    np.random.seed(42)
    -X = np.random.rand(100, 1) - 0.5
    -y = 3*X[:, 0]**2 + 0.05 * np.random.randn(100)
    -
    -from sklearn.tree import DecisionTreeRegressor
    -
    -tree_reg1 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg1.fit(X, y)
    -
    -y2 = y - tree_reg1.predict(X)
    -tree_reg2 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg2.fit(X, y2)
    -
    -y3 = y2 - tree_reg2.predict(X)
    -tree_reg3 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg3.fit(X, y3)
    -
    -X_new = np.array([[0.8]])
    -y_pred = sum(tree.predict(X_new) for tree in (tree_reg1, tree_reg2, tree_reg3))
    -
    -def plot_predictions(regressors, X, y, axes, label=None, style="r-", data_style="b.", data_label=None):
    -    x1 = np.linspace(axes[0], axes[1], 500)
    -    y_pred = sum(regressor.predict(x1.reshape(-1, 1)) for regressor in regressors)
    -    plt.plot(X[:, 0], y, data_style, label=data_label)
    -    plt.plot(x1, y_pred, style, linewidth=2, label=label)
    -    if label or data_label:
    -        plt.legend(loc="upper center", fontsize=16)
    -    plt.axis(axes)
    -
    -plt.figure(figsize=(11,11))
    -
    -plt.subplot(321)
    -plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h_1(x_1)$", style="g-", data_label="Training set")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -plt.title("Residuals and tree predictions", fontsize=16)
    -
    -plt.subplot(322)
    -plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1)$", data_label="Training set")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -plt.title("Ensemble predictions", fontsize=16)
    -
    -plt.subplot(323)
    -plot_predictions([tree_reg2], X, y2, axes=[-0.5, 0.5, -0.5, 0.5], label="$h_2(x_1)$", style="g-", data_style="k+", data_label="Residuals")
    -plt.ylabel("$y - h_1(x_1)$", fontsize=16)
    -
    -plt.subplot(324)
    -plot_predictions([tree_reg1, tree_reg2], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1) + h_2(x_1)$")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -
    -plt.subplot(325)
    -plot_predictions([tree_reg3], X, y3, axes=[-0.5, 0.5, -0.5, 0.5], label="$h_3(x_1)$", style="g-", data_style="k+")
    -plt.ylabel("$y - h_1(x_1) - h_2(x_1)$", fontsize=16)
    -plt.xlabel("$x_1$", fontsize=16)
    -
    -plt.subplot(326)
    -plot_predictions([tree_reg1, tree_reg2, tree_reg3], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1) + h_2(x_1) + h_3(x_1)$")
    -plt.xlabel("$x_1$", fontsize=16)
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -
    -save_fig("gradient_boosting_plot")
    -plt.show()
    -
    +
    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import train_test_split
     from sklearn.ensemble import GradientBoostingRegressor
    +from sklearn.preprocessing import StandardScaler
    +import scikitplot as skplt
    +from sklearn.metrics import mean_squared_error
     
    -gbrt = GradientBoostingRegressor(max_depth=2, n_estimators=3, learning_rate=1.0, random_state=42)
    -gbrt.fit(X, y)
    +n = 100
    +maxdegree = 6
     
    -gbrt_slow = GradientBoostingRegressor(max_depth=2, n_estimators=200, learning_rate=0.1, random_state=42)
    -gbrt_slow.fit(X, y)
    +# Make data set.
    +x = np.linspace(-3, 3, n).reshape(-1, 1)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape)
     
    -plt.figure(figsize=(11,4))
    +error = np.zeros(maxdegree)
    +bias = np.zeros(maxdegree)
    +variance = np.zeros(maxdegree)
    +polydegree = np.zeros(maxdegree)
    +X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2)
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
     
    -plt.subplot(121)
    -plot_predictions([gbrt], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="Ensemble predictions")
    -plt.title("learning_rate={}, n_estimators={}".format(gbrt.learning_rate, gbrt.n_estimators), fontsize=14)
    +for degree in range(1,maxdegree):
    +    model = GradientBoostingRegressor(max_depth=degree, n_estimators=100, learning_rate=1.0)  
    +    model.fit(X_train_scaled,y_train)
    +    y_pred = model.predict(X_test_scaled)
    +    polydegree[degree] = degree
    +    error[degree] = np.mean( np.mean((y_test - y_pred)**2) )
    +    bias[degree] = np.mean( (y_test - np.mean(y_pred))**2 )
    +    variance[degree] = np.mean( np.var(y_pred) )
    +    print('Max depth:', degree)
    +    print('Error:', error[degree])
    +    print('Bias^2:', bias[degree])
    +    print('Var:', variance[degree])
    +    print('{} >= {} + {} = {}'.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree]))
     
    -plt.subplot(122)
    -plot_predictions([gbrt_slow], X, y, axes=[-0.5, 0.5, -0.1, 0.8])
    -plt.title("learning_rate={}, n_estimators={}".format(gbrt_slow.learning_rate, gbrt_slow.n_estimators), fontsize=14)
    -
    -save_fig("gbrt_learning_rate_plot")
    +plt.xlim(1,maxdegree-1)
    +plt.plot(polydegree, error, label='Error')
    +plt.plot(polydegree, bias, label='bias')
    +plt.plot(polydegree, variance, label='Variance')
    +plt.legend()
     plt.show()
     
    -

    XGBoost: Extreme Gradient Boosting

    +

    Gradient Boosting, Examples of Classification

    +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +import scikitplot as skplt
    +from sklearn.ensemble import GradientBoostingClassifier
    +from sklearn.model_selection import cross_validate
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +
    +gd_clf = GradientBoostingClassifier(max_depth=3, n_estimators=100, learning_rate=1.0)  
    +gd_clf.fit(X_train_scaled, y_train)
    +#Cross validation
    +accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=10)['test_score']
    +print(accuracy)
    +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(gd_clf.score(X_test_scaled,y_test)))
    +
    +import scikitplot as skplt
    +y_pred = gd_clf.predict(X_test_scaled)
    +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)
    +plt.show()
    +y_probas = gd_clf.predict_proba(X_test_scaled)
    +skplt.metrics.plot_roc(y_test, y_probas)
    +plt.show()
    +skplt.metrics.plot_cumulative_gain(y_test, y_probas)
    +plt.show()
    +
    +
    + + +
    +

    XGBoost: Extreme Gradient Boosting

    XGBoost or Extreme Gradient @@ -2425,7 +2437,7 @@ It is now the algorithm which wins essentially all ML competitions!!!

    -

    Regression Case

    +

    Regression Case

    @@ -2456,8 +2468,8 @@ X_train_scaled = scaler.transform(X_train) X_test_scaled = scaler.transform(X_test) for degree in range(maxdegree): - model = xgb.XGBRegressor(objective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1, - max_depth = degree, alpha = 10, n_estimators = 10) + model = xgb.XGBRegressor(objective ='reg:squarederror', colsaobjective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1,max_depth = degree, alpha = 10, n_estimators = 200) + model.fit(X_train_scaled,y_train) y_pred = model.predict(X_test_scaled) polydegree[degree] = degree @@ -2481,7 +2493,7 @@ plt.show()

    -

    Xgboost on the Cancer Data

    +

    Xgboost on the Cancer Data

    @@ -2508,9 +2520,26 @@ X_test_scaled = scaler.transform(X_test) xg_clf = xgb.XGBClassifier() xg_clf.fit(X_train_scaled,y_train) + +y_test = xg_clf.predict(X_test_scaled) + +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(xg_clf.score(X_test_scaled,y_test))) + +import scikitplot as skplt +y_pred = xg_clf.predict(X_test_scaled) +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +plt.show() +y_probas = xg_clf.predict_proba(X_test_scaled) +skplt.metrics.plot_roc(y_test, y_probas) +plt.show() +skplt.metrics.plot_cumulative_gain(y_test, y_probas) +plt.show() + + xgb.plot_tree(xg_clf,num_trees=0) plt.rcParams['figure.figsize'] = [50, 10] plt.show() + xgb.plot_importance(xg_clf) plt.rcParams['figure.figsize'] = [5, 5] plt.show() diff --git a/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html b/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html index 8c73017c1..70eb4082b 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html @@ -158,10 +158,17 @@ div { text-align: justify; text-justify: inter-word; } ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -2120,7 +2127,7 @@ $$ where we have redefined the error as $$ -\mathrm{\overline{err}}_m=\frac{1}{n}\frac{\sum_{i=0}^{n-1}w_i^mI(y_i\ne G(\boldsymbol{X}_{i*})}{\sum_{i=0}^{n-1}w_i^m}, +\mathrm{\overline{err}}_m=\frac{1}{n}\frac{\sum_{i=0}^{n-1}w_i^mI(y_i\ne G(x_i)}{\sum_{i=0}^{n-1}w_i^m}, $$ which leads to an update of @@ -2169,7 +2176,7 @@ The basic idea is to set up weights which will be used to scale the correctly cl $$ -\mathrm{err}=\frac{\sum_{i=0}^{n-1}w_iI(y_i\ne G(x_i})}{\sum_{i=0}^{n-1}w_i}, +\mathrm{\overline{err}}_m=\frac{\sum_{i=0}^{n-1}w_i^m I(y_i\ne G(x_i))}{\sum_{i=0}^{n-1}w_i}, $$ @@ -2179,7 +2186,7 @@ $$

    1. Fit then a given classifier to the training using the weights \( w_i \).
    2. Compute then \( \mathrm{err} \) and figure out which events are classified properly and which are classified wrongly.
    3. -
    4. Define a quantity \( \alpha_{m} = \log{(1-\mathrm{err})/\mathrm{err}} \)
    5. +
    6. Define a quantity \( \alpha_{m} = \log{(1-\mathrm{\overline{err}}_m)/\mathrm{\overline{err}}_m} \)
    7. Set the new weights to \( w_i = w_i\times \exp{(\alpha_m I(y_i\ne G(x_i)} \).
    @@ -2242,6 +2249,9 @@ In order to understand the method, let us illustrate its basics by bringing back the essential steps in linear regression, where our cost function was the least squares function. +

    +See discussion during lecture November 8. +











    @@ -2261,7 +2271,7 @@ The way we proceed in an iterative fashion is to

  • For \( m=1:M \), we
      -
    1. compute the negative gradient vector \( \boldsymbol{u}_m = -\partial C(\boldsymbol{y},\boldsymbol{f})/\partial \boldsymbol{f}(x) \) at $f(x) = f_{m-1}(x);
    2. +
    3. compute the negative gradient vector \( \boldsymbol{u}_m = -\partial C(\boldsymbol{y},\boldsymbol{f})/\partial \boldsymbol{f}(x) \) at \( f(x) = f_{m-1}(x) \);
    4. fit the so-called base-learner to the negative gradient \( h_m(u_m,x) \);
    5. update the estimate \( f_m(x) = f_{m-1}(x)+\nu h_m(u_m,x) \);
    @@ -2271,97 +2281,105 @@ The way we proceed in an iterative fashion is to









    -

    Gradient Boosting, Examples

    +

    Gradient Boosting, Examples of Regression

    -

    np.random.seed(42)
    -X = np.random.rand(100, 1) - 0.5
    -y = 3*X[:, 0]**2 + 0.05 * np.random.randn(100)
    -
    -from sklearn.tree import DecisionTreeRegressor
    -
    -tree_reg1 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg1.fit(X, y)
    -
    -y2 = y - tree_reg1.predict(X)
    -tree_reg2 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg2.fit(X, y2)
    -
    -y3 = y2 - tree_reg2.predict(X)
    -tree_reg3 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg3.fit(X, y3)
    -
    -X_new = np.array([[0.8]])
    -y_pred = sum(tree.predict(X_new) for tree in (tree_reg1, tree_reg2, tree_reg3))
    -
    -def plot_predictions(regressors, X, y, axes, label=None, style="r-", data_style="b.", data_label=None):
    -    x1 = np.linspace(axes[0], axes[1], 500)
    -    y_pred = sum(regressor.predict(x1.reshape(-1, 1)) for regressor in regressors)
    -    plt.plot(X[:, 0], y, data_style, label=data_label)
    -    plt.plot(x1, y_pred, style, linewidth=2, label=label)
    -    if label or data_label:
    -        plt.legend(loc="upper center", fontsize=16)
    -    plt.axis(axes)
    -
    -plt.figure(figsize=(11,11))
    -
    -plt.subplot(321)
    -plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h_1(x_1)$", style="g-", data_label="Training set")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -plt.title("Residuals and tree predictions", fontsize=16)
    -
    -plt.subplot(322)
    -plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1)$", data_label="Training set")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -plt.title("Ensemble predictions", fontsize=16)
    -
    -plt.subplot(323)
    -plot_predictions([tree_reg2], X, y2, axes=[-0.5, 0.5, -0.5, 0.5], label="$h_2(x_1)$", style="g-", data_style="k+", data_label="Residuals")
    -plt.ylabel("$y - h_1(x_1)$", fontsize=16)
    -
    -plt.subplot(324)
    -plot_predictions([tree_reg1, tree_reg2], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1) + h_2(x_1)$")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -
    -plt.subplot(325)
    -plot_predictions([tree_reg3], X, y3, axes=[-0.5, 0.5, -0.5, 0.5], label="$h_3(x_1)$", style="g-", data_style="k+")
    -plt.ylabel("$y - h_1(x_1) - h_2(x_1)$", fontsize=16)
    -plt.xlabel("$x_1$", fontsize=16)
    -
    -plt.subplot(326)
    -plot_predictions([tree_reg1, tree_reg2, tree_reg3], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1) + h_2(x_1) + h_3(x_1)$")
    -plt.xlabel("$x_1$", fontsize=16)
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -
    -save_fig("gradient_boosting_plot")
    -plt.show()
    -
    +
    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import train_test_split
     from sklearn.ensemble import GradientBoostingRegressor
    +from sklearn.preprocessing import StandardScaler
    +import scikitplot as skplt
    +from sklearn.metrics import mean_squared_error
     
    -gbrt = GradientBoostingRegressor(max_depth=2, n_estimators=3, learning_rate=1.0, random_state=42)
    -gbrt.fit(X, y)
    +n = 100
    +maxdegree = 6
     
    -gbrt_slow = GradientBoostingRegressor(max_depth=2, n_estimators=200, learning_rate=0.1, random_state=42)
    -gbrt_slow.fit(X, y)
    +# Make data set.
    +x = np.linspace(-3, 3, n).reshape(-1, 1)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape)
     
    -plt.figure(figsize=(11,4))
    +error = np.zeros(maxdegree)
    +bias = np.zeros(maxdegree)
    +variance = np.zeros(maxdegree)
    +polydegree = np.zeros(maxdegree)
    +X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2)
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
     
    -plt.subplot(121)
    -plot_predictions([gbrt], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="Ensemble predictions")
    -plt.title("learning_rate={}, n_estimators={}".format(gbrt.learning_rate, gbrt.n_estimators), fontsize=14)
    +for degree in range(1,maxdegree):
    +    model = GradientBoostingRegressor(max_depth=degree, n_estimators=100, learning_rate=1.0)  
    +    model.fit(X_train_scaled,y_train)
    +    y_pred = model.predict(X_test_scaled)
    +    polydegree[degree] = degree
    +    error[degree] = np.mean( np.mean((y_test - y_pred)**2) )
    +    bias[degree] = np.mean( (y_test - np.mean(y_pred))**2 )
    +    variance[degree] = np.mean( np.var(y_pred) )
    +    print('Max depth:', degree)
    +    print('Error:', error[degree])
    +    print('Bias^2:', bias[degree])
    +    print('Var:', variance[degree])
    +    print('{} >= {} + {} = {}'.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree]))
     
    -plt.subplot(122)
    -plot_predictions([gbrt_slow], X, y, axes=[-0.5, 0.5, -0.1, 0.8])
    -plt.title("learning_rate={}, n_estimators={}".format(gbrt_slow.learning_rate, gbrt_slow.n_estimators), fontsize=14)
    -
    -save_fig("gbrt_learning_rate_plot")
    +plt.xlim(1,maxdegree-1)
    +plt.plot(polydegree, error, label='Error')
    +plt.plot(polydegree, bias, label='bias')
    +plt.plot(polydegree, variance, label='Variance')
    +plt.legend()
     plt.show()
     











    -

    XGBoost: Extreme Gradient Boosting

    +

    Gradient Boosting, Examples of Classification

    +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +import scikitplot as skplt
    +from sklearn.ensemble import GradientBoostingClassifier
    +from sklearn.model_selection import cross_validate
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +
    +gd_clf = GradientBoostingClassifier(max_depth=3, n_estimators=100, learning_rate=1.0)  
    +gd_clf.fit(X_train_scaled, y_train)
    +#Cross validation
    +accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=10)['test_score']
    +print(accuracy)
    +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(gd_clf.score(X_test_scaled,y_test)))
    +
    +import scikitplot as skplt
    +y_pred = gd_clf.predict(X_test_scaled)
    +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)
    +plt.show()
    +y_probas = gd_clf.predict_proba(X_test_scaled)
    +skplt.metrics.plot_roc(y_test, y_probas)
    +plt.show()
    +skplt.metrics.plot_cumulative_gain(y_test, y_probas)
    +plt.show()
    +
    +

    +









    + +

    XGBoost: Extreme Gradient Boosting

    XGBoost or Extreme Gradient @@ -2382,7 +2400,7 @@ It is now the algorithm which wins essentially all ML competitions!!!











    -

    Regression Case

    +

    Regression Case

    @@ -2413,8 +2431,8 @@ X_train_scaled = scaler.transform(X_train) X_test_scaled = scaler.transform(X_test) for degree in range(maxdegree): - model = xgb.XGBRegressor(objective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1, - max_depth = degree, alpha = 10, n_estimators = 10) + model = xgb.XGBRegressor(objective ='reg:squarederror', colsaobjective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1,max_depth = degree, alpha = 10, n_estimators = 200) + model.fit(X_train_scaled,y_train) y_pred = model.predict(X_test_scaled) polydegree[degree] = degree @@ -2437,7 +2455,7 @@ plt.show()











    -

    Xgboost on the Cancer Data

    +

    Xgboost on the Cancer Data

    @@ -2464,9 +2482,26 @@ X_test_scaled = scaler.transform(X_test) xg_clf = xgb.XGBClassifier() xg_clf.fit(X_train_scaled,y_train) + +y_test = xg_clf.predict(X_test_scaled) + +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(xg_clf.score(X_test_scaled,y_test))) + +import scikitplot as skplt +y_pred = xg_clf.predict(X_test_scaled) +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +plt.show() +y_probas = xg_clf.predict_proba(X_test_scaled) +skplt.metrics.plot_roc(y_test, y_probas) +plt.show() +skplt.metrics.plot_cumulative_gain(y_test, y_probas) +plt.show() + + xgb.plot_tree(xg_clf,num_trees=0) plt.rcParams['figure.figsize'] = [50, 10] plt.show() + xgb.plot_importance(xg_clf) plt.rcParams['figure.figsize'] = [5, 5] plt.show() diff --git a/doc/pub/DecisionTrees/html/DecisionTrees.html b/doc/pub/DecisionTrees/html/DecisionTrees.html index a396507d9..a0192166f 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees.html @@ -163,10 +163,17 @@ div { text-align: justify; text-justify: inter-word; } ('AdaBoost Examples', 2, None, '___sec52'), ('Gradient boosting: Basics', 2, None, '___sec53'), ('Gradient Boosting, algorithm', 2, None, '___sec54'), - ('Gradient Boosting, Examples', 2, None, '___sec55'), - ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec56'), - ('Regression Case', 2, None, '___sec57'), - ('Xgboost on the Cancer Data', 2, None, '___sec58')]} + ('Gradient Boosting, Examples of Regression', + 2, + None, + '___sec55'), + ('Gradient Boosting, Examples of Classification', + 2, + None, + '___sec56'), + ('XGBoost: Extreme Gradient Boosting', 2, None, '___sec57'), + ('Regression Case', 2, None, '___sec58'), + ('Xgboost on the Cancer Data', 2, None, '___sec59')]} end of tocinfo --> @@ -2125,7 +2132,7 @@ $$ where we have redefined the error as $$ -\mathrm{\overline{err}}_m=\frac{1}{n}\frac{\sum_{i=0}^{n-1}w_i^mI(y_i\ne G(\boldsymbol{X}_{i*})}{\sum_{i=0}^{n-1}w_i^m}, +\mathrm{\overline{err}}_m=\frac{1}{n}\frac{\sum_{i=0}^{n-1}w_i^mI(y_i\ne G(x_i)}{\sum_{i=0}^{n-1}w_i^m}, $$ which leads to an update of @@ -2174,7 +2181,7 @@ The basic idea is to set up weights which will be used to scale the correctly cl $$ -\mathrm{err}=\frac{\sum_{i=0}^{n-1}w_iI(y_i\ne G(x_i})}{\sum_{i=0}^{n-1}w_i}, +\mathrm{\overline{err}}_m=\frac{\sum_{i=0}^{n-1}w_i^m I(y_i\ne G(x_i))}{\sum_{i=0}^{n-1}w_i}, $$ @@ -2184,7 +2191,7 @@ $$

    1. Fit then a given classifier to the training using the weights \( w_i \).
    2. Compute then \( \mathrm{err} \) and figure out which events are classified properly and which are classified wrongly.
    3. -
    4. Define a quantity \( \alpha_{m} = \log{(1-\mathrm{err})/\mathrm{err}} \)
    5. +
    6. Define a quantity \( \alpha_{m} = \log{(1-\mathrm{\overline{err}}_m)/\mathrm{\overline{err}}_m} \)
    7. Set the new weights to \( w_i = w_i\times \exp{(\alpha_m I(y_i\ne G(x_i)} \).
    @@ -2247,6 +2254,9 @@ In order to understand the method, let us illustrate its basics by bringing back the essential steps in linear regression, where our cost function was the least squares function. +

    +See discussion during lecture November 8. +











    @@ -2266,7 +2276,7 @@ The way we proceed in an iterative fashion is to

  • For \( m=1:M \), we
      -
    1. compute the negative gradient vector \( \boldsymbol{u}_m = -\partial C(\boldsymbol{y},\boldsymbol{f})/\partial \boldsymbol{f}(x) \) at $f(x) = f_{m-1}(x);
    2. +
    3. compute the negative gradient vector \( \boldsymbol{u}_m = -\partial C(\boldsymbol{y},\boldsymbol{f})/\partial \boldsymbol{f}(x) \) at \( f(x) = f_{m-1}(x) \);
    4. fit the so-called base-learner to the negative gradient \( h_m(u_m,x) \);
    5. update the estimate \( f_m(x) = f_{m-1}(x)+\nu h_m(u_m,x) \);
    @@ -2276,97 +2286,105 @@ The way we proceed in an iterative fashion is to









    -

    Gradient Boosting, Examples

    +

    Gradient Boosting, Examples of Regression

    -

    np.random.seed(42)
    -X = np.random.rand(100, 1) - 0.5
    -y = 3*X[:, 0]**2 + 0.05 * np.random.randn(100)
    -
    -from sklearn.tree import DecisionTreeRegressor
    -
    -tree_reg1 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg1.fit(X, y)
    -
    -y2 = y - tree_reg1.predict(X)
    -tree_reg2 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg2.fit(X, y2)
    -
    -y3 = y2 - tree_reg2.predict(X)
    -tree_reg3 = DecisionTreeRegressor(max_depth=2, random_state=42)
    -tree_reg3.fit(X, y3)
    -
    -X_new = np.array([[0.8]])
    -y_pred = sum(tree.predict(X_new) for tree in (tree_reg1, tree_reg2, tree_reg3))
    -
    -def plot_predictions(regressors, X, y, axes, label=None, style="r-", data_style="b.", data_label=None):
    -    x1 = np.linspace(axes[0], axes[1], 500)
    -    y_pred = sum(regressor.predict(x1.reshape(-1, 1)) for regressor in regressors)
    -    plt.plot(X[:, 0], y, data_style, label=data_label)
    -    plt.plot(x1, y_pred, style, linewidth=2, label=label)
    -    if label or data_label:
    -        plt.legend(loc="upper center", fontsize=16)
    -    plt.axis(axes)
    -
    -plt.figure(figsize=(11,11))
    -
    -plt.subplot(321)
    -plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h_1(x_1)$", style="g-", data_label="Training set")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -plt.title("Residuals and tree predictions", fontsize=16)
    -
    -plt.subplot(322)
    -plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1)$", data_label="Training set")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -plt.title("Ensemble predictions", fontsize=16)
    -
    -plt.subplot(323)
    -plot_predictions([tree_reg2], X, y2, axes=[-0.5, 0.5, -0.5, 0.5], label="$h_2(x_1)$", style="g-", data_style="k+", data_label="Residuals")
    -plt.ylabel("$y - h_1(x_1)$", fontsize=16)
    -
    -plt.subplot(324)
    -plot_predictions([tree_reg1, tree_reg2], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1) + h_2(x_1)$")
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -
    -plt.subplot(325)
    -plot_predictions([tree_reg3], X, y3, axes=[-0.5, 0.5, -0.5, 0.5], label="$h_3(x_1)$", style="g-", data_style="k+")
    -plt.ylabel("$y - h_1(x_1) - h_2(x_1)$", fontsize=16)
    -plt.xlabel("$x_1$", fontsize=16)
    -
    -plt.subplot(326)
    -plot_predictions([tree_reg1, tree_reg2, tree_reg3], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1) + h_2(x_1) + h_3(x_1)$")
    -plt.xlabel("$x_1$", fontsize=16)
    -plt.ylabel("$y$", fontsize=16, rotation=0)
    -
    -save_fig("gradient_boosting_plot")
    -plt.show()
    -
    +
    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import train_test_split
     from sklearn.ensemble import GradientBoostingRegressor
    +from sklearn.preprocessing import StandardScaler
    +import scikitplot as skplt
    +from sklearn.metrics import mean_squared_error
     
    -gbrt = GradientBoostingRegressor(max_depth=2, n_estimators=3, learning_rate=1.0, random_state=42)
    -gbrt.fit(X, y)
    +n = 100
    +maxdegree = 6
     
    -gbrt_slow = GradientBoostingRegressor(max_depth=2, n_estimators=200, learning_rate=0.1, random_state=42)
    -gbrt_slow.fit(X, y)
    +# Make data set.
    +x = np.linspace(-3, 3, n).reshape(-1, 1)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape)
     
    -plt.figure(figsize=(11,4))
    +error = np.zeros(maxdegree)
    +bias = np.zeros(maxdegree)
    +variance = np.zeros(maxdegree)
    +polydegree = np.zeros(maxdegree)
    +X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2)
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
     
    -plt.subplot(121)
    -plot_predictions([gbrt], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="Ensemble predictions")
    -plt.title("learning_rate={}, n_estimators={}".format(gbrt.learning_rate, gbrt.n_estimators), fontsize=14)
    +for degree in range(1,maxdegree):
    +    model = GradientBoostingRegressor(max_depth=degree, n_estimators=100, learning_rate=1.0)  
    +    model.fit(X_train_scaled,y_train)
    +    y_pred = model.predict(X_test_scaled)
    +    polydegree[degree] = degree
    +    error[degree] = np.mean( np.mean((y_test - y_pred)**2) )
    +    bias[degree] = np.mean( (y_test - np.mean(y_pred))**2 )
    +    variance[degree] = np.mean( np.var(y_pred) )
    +    print('Max depth:', degree)
    +    print('Error:', error[degree])
    +    print('Bias^2:', bias[degree])
    +    print('Var:', variance[degree])
    +    print('{} >= {} + {} = {}'.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree]))
     
    -plt.subplot(122)
    -plot_predictions([gbrt_slow], X, y, axes=[-0.5, 0.5, -0.1, 0.8])
    -plt.title("learning_rate={}, n_estimators={}".format(gbrt_slow.learning_rate, gbrt_slow.n_estimators), fontsize=14)
    -
    -save_fig("gbrt_learning_rate_plot")
    +plt.xlim(1,maxdegree-1)
    +plt.plot(polydegree, error, label='Error')
    +plt.plot(polydegree, bias, label='bias')
    +plt.plot(polydegree, variance, label='Variance')
    +plt.legend()
     plt.show()
     











    -

    XGBoost: Extreme Gradient Boosting

    +

    Gradient Boosting, Examples of Classification

    +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +import scikitplot as skplt
    +from sklearn.ensemble import GradientBoostingClassifier
    +from sklearn.model_selection import cross_validate
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +
    +gd_clf = GradientBoostingClassifier(max_depth=3, n_estimators=100, learning_rate=1.0)  
    +gd_clf.fit(X_train_scaled, y_train)
    +#Cross validation
    +accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=10)['test_score']
    +print(accuracy)
    +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(gd_clf.score(X_test_scaled,y_test)))
    +
    +import scikitplot as skplt
    +y_pred = gd_clf.predict(X_test_scaled)
    +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)
    +plt.show()
    +y_probas = gd_clf.predict_proba(X_test_scaled)
    +skplt.metrics.plot_roc(y_test, y_probas)
    +plt.show()
    +skplt.metrics.plot_cumulative_gain(y_test, y_probas)
    +plt.show()
    +
    +

    +









    + +

    XGBoost: Extreme Gradient Boosting

    XGBoost or Extreme Gradient @@ -2387,7 +2405,7 @@ It is now the algorithm which wins essentially all ML competitions!!!











    -

    Regression Case

    +

    Regression Case

    @@ -2418,8 +2436,8 @@ X_train_scaled = scaler= scaler.transform(X_test) for degree in range(maxdegree): - model = xgb.XGBRegressor(objective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1, - max_depth = degree, alpha = 10, n_estimators = 10) + model = xgb.XGBRegressor(objective ='reg:squarederror', colsaobjective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1,max_depth = degree, alpha = 10, n_estimators = 200) + model.fit(X_train_scaled,y_train) y_pred = model.predict(X_test_scaled) polydegree[degree] = degree @@ -2442,7 +2460,7 @@ plt.show()











    -

    Xgboost on the Cancer Data

    +

    Xgboost on the Cancer Data

    @@ -2469,9 +2487,26 @@ X_test_scaled = scaler= xgb.XGBClassifier() xg_clf.fit(X_train_scaled,y_train) + +y_test = xg_clf.predict(X_test_scaled) + +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(xg_clf.score(X_test_scaled,y_test))) + +import scikitplot as skplt +y_pred = xg_clf.predict(X_test_scaled) +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +plt.show() +y_probas = xg_clf.predict_proba(X_test_scaled) +skplt.metrics.plot_roc(y_test, y_probas) +plt.show() +skplt.metrics.plot_cumulative_gain(y_test, y_probas) +plt.show() + + xgb.plot_tree(xg_clf,num_trees=0) plt.rcParams['figure.figsize'] = [50, 10] plt.show() + xgb.plot_importance(xg_clf) plt.rcParams['figure.figsize'] = [5, 5] plt.show() diff --git a/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb b/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb index 2beee1adf..bb4157450 100644 --- a/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb +++ b/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb @@ -2283,7 +2283,7 @@ "metadata": {}, "source": [ "$$\n", - "\\mathrm{\\overline{err}}_m=\\frac{1}{n}\\frac{\\sum_{i=0}^{n-1}w_i^mI(y_i\\ne G(\\boldsymbol{X}_{i*})}{\\sum_{i=0}^{n-1}w_i^m},\n", + "\\mathrm{\\overline{err}}_m=\\frac{1}{n}\\frac{\\sum_{i=0}^{n-1}w_i^mI(y_i\\ne G(x_i)}{\\sum_{i=0}^{n-1}w_i^m},\n", "$$" ] }, @@ -2365,7 +2365,7 @@ "metadata": {}, "source": [ "$$\n", - "\\mathrm{err}=\\frac{\\sum_{i=0}^{n-1}w_iI(y_i\\ne G(x_i})}{\\sum_{i=0}^{n-1}w_i},\n", + "\\mathrm{\\overline{err}}_m=\\frac{\\sum_{i=0}^{n-1}w_i^m I(y_i\\ne G(x_i))}{\\sum_{i=0}^{n-1}w_i},\n", "$$" ] }, @@ -2379,7 +2379,7 @@ "\n", "b. Compute then $\\mathrm{err}$ and figure out which events are classified properly and which are classified wrongly.\n", "\n", - "c. Define a quantity $\\alpha_{m} = \\log{(1-\\mathrm{err})/\\mathrm{err}}$\n", + "c. Define a quantity $\\alpha_{m} = \\log{(1-\\mathrm{\\overline{err}}_m)/\\mathrm{\\overline{err}}_m}$\n", "\n", "d. Set the new weights to $w_i = w_i\\times \\exp{(\\alpha_m I(y_i\\ne G(x_i)}$.\n", "\n", @@ -2446,6 +2446,8 @@ "bringing back the essential steps in linear regression, where our cost\n", "function was the least squares function.\n", "\n", + "See discussion during lecture November 8.\n", + "\n", "## Gradient Boosting, algorithm\n", "\n", "Suppose we have a cost function $C(f)=\\sum_{i=0}^{n-1}L(y_i, f(x_i))$ where $y_i$ is our target and $f(x_i)$ the function which is meant to model $y_i$. The above cost function could be our standard square-error function" @@ -2469,7 +2471,7 @@ "\n", "2. For $m=1:M$, we\n", "\n", - "a. compute the negative gradient vector $\\boldsymbol{u}_m = -\\partial C(\\boldsymbol{y},\\boldsymbol{f})/\\partial \\boldsymbol{f}(x)$ at $f(x) = f_{m-1}(x);\n", + "a. compute the negative gradient vector $\\boldsymbol{u}_m = -\\partial C(\\boldsymbol{y},\\boldsymbol{f})/\\partial \\boldsymbol{f}(x)$ at $f(x) = f_{m-1}(x)$;\n", "\n", "b. fit the so-called base-learner to the negative gradient $h_m(u_m,x)$;\n", "\n", @@ -2478,7 +2480,7 @@ "\n", "4. The final estimate is then $f_M(x) = \\sum_{m=1}^M\\nu h_m(u_m,x)$.\n", "\n", - "## Gradient Boosting, Examples" + "## Gradient Boosting, Examples of Regression" ] }, { @@ -2489,87 +2491,104 @@ }, "outputs": [], "source": [ - "np.random.seed(42)\n", - "X = np.random.rand(100, 1) - 0.5\n", - "y = 3*X[:, 0]**2 + 0.05 * np.random.randn(100)\n", - "\n", - "from sklearn.tree import DecisionTreeRegressor\n", - "\n", - "tree_reg1 = DecisionTreeRegressor(max_depth=2, random_state=42)\n", - "tree_reg1.fit(X, y)\n", - "\n", - "y2 = y - tree_reg1.predict(X)\n", - "tree_reg2 = DecisionTreeRegressor(max_depth=2, random_state=42)\n", - "tree_reg2.fit(X, y2)\n", - "\n", - "y3 = y2 - tree_reg2.predict(X)\n", - "tree_reg3 = DecisionTreeRegressor(max_depth=2, random_state=42)\n", - "tree_reg3.fit(X, y3)\n", - "\n", - "X_new = np.array([[0.8]])\n", - "y_pred = sum(tree.predict(X_new) for tree in (tree_reg1, tree_reg2, tree_reg3))\n", - "\n", - "def plot_predictions(regressors, X, y, axes, label=None, style=\"r-\", data_style=\"b.\", data_label=None):\n", - " x1 = np.linspace(axes[0], axes[1], 500)\n", - " y_pred = sum(regressor.predict(x1.reshape(-1, 1)) for regressor in regressors)\n", - " plt.plot(X[:, 0], y, data_style, label=data_label)\n", - " plt.plot(x1, y_pred, style, linewidth=2, label=label)\n", - " if label or data_label:\n", - " plt.legend(loc=\"upper center\", fontsize=16)\n", - " plt.axis(axes)\n", - "\n", - "plt.figure(figsize=(11,11))\n", - "\n", - "plt.subplot(321)\n", - "plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label=\"$h_1(x_1)$\", style=\"g-\", data_label=\"Training set\")\n", - "plt.ylabel(\"$y$\", fontsize=16, rotation=0)\n", - "plt.title(\"Residuals and tree predictions\", fontsize=16)\n", - "\n", - "plt.subplot(322)\n", - "plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label=\"$h(x_1) = h_1(x_1)$\", data_label=\"Training set\")\n", - "plt.ylabel(\"$y$\", fontsize=16, rotation=0)\n", - "plt.title(\"Ensemble predictions\", fontsize=16)\n", - "\n", - "plt.subplot(323)\n", - "plot_predictions([tree_reg2], X, y2, axes=[-0.5, 0.5, -0.5, 0.5], label=\"$h_2(x_1)$\", style=\"g-\", data_style=\"k+\", data_label=\"Residuals\")\n", - "plt.ylabel(\"$y - h_1(x_1)$\", fontsize=16)\n", - "\n", - "plt.subplot(324)\n", - "plot_predictions([tree_reg1, tree_reg2], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label=\"$h(x_1) = h_1(x_1) + h_2(x_1)$\")\n", - "plt.ylabel(\"$y$\", fontsize=16, rotation=0)\n", - "\n", - "plt.subplot(325)\n", - "plot_predictions([tree_reg3], X, y3, axes=[-0.5, 0.5, -0.5, 0.5], label=\"$h_3(x_1)$\", style=\"g-\", data_style=\"k+\")\n", - "plt.ylabel(\"$y - h_1(x_1) - h_2(x_1)$\", fontsize=16)\n", - "plt.xlabel(\"$x_1$\", fontsize=16)\n", - "\n", - "plt.subplot(326)\n", - "plot_predictions([tree_reg1, tree_reg2, tree_reg3], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label=\"$h(x_1) = h_1(x_1) + h_2(x_1) + h_3(x_1)$\")\n", - "plt.xlabel(\"$x_1$\", fontsize=16)\n", - "plt.ylabel(\"$y$\", fontsize=16, rotation=0)\n", - "\n", - "save_fig(\"gradient_boosting_plot\")\n", - "plt.show()\n", - "\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "from sklearn.model_selection import train_test_split\n", "from sklearn.ensemble import GradientBoostingRegressor\n", + "from sklearn.preprocessing import StandardScaler\n", + "import scikitplot as skplt\n", + "from sklearn.metrics import mean_squared_error\n", "\n", - "gbrt = GradientBoostingRegressor(max_depth=2, n_estimators=3, learning_rate=1.0, random_state=42)\n", - "gbrt.fit(X, y)\n", + "n = 100\n", + "maxdegree = 6\n", "\n", - "gbrt_slow = GradientBoostingRegressor(max_depth=2, n_estimators=200, learning_rate=0.1, random_state=42)\n", - "gbrt_slow.fit(X, y)\n", + "# Make data set.\n", + "x = np.linspace(-3, 3, n).reshape(-1, 1)\n", + "y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape)\n", "\n", - "plt.figure(figsize=(11,4))\n", + "error = np.zeros(maxdegree)\n", + "bias = np.zeros(maxdegree)\n", + "variance = np.zeros(maxdegree)\n", + "polydegree = np.zeros(maxdegree)\n", + "X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2)\n", + "scaler = StandardScaler()\n", + "scaler.fit(X_train)\n", + "X_train_scaled = scaler.transform(X_train)\n", + "X_test_scaled = scaler.transform(X_test)\n", "\n", - "plt.subplot(121)\n", - "plot_predictions([gbrt], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label=\"Ensemble predictions\")\n", - "plt.title(\"learning_rate={}, n_estimators={}\".format(gbrt.learning_rate, gbrt.n_estimators), fontsize=14)\n", + "for degree in range(1,maxdegree):\n", + " model = GradientBoostingRegressor(max_depth=degree, n_estimators=100, learning_rate=1.0) \n", + " model.fit(X_train_scaled,y_train)\n", + " y_pred = model.predict(X_test_scaled)\n", + " polydegree[degree] = degree\n", + " error[degree] = np.mean( np.mean((y_test - y_pred)**2) )\n", + " bias[degree] = np.mean( (y_test - np.mean(y_pred))**2 )\n", + " variance[degree] = np.mean( np.var(y_pred) )\n", + " print('Max depth:', degree)\n", + " print('Error:', error[degree])\n", + " print('Bias^2:', bias[degree])\n", + " print('Var:', variance[degree])\n", + " print('{} >= {} + {} = {}'.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree]))\n", "\n", - "plt.subplot(122)\n", - "plot_predictions([gbrt_slow], X, y, axes=[-0.5, 0.5, -0.1, 0.8])\n", - "plt.title(\"learning_rate={}, n_estimators={}\".format(gbrt_slow.learning_rate, gbrt_slow.n_estimators), fontsize=14)\n", + "plt.xlim(1,maxdegree-1)\n", + "plt.plot(polydegree, error, label='Error')\n", + "plt.plot(polydegree, bias, label='bias')\n", + "plt.plot(polydegree, variance, label='Variance')\n", + "plt.legend()\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Gradient Boosting, Examples of Classification" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "from sklearn.model_selection import train_test_split \n", + "from sklearn.datasets import load_breast_cancer\n", + "import scikitplot as skplt\n", + "from sklearn.ensemble import GradientBoostingClassifier\n", + "from sklearn.model_selection import cross_validate\n", "\n", - "save_fig(\"gbrt_learning_rate_plot\")\n", + "# Load the data\n", + "cancer = load_breast_cancer()\n", + "\n", + "X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)\n", + "print(X_train.shape)\n", + "print(X_test.shape)\n", + "#now scale the data\n", + "from sklearn.preprocessing import StandardScaler\n", + "scaler = StandardScaler()\n", + "scaler.fit(X_train)\n", + "X_train_scaled = scaler.transform(X_train)\n", + "X_test_scaled = scaler.transform(X_test)\n", + "\n", + "gd_clf = GradientBoostingClassifier(max_depth=3, n_estimators=100, learning_rate=1.0) \n", + "gd_clf.fit(X_train_scaled, y_train)\n", + "#Cross validation\n", + "accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=10)['test_score']\n", + "print(accuracy)\n", + "print(\"Test set accuracy with Random Forests and scaled data: {:.2f}\".format(gd_clf.score(X_test_scaled,y_test)))\n", + "\n", + "import scikitplot as skplt\n", + "y_pred = gd_clf.predict(X_test_scaled)\n", + "skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)\n", + "plt.show()\n", + "y_probas = gd_clf.predict_proba(X_test_scaled)\n", + "skplt.metrics.plot_roc(y_test, y_probas)\n", + "plt.show()\n", + "skplt.metrics.plot_cumulative_gain(y_test, y_probas)\n", "plt.show()" ] }, @@ -2598,7 +2617,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 31, "metadata": { "collapsed": false }, @@ -2630,8 +2649,8 @@ "X_test_scaled = scaler.transform(X_test)\n", "\n", "for degree in range(maxdegree):\n", - " model = xgb.XGBRegressor(objective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1,\n", - " max_depth = degree, alpha = 10, n_estimators = 10)\n", + " model = xgb.XGBRegressor(objective ='reg:squarederror', colsaobjective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1,max_depth = degree, alpha = 10, n_estimators = 200)\n", + "\n", " model.fit(X_train_scaled,y_train)\n", " y_pred = model.predict(X_test_scaled)\n", " polydegree[degree] = degree\n", @@ -2661,12 +2680,13 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 32, "metadata": { "collapsed": false }, "outputs": [], "source": [ + "\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from sklearn.model_selection import train_test_split \n", @@ -2690,9 +2710,26 @@ "\n", "xg_clf = xgb.XGBClassifier()\n", "xg_clf.fit(X_train_scaled,y_train)\n", + "\n", + "y_test = xg_clf.predict(X_test_scaled)\n", + "\n", + "print(\"Test set accuracy with Random Forests and scaled data: {:.2f}\".format(xg_clf.score(X_test_scaled,y_test)))\n", + "\n", + "import scikitplot as skplt\n", + "y_pred = xg_clf.predict(X_test_scaled)\n", + "skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)\n", + "plt.show()\n", + "y_probas = xg_clf.predict_proba(X_test_scaled)\n", + "skplt.metrics.plot_roc(y_test, y_probas)\n", + "plt.show()\n", + "skplt.metrics.plot_cumulative_gain(y_test, y_probas)\n", + "plt.show()\n", + "\n", + "\n", "xgb.plot_tree(xg_clf,num_trees=0)\n", "plt.rcParams['figure.figsize'] = [50, 10]\n", "plt.show()\n", + "\n", "xgb.plot_importance(xg_clf)\n", "plt.rcParams['figure.figsize'] = [5, 5]\n", "plt.show()" diff --git a/doc/pub/DecisionTrees/ipynb/ipynb-DecisionTrees-src.tar.gz b/doc/pub/DecisionTrees/ipynb/ipynb-DecisionTrees-src.tar.gz index 461a4ebeb..3edcdce6c 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 22edceb81..eb8c19711 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 41ed874f2..2c9ec5a9a 100644 --- a/doc/src/DecisionTrees/DecisionTrees.do.txt +++ b/doc/src/DecisionTrees/DecisionTrees.do.txt @@ -1766,7 +1766,7 @@ which leads to where we have redefined the error as !bt \[ -\mathrm{\overline{err}}_m=\frac{1}{n}\frac{\sum_{i=0}^{n-1}w_i^mI(y_i\ne G(\bm{X}_{i*})}{\sum_{i=0}^{n-1}w_i^m}, +\mathrm{\overline{err}}_m=\frac{1}{n}\frac{\sum_{i=0}^{n-1}w_i^mI(y_i\ne G(x_i)}{\sum_{i=0}^{n-1}w_i^m}, \] !et which leads to an update of @@ -1809,13 +1809,13 @@ o We start by initializing all weights to $w_i = 1/n$, with $i=0,1,2,\dots n-1$. o We rewrite the misclassification error as !bt \[ -\mathrm{err}=\frac{\sum_{i=0}^{n-1}w_iI(y_i\ne G(x_i})}{\sum_{i=0}^{n-1}w_i}, +\mathrm{\overline{err}}_m=\frac{\sum_{i=0}^{n-1}w_i^m I(y_i\ne G(x_i))}{\sum_{i=0}^{n-1}w_i}, \] !et o Then we start looping over all attempts at classifying, namely we start an iterative process for $m=1:M$, where $M$ is the final number of classifications. Our given classifier could for example be a plain decision tree. o Fit then a given classifier to the training using the weights $w_i$. o Compute then $\mathrm{err}$ and figure out which events are classified properly and which are classified wrongly. - o Define a quantity $\alpha_{m} = \log{(1-\mathrm{err})/\mathrm{err}}$ + o Define a quantity $\alpha_{m} = \log{(1-\mathrm{\overline{err}}_m)/\mathrm{\overline{err}}_m}$ o Set the new weights to $w_i = w_i\times \exp{(\alpha_m I(y_i\ne G(x_i)}$. o Compute the new classifier $G(x)= \sum_{i=0}^{n-1}\alpha_m I(y_i\ne G(x_i)$. @@ -1870,6 +1870,8 @@ In order to understand the method, let us illustrate its basics by bringing back the essential steps in linear regression, where our cost function was the least squares function. +See discussion during lecture November 8. + !split ===== Gradient Boosting, algorithm ===== @@ -1883,7 +1885,7 @@ C(\bm{y},\bm{f})=\sum_{i=0}^{n-1}(y_i-f(x_i))^2. The way we proceed in an iterative fashion is to o Initialize our estimate $f_0(x)$. o For $m=1:M$, we - o compute the negative gradient vector $\bm{u}_m = -\partial C(\bm{y},\bm{f})/\partial \bm{f}(x)$ at $f(x) = f_{m-1}(x); + o compute the negative gradient vector $\bm{u}_m = -\partial C(\bm{y},\bm{f})/\partial \bm{f}(x)$ at $f(x) = f_{m-1}(x)$; o fit the so-called base-learner to the negative gradient $h_m(u_m,x)$; o update the estimate $f_m(x) = f_{m-1}(x)+\nu h_m(u_m,x)$; o The final estimate is then $f_M(x) = \sum_{m=1}^M\nu h_m(u_m,x)$. @@ -1892,91 +1894,96 @@ o The final estimate is then $f_M(x) = \sum_{m=1}^M\nu h_m(u_m,x)$. !split -===== Gradient Boosting, Examples ===== +===== Gradient Boosting, Examples of Regression ===== !bc pycod -np.random.seed(42) -X = np.random.rand(100, 1) - 0.5 -y = 3*X[:, 0]**2 + 0.05 * np.random.randn(100) - -from sklearn.tree import DecisionTreeRegressor - -tree_reg1 = DecisionTreeRegressor(max_depth=2, random_state=42) -tree_reg1.fit(X, y) - -y2 = y - tree_reg1.predict(X) -tree_reg2 = DecisionTreeRegressor(max_depth=2, random_state=42) -tree_reg2.fit(X, y2) - -y3 = y2 - tree_reg2.predict(X) -tree_reg3 = DecisionTreeRegressor(max_depth=2, random_state=42) -tree_reg3.fit(X, y3) - -X_new = np.array([[0.8]]) -y_pred = sum(tree.predict(X_new) for tree in (tree_reg1, tree_reg2, tree_reg3)) - -def plot_predictions(regressors, X, y, axes, label=None, style="r-", data_style="b.", data_label=None): - x1 = np.linspace(axes[0], axes[1], 500) - y_pred = sum(regressor.predict(x1.reshape(-1, 1)) for regressor in regressors) - plt.plot(X[:, 0], y, data_style, label=data_label) - plt.plot(x1, y_pred, style, linewidth=2, label=label) - if label or data_label: - plt.legend(loc="upper center", fontsize=16) - plt.axis(axes) - -plt.figure(figsize=(11,11)) - -plt.subplot(321) -plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h_1(x_1)$", style="g-", data_label="Training set") -plt.ylabel("$y$", fontsize=16, rotation=0) -plt.title("Residuals and tree predictions", fontsize=16) - -plt.subplot(322) -plot_predictions([tree_reg1], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1)$", data_label="Training set") -plt.ylabel("$y$", fontsize=16, rotation=0) -plt.title("Ensemble predictions", fontsize=16) - -plt.subplot(323) -plot_predictions([tree_reg2], X, y2, axes=[-0.5, 0.5, -0.5, 0.5], label="$h_2(x_1)$", style="g-", data_style="k+", data_label="Residuals") -plt.ylabel("$y - h_1(x_1)$", fontsize=16) - -plt.subplot(324) -plot_predictions([tree_reg1, tree_reg2], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1) + h_2(x_1)$") -plt.ylabel("$y$", fontsize=16, rotation=0) - -plt.subplot(325) -plot_predictions([tree_reg3], X, y3, axes=[-0.5, 0.5, -0.5, 0.5], label="$h_3(x_1)$", style="g-", data_style="k+") -plt.ylabel("$y - h_1(x_1) - h_2(x_1)$", fontsize=16) -plt.xlabel("$x_1$", fontsize=16) - -plt.subplot(326) -plot_predictions([tree_reg1, tree_reg2, tree_reg3], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="$h(x_1) = h_1(x_1) + h_2(x_1) + h_3(x_1)$") -plt.xlabel("$x_1$", fontsize=16) -plt.ylabel("$y$", fontsize=16, rotation=0) - -save_fig("gradient_boosting_plot") -plt.show() - +import matplotlib.pyplot as plt +import numpy as np +from sklearn.model_selection import train_test_split from sklearn.ensemble import GradientBoostingRegressor +from sklearn.preprocessing import StandardScaler +import scikitplot as skplt +from sklearn.metrics import mean_squared_error -gbrt = GradientBoostingRegressor(max_depth=2, n_estimators=3, learning_rate=1.0, random_state=42) -gbrt.fit(X, y) +n = 100 +maxdegree = 6 -gbrt_slow = GradientBoostingRegressor(max_depth=2, n_estimators=200, learning_rate=0.1, random_state=42) -gbrt_slow.fit(X, y) +# Make data set. +x = np.linspace(-3, 3, n).reshape(-1, 1) +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape) -plt.figure(figsize=(11,4)) +error = np.zeros(maxdegree) +bias = np.zeros(maxdegree) +variance = np.zeros(maxdegree) +polydegree = np.zeros(maxdegree) +X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2) +scaler = StandardScaler() +scaler.fit(X_train) +X_train_scaled = scaler.transform(X_train) +X_test_scaled = scaler.transform(X_test) -plt.subplot(121) -plot_predictions([gbrt], X, y, axes=[-0.5, 0.5, -0.1, 0.8], label="Ensemble predictions") -plt.title("learning_rate={}, n_estimators={}".format(gbrt.learning_rate, gbrt.n_estimators), fontsize=14) +for degree in range(1,maxdegree): + model = GradientBoostingRegressor(max_depth=degree, n_estimators=100, learning_rate=1.0) + model.fit(X_train_scaled,y_train) + y_pred = model.predict(X_test_scaled) + polydegree[degree] = degree + error[degree] = np.mean( np.mean((y_test - y_pred)**2) ) + bias[degree] = np.mean( (y_test - np.mean(y_pred))**2 ) + variance[degree] = np.mean( np.var(y_pred) ) + print('Max depth:', degree) + print('Error:', error[degree]) + print('Bias^2:', bias[degree]) + print('Var:', variance[degree]) + print('{} >= {} + {} = {}'.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree])) -plt.subplot(122) -plot_predictions([gbrt_slow], X, y, axes=[-0.5, 0.5, -0.1, 0.8]) -plt.title("learning_rate={}, n_estimators={}".format(gbrt_slow.learning_rate, gbrt_slow.n_estimators), fontsize=14) - -save_fig("gbrt_learning_rate_plot") +plt.xlim(1,maxdegree-1) +plt.plot(polydegree, error, label='Error') +plt.plot(polydegree, bias, label='bias') +plt.plot(polydegree, variance, label='Variance') +plt.legend() plt.show() +!ec + +!split +===== Gradient Boosting, Examples of Classification ===== +!bc pycod +import matplotlib.pyplot as plt +import numpy as np +from sklearn.model_selection import train_test_split +from sklearn.datasets import load_breast_cancer +import scikitplot as skplt +from sklearn.ensemble import GradientBoostingClassifier +from sklearn.model_selection import cross_validate + +# Load the data +cancer = load_breast_cancer() + +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0) +print(X_train.shape) +print(X_test.shape) +#now scale the data +from sklearn.preprocessing import StandardScaler +scaler = StandardScaler() +scaler.fit(X_train) +X_train_scaled = scaler.transform(X_train) +X_test_scaled = scaler.transform(X_test) + +gd_clf = GradientBoostingClassifier(max_depth=3, n_estimators=100, learning_rate=1.0) +gd_clf.fit(X_train_scaled, y_train) +#Cross validation +accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=10)['test_score'] +print(accuracy) +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(gd_clf.score(X_test_scaled,y_test))) + +import scikitplot as skplt +y_pred = gd_clf.predict(X_test_scaled) +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +plt.show() +y_probas = gd_clf.predict_proba(X_test_scaled) +skplt.metrics.plot_roc(y_test, y_probas) +plt.show() +skplt.metrics.plot_cumulative_gain(y_test, y_probas) +plt.show() !ec @@ -2027,8 +2034,8 @@ X_train_scaled = scaler.transform(X_train) X_test_scaled = scaler.transform(X_test) for degree in range(maxdegree): - model = xgb.XGBRegressor(objective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1, - max_depth = degree, alpha = 10, n_estimators = 10) + model = xgb.XGBRegressor(objective ='reg:squarederror', colsaobjective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1,max_depth = degree, alpha = 10, n_estimators = 200) + model.fit(X_train_scaled,y_train) y_pred = model.predict(X_test_scaled) polydegree[degree] = degree @@ -2048,14 +2055,12 @@ plt.plot(polydegree, variance, label='Variance') plt.legend() plt.show() - !ec - - !split ===== Xgboost on the Cancer Data ===== !bc pycod + import matplotlib.pyplot as plt import numpy as np from sklearn.model_selection import train_test_split @@ -2079,10 +2084,28 @@ X_test_scaled = scaler.transform(X_test) xg_clf = xgb.XGBClassifier() xg_clf.fit(X_train_scaled,y_train) + +y_test = xg_clf.predict(X_test_scaled) + +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(xg_clf.score(X_test_scaled,y_test))) + +import scikitplot as skplt +y_pred = xg_clf.predict(X_test_scaled) +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +plt.show() +y_probas = xg_clf.predict_proba(X_test_scaled) +skplt.metrics.plot_roc(y_test, y_probas) +plt.show() +skplt.metrics.plot_cumulative_gain(y_test, y_probas) +plt.show() + + xgb.plot_tree(xg_clf,num_trees=0) plt.rcParams['figure.figsize'] = [50, 10] plt.show() + xgb.plot_importance(xg_clf) plt.rcParams['figure.figsize'] = [5, 5] plt.show() + !ec diff --git a/doc/src/DecisionTrees/Programs/gdclas.py b/doc/src/DecisionTrees/Programs/gdclas.py new file mode 100644 index 000000000..c7e81b05e --- /dev/null +++ b/doc/src/DecisionTrees/Programs/gdclas.py @@ -0,0 +1,37 @@ +import matplotlib.pyplot as plt +import numpy as np +from sklearn.model_selection import train_test_split +from sklearn.datasets import load_breast_cancer +import scikitplot as skplt +from sklearn.ensemble import GradientBoostingClassifier +from sklearn.model_selection import cross_validate + +# Load the data +cancer = load_breast_cancer() + +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0) +print(X_train.shape) +print(X_test.shape) +#now scale the data +from sklearn.preprocessing import StandardScaler +scaler = StandardScaler() +scaler.fit(X_train) +X_train_scaled = scaler.transform(X_train) +X_test_scaled = scaler.transform(X_test) + +gd_clf = GradientBoostingClassifier(max_depth=3, n_estimators=100, learning_rate=1.0) +gd_clf.fit(X_train_scaled, y_train) +#Cross validation +accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=10)['test_score'] +print(accuracy) +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(gd_clf.score(X_test_scaled,y_test))) + +import scikitplot as skplt +y_pred = gd_clf.predict(X_test_scaled) +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +plt.show() +y_probas = gd_clf.predict_proba(X_test_scaled) +skplt.metrics.plot_roc(y_test, y_probas) +plt.show() +skplt.metrics.plot_cumulative_gain(y_test, y_probas) +plt.show() diff --git a/doc/src/DecisionTrees/Programs/gdreg.py b/doc/src/DecisionTrees/Programs/gdreg.py new file mode 100644 index 000000000..d6c1601c7 --- /dev/null +++ b/doc/src/DecisionTrees/Programs/gdreg.py @@ -0,0 +1,48 @@ +import matplotlib.pyplot as plt +import numpy as np +from sklearn.model_selection import train_test_split +from sklearn.ensemble import GradientBoostingRegressor +from sklearn.preprocessing import StandardScaler +import scikitplot as skplt +from sklearn.metrics import mean_squared_error + +n = 1000 +maxdegree = 6 + +# Make data set. +x = np.linspace(-3, 3, n).reshape(-1, 1) +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)+ np.random.normal(0, 0.1, x.shape) + +error = np.zeros(maxdegree) +bias = np.zeros(maxdegree) +variance = np.zeros(maxdegree) +polydegree = np.zeros(maxdegree) +X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2) +scaler = StandardScaler() +scaler.fit(X_train) +X_train_scaled = scaler.transform(X_train) +X_test_scaled = scaler.transform(X_test) + +for degree in range(1,maxdegree): + model = GradientBoostingRegressor(max_depth=degree, n_estimators=100, learning_rate=1.0) + model.fit(X_train_scaled,y_train) + y_pred = model.predict(X_test_scaled) + polydegree[degree] = degree + error[degree] = np.mean( np.mean((y_test - y_pred)**2) ) + bias[degree] = np.mean( (y_test - np.mean(y_pred))**2 ) + variance[degree] = np.mean( np.var(y_pred) ) + print('Max depth:', degree) + print('Error:', error[degree]) + print('Bias^2:', bias[degree]) + print('Var:', variance[degree]) + print('{} >= {} + {} = {}'.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree])) + +plt.xlim(1,maxdegree-1) +plt.plot(polydegree, error, label='Error') +plt.plot(polydegree, bias, label='bias') +plt.plot(polydegree, variance, label='Variance') +plt.legend() +plt.show() + + + diff --git a/doc/src/DecisionTrees/Programs/xgcancer.py b/doc/src/DecisionTrees/Programs/xgcancer.py index 55d910b0d..bad114975 100644 --- a/doc/src/DecisionTrees/Programs/xgcancer.py +++ b/doc/src/DecisionTrees/Programs/xgcancer.py @@ -19,10 +19,23 @@ scaler.fit(X_train) X_train_scaled = scaler.transform(X_train) X_test_scaled = scaler.transform(X_test) -xg_clf = xgb.XGBClassifier() +xg_clf = xgb.XGBClassifier(max_depth = 4, n_estimators = 200) xg_clf.fit(X_train_scaled,y_train) -preds = xg_clf.predict(X_test_scaled) +y_test = xg_clf.predict(X_test_scaled) + +print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(xg_clf.score(X_test_scaled,y_test))) + +import scikitplot as skplt +y_pred = xg_clf.predict(X_test_scaled) +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +plt.show() +y_probas = xg_clf.predict_proba(X_test_scaled) +skplt.metrics.plot_roc(y_test, y_probas) +plt.show() +skplt.metrics.plot_cumulative_gain(y_test, y_probas) +plt.show() + xgb.plot_tree(xg_clf,num_trees=0) plt.rcParams['figure.figsize'] = [50, 10]