added examples
This commit is contained in:
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -296,7 +304,7 @@ MathJax.Hub.Config({
|
||||
<li><a href="._DecisionTrees-bs008.html">9</a></li>
|
||||
<li><a href="._DecisionTrees-bs009.html">10</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs001.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -301,7 +309,7 @@ given some assumptions, make predictions about the target feature value
|
||||
<li><a href="._DecisionTrees-bs009.html">10</a></li>
|
||||
<li><a href="._DecisionTrees-bs010.html">11</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs002.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -279,7 +287,7 @@ This tree was produced using the Wisconsin cancer data (discussed here as well,
|
||||
<li><a href="._DecisionTrees-bs010.html">11</a></li>
|
||||
<li><a href="._DecisionTrees-bs011.html">12</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs003.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -287,7 +295,7 @@ node.
|
||||
<li><a href="._DecisionTrees-bs011.html">12</a></li>
|
||||
<li><a href="._DecisionTrees-bs012.html">13</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs004.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -288,7 +296,7 @@ Then we are essentially done!
|
||||
<li><a href="._DecisionTrees-bs012.html">13</a></li>
|
||||
<li><a href="._DecisionTrees-bs013.html">14</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs005.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -367,7 +375,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<li><a href="._DecisionTrees-bs013.html">14</a></li>
|
||||
<li><a href="._DecisionTrees-bs014.html">15</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs006.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -300,7 +308,7 @@ within box \( j \).
|
||||
<li><a href="._DecisionTrees-bs014.html">15</a></li>
|
||||
<li><a href="._DecisionTrees-bs015.html">16</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs007.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -292,7 +300,7 @@ better tree in some future step.
|
||||
<li><a href="._DecisionTrees-bs015.html">16</a></li>
|
||||
<li><a href="._DecisionTrees-bs016.html">17</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs008.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -325,7 +333,7 @@ region contains more than five observations.
|
||||
<li><a href="._DecisionTrees-bs016.html">17</a></li>
|
||||
<li><a href="._DecisionTrees-bs017.html">18</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs009.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -294,7 +302,7 @@ parameter \( \alpha \).
|
||||
<li><a href="._DecisionTrees-bs017.html">18</a></li>
|
||||
<li><a href="._DecisionTrees-bs018.html">19</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs010.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -307,7 +315,7 @@ subtree corresponding to \( \alpha \).
|
||||
<li><a href="._DecisionTrees-bs018.html">19</a></li>
|
||||
<li><a href="._DecisionTrees-bs019.html">20</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs011.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -303,7 +311,7 @@ MathJax.Hub.Config({
|
||||
<li><a href="._DecisionTrees-bs019.html">20</a></li>
|
||||
<li><a href="._DecisionTrees-bs020.html">21</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs012.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -295,7 +303,7 @@ fall into that region.
|
||||
<li><a href="._DecisionTrees-bs020.html">21</a></li>
|
||||
<li><a href="._DecisionTrees-bs021.html">22</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs013.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -300,7 +308,7 @@ than is the classification error rate.
|
||||
<li><a href="._DecisionTrees-bs021.html">22</a></li>
|
||||
<li><a href="._DecisionTrees-bs022.html">23</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs014.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -326,7 +334,7 @@ $$
|
||||
<li><a href="._DecisionTrees-bs022.html">23</a></li>
|
||||
<li><a href="._DecisionTrees-bs023.html">24</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs015.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -317,7 +325,7 @@ os<span style="color: #666666">.</span>system(cmd)
|
||||
<li><a href="._DecisionTrees-bs023.html">24</a></li>
|
||||
<li><a href="._DecisionTrees-bs024.html">25</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs016.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -308,7 +316,7 @@ os<span style="color: #666666">.</span>system(cmd)
|
||||
<li><a href="._DecisionTrees-bs024.html">25</a></li>
|
||||
<li><a href="._DecisionTrees-bs025.html">26</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs017.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -291,7 +299,7 @@ We discuss both algorithms with applications here. The popular library <b>Scikit
|
||||
<li><a href="._DecisionTrees-bs025.html">26</a></li>
|
||||
<li><a href="._DecisionTrees-bs026.html">27</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs018.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -281,7 +289,7 @@ MathJax.Hub.Config({
|
||||
<li><a href="._DecisionTrees-bs026.html">27</a></li>
|
||||
<li><a href="._DecisionTrees-bs027.html">28</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs019.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -281,7 +289,7 @@ MathJax.Hub.Config({
|
||||
<li><a href="._DecisionTrees-bs027.html">28</a></li>
|
||||
<li><a href="._DecisionTrees-bs028.html">29</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs020.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -321,7 +329,7 @@ The table here summarizes the various attributes and
|
||||
<li><a href="._DecisionTrees-bs028.html">29</a></li>
|
||||
<li><a href="._DecisionTrees-bs029.html">30</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs021.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -352,7 +360,7 @@ os<span style="color: #666666">.</span>system(cmd)
|
||||
<li><a href="._DecisionTrees-bs029.html">30</a></li>
|
||||
<li><a href="._DecisionTrees-bs030.html">31</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs022.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -354,7 +362,7 @@ split <span style="color: #666666">=</span> get_split(dataset)
|
||||
<li><a href="._DecisionTrees-bs030.html">31</a></li>
|
||||
<li><a href="._DecisionTrees-bs031.html">32</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs023.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -312,7 +320,7 @@ attributes at each step while growing the tree.
|
||||
<li><a href="._DecisionTrees-bs031.html">32</a></li>
|
||||
<li><a href="._DecisionTrees-bs032.html">33</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs024.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -472,7 +480,7 @@ MathJax.Hub.Config({
|
||||
<li><a href="._DecisionTrees-bs032.html">33</a></li>
|
||||
<li><a href="._DecisionTrees-bs033.html">34</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs025.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -325,7 +333,7 @@ deep_tree_clf<span style="color: #666666">.</span>fit(X_train_scaled, y_train)
|
||||
<li><a href="._DecisionTrees-bs033.html">34</a></li>
|
||||
<li><a href="._DecisionTrees-bs034.html">35</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs026.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -348,7 +356,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<li><a href="._DecisionTrees-bs034.html">35</a></li>
|
||||
<li><a href="._DecisionTrees-bs035.html">36</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs027.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -304,7 +312,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<li><a href="._DecisionTrees-bs035.html">36</a></li>
|
||||
<li><a href="._DecisionTrees-bs036.html">37</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs028.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -298,7 +306,7 @@ tree_reg<span style="color: #666666">.</span>fit(X, y)
|
||||
<li><a href="._DecisionTrees-bs036.html">37</a></li>
|
||||
<li><a href="._DecisionTrees-bs037.html">38</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs029.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -354,7 +362,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<li><a href="._DecisionTrees-bs037.html">38</a></li>
|
||||
<li><a href="._DecisionTrees-bs038.html">39</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs030.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -290,7 +298,7 @@ MathJax.Hub.Config({
|
||||
<li><a href="._DecisionTrees-bs038.html">39</a></li>
|
||||
<li><a href="._DecisionTrees-bs039.html">40</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs031.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -293,7 +301,7 @@ However, by aggregating many decision trees, using methods like bagging, random
|
||||
<li><a href="._DecisionTrees-bs039.html">40</a></li>
|
||||
<li><a href="._DecisionTrees-bs040.html">41</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs032.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -300,7 +308,7 @@ We discuss these methods here.
|
||||
<li><a href="._DecisionTrees-bs040.html">41</a></li>
|
||||
<li><a href="._DecisionTrees-bs041.html">42</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs033.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -284,7 +292,7 @@ MathJax.Hub.Config({
|
||||
<li><a href="._DecisionTrees-bs041.html">42</a></li>
|
||||
<li><a href="._DecisionTrees-bs042.html">43</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs034.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -295,7 +303,7 @@ learning method.
|
||||
<li><a href="._DecisionTrees-bs042.html">43</a></li>
|
||||
<li><a href="._DecisionTrees-bs043.html">44</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs035.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -305,7 +313,7 @@ predictor, averaged over all \( B \) trees.
|
||||
<li><a href="._DecisionTrees-bs043.html">44</a></li>
|
||||
<li><a href="._DecisionTrees-bs044.html">45</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs036.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -296,7 +304,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<li><a href="._DecisionTrees-bs044.html">45</a></li>
|
||||
<li><a href="._DecisionTrees-bs045.html">46</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs037.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -327,7 +335,7 @@ voting_clf<span style="color: #666666">.</span>fit(X_train, y_train)
|
||||
<li><a href="._DecisionTrees-bs045.html">46</a></li>
|
||||
<li><a href="._DecisionTrees-bs046.html">47</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs038.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -334,7 +342,7 @@ voting_clf<span style="color: #666666">.</span>fit(X_train, y_train)
|
||||
<li><a href="._DecisionTrees-bs046.html">47</a></li>
|
||||
<li><a href="._DecisionTrees-bs047.html">48</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs039.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -337,7 +345,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<li><a href="._DecisionTrees-bs047.html">48</a></li>
|
||||
<li><a href="._DecisionTrees-bs048.html">49</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs040.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -335,7 +343,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<li><a href="._DecisionTrees-bs048.html">49</a></li>
|
||||
<li><a href="._DecisionTrees-bs049.html">50</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs041.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -320,7 +328,7 @@ this setting.
|
||||
<li><a href="._DecisionTrees-bs049.html">50</a></li>
|
||||
<li><a href="._DecisionTrees-bs050.html">51</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs042.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -302,7 +310,7 @@ We will grow of forest of say \( M \) trees.
|
||||
<li><a href="._DecisionTrees-bs050.html">51</a></li>
|
||||
<li><a href="._DecisionTrees-bs051.html">52</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs043.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -349,7 +357,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<li><a href="._DecisionTrees-bs051.html">52</a></li>
|
||||
<li><a href="._DecisionTrees-bs052.html">53</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs044.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -298,7 +306,7 @@ np<span style="color: #666666">.</span>sum(y_pred <span style="color: #666666">=
|
||||
<li><a href="._DecisionTrees-bs052.html">53</a></li>
|
||||
<li><a href="._DecisionTrees-bs053.html">54</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs045.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -293,7 +301,7 @@ them with a factor.
|
||||
<li><a href="._DecisionTrees-bs053.html">54</a></li>
|
||||
<li><a href="._DecisionTrees-bs054.html">55</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs046.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -316,7 +324,7 @@ In iterative fitting or additive modeling, we minimize the cost function with re
|
||||
<li><a href="._DecisionTrees-bs054.html">55</a></li>
|
||||
<li><a href="._DecisionTrees-bs055.html">56</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs047.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -299,7 +307,7 @@ We could use any of the algorithms we have discussed till now. If we use trees,
|
||||
<li><a href="._DecisionTrees-bs055.html">56</a></li>
|
||||
<li><a href="._DecisionTrees-bs056.html">57</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs048.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -310,7 +318,7 @@ $$
|
||||
<li><a href="._DecisionTrees-bs056.html">57</a></li>
|
||||
<li><a href="._DecisionTrees-bs057.html">58</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs049.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -304,7 +312,7 @@ where we have defined \( w_i^m= \exp{-(y_if_{m-1}(x_i))} \).
|
||||
<li><a href="._DecisionTrees-bs057.html">58</a></li>
|
||||
<li><a href="._DecisionTrees-bs058.html">59</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs050.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -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 @@ $$
|
||||
<li><a href="._DecisionTrees-bs057.html">58</a></li>
|
||||
<li><a href="._DecisionTrees-bs058.html">59</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs051.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -296,6 +304,7 @@ where the function \( I() \) is one if we misclassify and zero if we classify co
|
||||
<li><a href="._DecisionTrees-bs057.html">58</a></li>
|
||||
<li><a href="._DecisionTrees-bs058.html">59</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs052.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -265,7 +273,7 @@ The basic idea is to set up weights which will be used to scale the correctly cl
|
||||
</ol>
|
||||
|
||||
$$
|
||||
\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 @@ $$
|
||||
<ol type="a"></li>
|
||||
<li> Fit then a given classifier to the training using the weights \( w_i \).</li>
|
||||
<li> Compute then \( \mathrm{err} \) and figure out which events are classified properly and which are classified wrongly.</li>
|
||||
<li> Define a quantity \( \alpha_{m} = \log{(1-\mathrm{err})/\mathrm{err}} \)</li>
|
||||
<li> Define a quantity \( \alpha_{m} = \log{(1-\mathrm{\overline{err}}_m)/\mathrm{\overline{err}}_m} \)</li>
|
||||
<li> Set the new weights to \( w_i = w_i\times \exp{(\alpha_m I(y_i\ne G(x_i)} \).</li>
|
||||
</ol>
|
||||
|
||||
@@ -313,6 +321,7 @@ observations that are missed in the previous iterations.
|
||||
<li><a href="._DecisionTrees-bs057.html">58</a></li>
|
||||
<li><a href="._DecisionTrees-bs058.html">59</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs053.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -305,6 +313,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<li><a href="._DecisionTrees-bs057.html">58</a></li>
|
||||
<li><a href="._DecisionTrees-bs058.html">59</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs054.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -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.
|
||||
|
||||
<p>
|
||||
See discussion during lecture November 8.
|
||||
|
||||
<p>
|
||||
<p>
|
||||
<!-- navigation buttons at the bottom of the page -->
|
||||
@@ -286,6 +297,7 @@ function was the least squares function.
|
||||
<li><a href="._DecisionTrees-bs057.html">58</a></li>
|
||||
<li><a href="._DecisionTrees-bs058.html">59</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs055.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -269,7 +277,7 @@ The way we proceed in an iterative fashion is to
|
||||
<li> For \( m=1:M \), we
|
||||
|
||||
<ol type="a"></li>
|
||||
<li> 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);</li>
|
||||
<li> 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) \);</li>
|
||||
<li> fit the so-called base-learner to the negative gradient \( h_m(u_m,x) \);</li>
|
||||
<li> update the estimate \( f_m(x) = f_{m-1}(x)+\nu h_m(u_m,x) \);</li>
|
||||
</ol>
|
||||
@@ -296,6 +304,7 @@ The way we proceed in an iterative fashion is to
|
||||
<li><a href="._DecisionTrees-bs057.html">58</a></li>
|
||||
<li><a href="._DecisionTrees-bs058.html">59</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs056.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -253,91 +261,54 @@ MathJax.Hub.Config({
|
||||
<a name="part0056"></a>
|
||||
<!-- !split -->
|
||||
|
||||
<h2 id="___sec55" class="anchor">Gradient Boosting, Examples </h2>
|
||||
<h2 id="___sec55" class="anchor">Gradient Boosting, Examples of Regression </h2>
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
|
||||
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>seed(<span style="color: #666666">42</span>)
|
||||
X <span style="color: #666666">=</span> np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>rand(<span style="color: #666666">100</span>, <span style="color: #666666">1</span>) <span style="color: #666666">-</span> <span style="color: #666666">0.5</span>
|
||||
y <span style="color: #666666">=</span> <span style="color: #666666">3*</span>X[:, <span style="color: #666666">0</span>]<span style="color: #666666">**2</span> <span style="color: #666666">+</span> <span style="color: #666666">0.05</span> <span style="color: #666666">*</span> np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>randn(<span style="color: #666666">100</span>)
|
||||
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.tree</span> <span style="color: #008000; font-weight: bold">import</span> DecisionTreeRegressor
|
||||
|
||||
tree_reg1 <span style="color: #666666">=</span> DecisionTreeRegressor(max_depth<span style="color: #666666">=2</span>, random_state<span style="color: #666666">=42</span>)
|
||||
tree_reg1<span style="color: #666666">.</span>fit(X, y)
|
||||
|
||||
y2 <span style="color: #666666">=</span> y <span style="color: #666666">-</span> tree_reg1<span style="color: #666666">.</span>predict(X)
|
||||
tree_reg2 <span style="color: #666666">=</span> DecisionTreeRegressor(max_depth<span style="color: #666666">=2</span>, random_state<span style="color: #666666">=42</span>)
|
||||
tree_reg2<span style="color: #666666">.</span>fit(X, y2)
|
||||
|
||||
y3 <span style="color: #666666">=</span> y2 <span style="color: #666666">-</span> tree_reg2<span style="color: #666666">.</span>predict(X)
|
||||
tree_reg3 <span style="color: #666666">=</span> DecisionTreeRegressor(max_depth<span style="color: #666666">=2</span>, random_state<span style="color: #666666">=42</span>)
|
||||
tree_reg3<span style="color: #666666">.</span>fit(X, y3)
|
||||
|
||||
X_new <span style="color: #666666">=</span> np<span style="color: #666666">.</span>array([[<span style="color: #666666">0.8</span>]])
|
||||
y_pred <span style="color: #666666">=</span> <span style="color: #008000">sum</span>(tree<span style="color: #666666">.</span>predict(X_new) <span style="color: #008000; font-weight: bold">for</span> tree <span style="color: #AA22FF; font-weight: bold">in</span> (tree_reg1, tree_reg2, tree_reg3))
|
||||
|
||||
<span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">plot_predictions</span>(regressors, X, y, axes, label<span style="color: #666666">=</span><span style="color: #008000">None</span>, style<span style="color: #666666">=</span><span style="color: #BA2121">"r-"</span>, data_style<span style="color: #666666">=</span><span style="color: #BA2121">"b."</span>, data_label<span style="color: #666666">=</span><span style="color: #008000">None</span>):
|
||||
x1 <span style="color: #666666">=</span> np<span style="color: #666666">.</span>linspace(axes[<span style="color: #666666">0</span>], axes[<span style="color: #666666">1</span>], <span style="color: #666666">500</span>)
|
||||
y_pred <span style="color: #666666">=</span> <span style="color: #008000">sum</span>(regressor<span style="color: #666666">.</span>predict(x1<span style="color: #666666">.</span>reshape(<span style="color: #666666">-1</span>, <span style="color: #666666">1</span>)) <span style="color: #008000; font-weight: bold">for</span> regressor <span style="color: #AA22FF; font-weight: bold">in</span> regressors)
|
||||
plt<span style="color: #666666">.</span>plot(X[:, <span style="color: #666666">0</span>], y, data_style, label<span style="color: #666666">=</span>data_label)
|
||||
plt<span style="color: #666666">.</span>plot(x1, y_pred, style, linewidth<span style="color: #666666">=2</span>, label<span style="color: #666666">=</span>label)
|
||||
<span style="color: #008000; font-weight: bold">if</span> label <span style="color: #AA22FF; font-weight: bold">or</span> data_label:
|
||||
plt<span style="color: #666666">.</span>legend(loc<span style="color: #666666">=</span><span style="color: #BA2121">"upper center"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
plt<span style="color: #666666">.</span>axis(axes)
|
||||
|
||||
plt<span style="color: #666666">.</span>figure(figsize<span style="color: #666666">=</span>(<span style="color: #666666">11</span>,<span style="color: #666666">11</span>))
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">321</span>)
|
||||
plot_predictions([tree_reg1], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h_1(x_1)$"</span>, style<span style="color: #666666">=</span><span style="color: #BA2121">"g-"</span>, data_label<span style="color: #666666">=</span><span style="color: #BA2121">"Training set"</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y$"</span>, fontsize<span style="color: #666666">=16</span>, rotation<span style="color: #666666">=0</span>)
|
||||
plt<span style="color: #666666">.</span>title(<span style="color: #BA2121">"Residuals and tree predictions"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">322</span>)
|
||||
plot_predictions([tree_reg1], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h(x_1) = h_1(x_1)$"</span>, data_label<span style="color: #666666">=</span><span style="color: #BA2121">"Training set"</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y$"</span>, fontsize<span style="color: #666666">=16</span>, rotation<span style="color: #666666">=0</span>)
|
||||
plt<span style="color: #666666">.</span>title(<span style="color: #BA2121">"Ensemble predictions"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">323</span>)
|
||||
plot_predictions([tree_reg2], X, y2, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h_2(x_1)$"</span>, style<span style="color: #666666">=</span><span style="color: #BA2121">"g-"</span>, data_style<span style="color: #666666">=</span><span style="color: #BA2121">"k+"</span>, data_label<span style="color: #666666">=</span><span style="color: #BA2121">"Residuals"</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y - h_1(x_1)$"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">324</span>)
|
||||
plot_predictions([tree_reg1, tree_reg2], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h(x_1) = h_1(x_1) + h_2(x_1)$"</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y$"</span>, fontsize<span style="color: #666666">=16</span>, rotation<span style="color: #666666">=0</span>)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">325</span>)
|
||||
plot_predictions([tree_reg3], X, y3, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h_3(x_1)$"</span>, style<span style="color: #666666">=</span><span style="color: #BA2121">"g-"</span>, data_style<span style="color: #666666">=</span><span style="color: #BA2121">"k+"</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y - h_1(x_1) - h_2(x_1)$"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
plt<span style="color: #666666">.</span>xlabel(<span style="color: #BA2121">"$x_1$"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">326</span>)
|
||||
plot_predictions([tree_reg1, tree_reg2, tree_reg3], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h(x_1) = h_1(x_1) + h_2(x_1) + h_3(x_1)$"</span>)
|
||||
plt<span style="color: #666666">.</span>xlabel(<span style="color: #BA2121">"$x_1$"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y$"</span>, fontsize<span style="color: #666666">=16</span>, rotation<span style="color: #666666">=0</span>)
|
||||
|
||||
save_fig(<span style="color: #BA2121">"gradient_boosting_plot"</span>)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
|
||||
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">matplotlib.pyplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">plt</span>
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">numpy</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">np</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.model_selection</span> <span style="color: #008000; font-weight: bold">import</span> train_test_split
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.ensemble</span> <span style="color: #008000; font-weight: bold">import</span> GradientBoostingRegressor
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.preprocessing</span> <span style="color: #008000; font-weight: bold">import</span> StandardScaler
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">scikitplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">skplt</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.metrics</span> <span style="color: #008000; font-weight: bold">import</span> mean_squared_error
|
||||
|
||||
gbrt <span style="color: #666666">=</span> GradientBoostingRegressor(max_depth<span style="color: #666666">=2</span>, n_estimators<span style="color: #666666">=3</span>, learning_rate<span style="color: #666666">=1.0</span>, random_state<span style="color: #666666">=42</span>)
|
||||
gbrt<span style="color: #666666">.</span>fit(X, y)
|
||||
n <span style="color: #666666">=</span> <span style="color: #666666">100</span>
|
||||
maxdegree <span style="color: #666666">=</span> <span style="color: #666666">6</span>
|
||||
|
||||
gbrt_slow <span style="color: #666666">=</span> GradientBoostingRegressor(max_depth<span style="color: #666666">=2</span>, n_estimators<span style="color: #666666">=200</span>, learning_rate<span style="color: #666666">=0.1</span>, random_state<span style="color: #666666">=42</span>)
|
||||
gbrt_slow<span style="color: #666666">.</span>fit(X, y)
|
||||
<span style="color: #408080; font-style: italic"># Make data set.</span>
|
||||
x <span style="color: #666666">=</span> np<span style="color: #666666">.</span>linspace(<span style="color: #666666">-3</span>, <span style="color: #666666">3</span>, n)<span style="color: #666666">.</span>reshape(<span style="color: #666666">-1</span>, <span style="color: #666666">1</span>)
|
||||
y <span style="color: #666666">=</span> np<span style="color: #666666">.</span>exp(<span style="color: #666666">-</span>x<span style="color: #666666">**2</span>) <span style="color: #666666">+</span> <span style="color: #666666">1.5</span> <span style="color: #666666">*</span> np<span style="color: #666666">.</span>exp(<span style="color: #666666">-</span>(x<span style="color: #666666">-2</span>)<span style="color: #666666">**2</span>)<span style="color: #666666">+</span> np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>normal(<span style="color: #666666">0</span>, <span style="color: #666666">0.1</span>, x<span style="color: #666666">.</span>shape)
|
||||
|
||||
plt<span style="color: #666666">.</span>figure(figsize<span style="color: #666666">=</span>(<span style="color: #666666">11</span>,<span style="color: #666666">4</span>))
|
||||
error <span style="color: #666666">=</span> np<span style="color: #666666">.</span>zeros(maxdegree)
|
||||
bias <span style="color: #666666">=</span> np<span style="color: #666666">.</span>zeros(maxdegree)
|
||||
variance <span style="color: #666666">=</span> np<span style="color: #666666">.</span>zeros(maxdegree)
|
||||
polydegree <span style="color: #666666">=</span> np<span style="color: #666666">.</span>zeros(maxdegree)
|
||||
X_train, X_test, y_train, y_test <span style="color: #666666">=</span> train_test_split(x, y, test_size<span style="color: #666666">=0.2</span>)
|
||||
scaler <span style="color: #666666">=</span> StandardScaler()
|
||||
scaler<span style="color: #666666">.</span>fit(X_train)
|
||||
X_train_scaled <span style="color: #666666">=</span> scaler<span style="color: #666666">.</span>transform(X_train)
|
||||
X_test_scaled <span style="color: #666666">=</span> scaler<span style="color: #666666">.</span>transform(X_test)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">121</span>)
|
||||
plot_predictions([gbrt], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"Ensemble predictions"</span>)
|
||||
plt<span style="color: #666666">.</span>title(<span style="color: #BA2121">"learning_rate={}, n_estimators={}"</span><span style="color: #666666">.</span>format(gbrt<span style="color: #666666">.</span>learning_rate, gbrt<span style="color: #666666">.</span>n_estimators), fontsize<span style="color: #666666">=14</span>)
|
||||
<span style="color: #008000; font-weight: bold">for</span> degree <span style="color: #AA22FF; font-weight: bold">in</span> <span style="color: #008000">range</span>(<span style="color: #666666">1</span>,maxdegree):
|
||||
model <span style="color: #666666">=</span> GradientBoostingRegressor(max_depth<span style="color: #666666">=</span>degree, n_estimators<span style="color: #666666">=100</span>, learning_rate<span style="color: #666666">=1.0</span>)
|
||||
model<span style="color: #666666">.</span>fit(X_train_scaled,y_train)
|
||||
y_pred <span style="color: #666666">=</span> model<span style="color: #666666">.</span>predict(X_test_scaled)
|
||||
polydegree[degree] <span style="color: #666666">=</span> degree
|
||||
error[degree] <span style="color: #666666">=</span> np<span style="color: #666666">.</span>mean( np<span style="color: #666666">.</span>mean((y_test <span style="color: #666666">-</span> y_pred)<span style="color: #666666">**2</span>) )
|
||||
bias[degree] <span style="color: #666666">=</span> np<span style="color: #666666">.</span>mean( (y_test <span style="color: #666666">-</span> np<span style="color: #666666">.</span>mean(y_pred))<span style="color: #666666">**2</span> )
|
||||
variance[degree] <span style="color: #666666">=</span> np<span style="color: #666666">.</span>mean( np<span style="color: #666666">.</span>var(y_pred) )
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">'Max depth:'</span>, degree)
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">'Error:'</span>, error[degree])
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">'Bias^2:'</span>, bias[degree])
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">'Var:'</span>, variance[degree])
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">'{} >= {} + {} = {}'</span><span style="color: #666666">.</span>format(error[degree], bias[degree], variance[degree], bias[degree]<span style="color: #666666">+</span>variance[degree]))
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">122</span>)
|
||||
plot_predictions([gbrt_slow], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>])
|
||||
plt<span style="color: #666666">.</span>title(<span style="color: #BA2121">"learning_rate={}, n_estimators={}"</span><span style="color: #666666">.</span>format(gbrt_slow<span style="color: #666666">.</span>learning_rate, gbrt_slow<span style="color: #666666">.</span>n_estimators), fontsize<span style="color: #666666">=14</span>)
|
||||
|
||||
save_fig(<span style="color: #BA2121">"gbrt_learning_rate_plot"</span>)
|
||||
plt<span style="color: #666666">.</span>xlim(<span style="color: #666666">1</span>,maxdegree<span style="color: #666666">-1</span>)
|
||||
plt<span style="color: #666666">.</span>plot(polydegree, error, label<span style="color: #666666">=</span><span style="color: #BA2121">'Error'</span>)
|
||||
plt<span style="color: #666666">.</span>plot(polydegree, bias, label<span style="color: #666666">=</span><span style="color: #BA2121">'bias'</span>)
|
||||
plt<span style="color: #666666">.</span>plot(polydegree, variance, label<span style="color: #666666">=</span><span style="color: #BA2121">'Variance'</span>)
|
||||
plt<span style="color: #666666">.</span>legend()
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
</pre></div>
|
||||
<p>
|
||||
@@ -359,6 +330,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<li><a href="._DecisionTrees-bs057.html">58</a></li>
|
||||
<li><a href="._DecisionTrees-bs058.html">59</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs057.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -253,24 +261,48 @@ MathJax.Hub.Config({
|
||||
<a name="part0057"></a>
|
||||
<!-- !split -->
|
||||
|
||||
<h2 id="___sec56" class="anchor">XGBoost: Extreme Gradient Boosting </h2>
|
||||
|
||||
<h2 id="___sec56" class="anchor">Gradient Boosting, Examples of Classification </h2>
|
||||
<p>
|
||||
<a href="https://github.com/dmlc/xgboost" target="_self">XGBoost</a> 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 <a href="https://arxiv.org/abs/1603.02754" target="_self">article by Chen and Guestrin</a>.
|
||||
|
||||
<p>
|
||||
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.
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
|
||||
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">matplotlib.pyplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">plt</span>
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">numpy</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">np</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.model_selection</span> <span style="color: #008000; font-weight: bold">import</span> train_test_split
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.datasets</span> <span style="color: #008000; font-weight: bold">import</span> load_breast_cancer
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">scikitplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">skplt</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.ensemble</span> <span style="color: #008000; font-weight: bold">import</span> GradientBoostingClassifier
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.model_selection</span> <span style="color: #008000; font-weight: bold">import</span> cross_validate
|
||||
|
||||
<p>
|
||||
It is now the algorithm which wins essentially all ML competitions!!!
|
||||
<span style="color: #408080; font-style: italic"># Load the data</span>
|
||||
cancer <span style="color: #666666">=</span> load_breast_cancer()
|
||||
|
||||
X_train, X_test, y_train, y_test <span style="color: #666666">=</span> train_test_split(cancer<span style="color: #666666">.</span>data,cancer<span style="color: #666666">.</span>target,random_state<span style="color: #666666">=0</span>)
|
||||
<span style="color: #008000; font-weight: bold">print</span>(X_train<span style="color: #666666">.</span>shape)
|
||||
<span style="color: #008000; font-weight: bold">print</span>(X_test<span style="color: #666666">.</span>shape)
|
||||
<span style="color: #408080; font-style: italic">#now scale the data</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.preprocessing</span> <span style="color: #008000; font-weight: bold">import</span> StandardScaler
|
||||
scaler <span style="color: #666666">=</span> StandardScaler()
|
||||
scaler<span style="color: #666666">.</span>fit(X_train)
|
||||
X_train_scaled <span style="color: #666666">=</span> scaler<span style="color: #666666">.</span>transform(X_train)
|
||||
X_test_scaled <span style="color: #666666">=</span> scaler<span style="color: #666666">.</span>transform(X_test)
|
||||
|
||||
gd_clf <span style="color: #666666">=</span> GradientBoostingClassifier(max_depth<span style="color: #666666">=3</span>, n_estimators<span style="color: #666666">=100</span>, learning_rate<span style="color: #666666">=1.0</span>)
|
||||
gd_clf<span style="color: #666666">.</span>fit(X_train_scaled, y_train)
|
||||
<span style="color: #408080; font-style: italic">#Cross validation</span>
|
||||
accuracy <span style="color: #666666">=</span> cross_validate(gd_clf,X_test_scaled,y_test,cv<span style="color: #666666">=10</span>)[<span style="color: #BA2121">'test_score'</span>]
|
||||
<span style="color: #008000; font-weight: bold">print</span>(accuracy)
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">"Test set accuracy with Random Forests and scaled data: {:.2f}"</span><span style="color: #666666">.</span>format(gd_clf<span style="color: #666666">.</span>score(X_test_scaled,y_test)))
|
||||
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">scikitplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">skplt</span>
|
||||
y_pred <span style="color: #666666">=</span> gd_clf<span style="color: #666666">.</span>predict(X_test_scaled)
|
||||
skplt<span style="color: #666666">.</span>metrics<span style="color: #666666">.</span>plot_confusion_matrix(y_test, y_pred, normalize<span style="color: #666666">=</span><span style="color: #008000">True</span>)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
y_probas <span style="color: #666666">=</span> gd_clf<span style="color: #666666">.</span>predict_proba(X_test_scaled)
|
||||
skplt<span style="color: #666666">.</span>metrics<span style="color: #666666">.</span>plot_roc(y_test, y_probas)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
skplt<span style="color: #666666">.</span>metrics<span style="color: #666666">.</span>plot_cumulative_gain(y_test, y_probas)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
</pre></div>
|
||||
<p>
|
||||
<p>
|
||||
<!-- navigation buttons at the bottom of the page -->
|
||||
@@ -289,6 +321,7 @@ It is now the algorithm which wins essentially all ML competitions!!!
|
||||
<li class="active"><a href="._DecisionTrees-bs057.html">58</a></li>
|
||||
<li><a href="._DecisionTrees-bs058.html">59</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs058.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -234,10 +241,11 @@ MathJax.Hub.Config({
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs053.html#___sec52" style="font-size: 80%;">AdaBoost Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs054.html#___sec53" style="font-size: 80%;">Gradient boosting: Basics</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs055.html#___sec54" style="font-size: 80%;">Gradient Boosting, algorithm</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs056.html#___sec55" style="font-size: 80%;">Gradient Boosting, Examples of Regression</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs057.html#___sec56" style="font-size: 80%;">Gradient Boosting, Examples of Classification</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs058.html#___sec57" style="font-size: 80%;">XGBoost: Extreme Gradient Boosting</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs059.html#___sec58" style="font-size: 80%;">Regression Case</a></li>
|
||||
<!-- navigation toc: --> <li><a href="._DecisionTrees-bs060.html#___sec59" style="font-size: 80%;">Xgboost on the Cancer Data</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -296,7 +304,7 @@ MathJax.Hub.Config({
|
||||
<li><a href="._DecisionTrees-bs008.html">9</a></li>
|
||||
<li><a href="._DecisionTrees-bs009.html">10</a></li>
|
||||
<li><a href="">...</a></li>
|
||||
<li><a href="._DecisionTrees-bs059.html">60</a></li>
|
||||
<li><a href="._DecisionTrees-bs060.html">61</a></li>
|
||||
<li><a href="._DecisionTrees-bs001.html">»</a></li>
|
||||
</ul>
|
||||
<!-- ------------------- end of main content --------------- -->
|
||||
|
||||
@@ -2150,7 +2150,7 @@ $$
|
||||
where we have redefined the error as
|
||||
<p> <br>
|
||||
$$
|
||||
\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},
|
||||
$$
|
||||
<p> <br>
|
||||
|
||||
@@ -2207,7 +2207,7 @@ The basic idea is to set up weights which will be used to scale the correctly cl
|
||||
</ol>
|
||||
<p> <br>
|
||||
$$
|
||||
\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},
|
||||
$$
|
||||
<p> <br>
|
||||
|
||||
@@ -2218,7 +2218,7 @@ $$
|
||||
<ol type="a"></li>
|
||||
<p><li> Fit then a given classifier to the training using the weights \( w_i \).</li>
|
||||
<p><li> Compute then \( \mathrm{err} \) and figure out which events are classified properly and which are classified wrongly.</li>
|
||||
<p><li> Define a quantity \( \alpha_{m} = \log{(1-\mathrm{err})/\mathrm{err}} \)</li>
|
||||
<p><li> Define a quantity \( \alpha_{m} = \log{(1-\mathrm{\overline{err}}_m)/\mathrm{\overline{err}}_m} \)</li>
|
||||
<p><li> Set the new weights to \( w_i = w_i\times \exp{(\alpha_m I(y_i\ne G(x_i)} \).</li>
|
||||
</ol>
|
||||
<p><li> Compute the new classifier \( G(x)= \sum_{i=0}^{n-1}\alpha_m I(y_i\ne G(x_i) \).</li>
|
||||
@@ -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.
|
||||
|
||||
<p>
|
||||
See discussion during lecture November 8.
|
||||
</section>
|
||||
|
||||
|
||||
@@ -2303,7 +2306,7 @@ The way we proceed in an iterative fashion is to
|
||||
<p><li> For \( m=1:M \), we
|
||||
|
||||
<ol type="a"></li>
|
||||
<p><li> 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);</li>
|
||||
<p><li> 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) \);</li>
|
||||
<p><li> fit the so-called base-learner to the negative gradient \( h_m(u_m,x) \);</li>
|
||||
<p><li> update the estimate \( f_m(x) = f_{m-1}(x)+\nu h_m(u_m,x) \);</li>
|
||||
</ol>
|
||||
@@ -2313,98 +2316,107 @@ The way we proceed in an iterative fashion is to
|
||||
|
||||
|
||||
<section>
|
||||
<h2 id="___sec55">Gradient Boosting, Examples </h2>
|
||||
<h2 id="___sec55">Gradient Boosting, Examples of Regression </h2>
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "perldoc" -->
|
||||
<div class="highlight" style="background: #eeeedd"><pre style="font-size: 80%; line-height: 125%"><span></span>np.random.seed(<span style="color: #B452CD">42</span>)
|
||||
X = np.random.rand(<span style="color: #B452CD">100</span>, <span style="color: #B452CD">1</span>) - <span style="color: #B452CD">0.5</span>
|
||||
y = <span style="color: #B452CD">3</span>*X[:, <span style="color: #B452CD">0</span>]**<span style="color: #B452CD">2</span> + <span style="color: #B452CD">0.05</span> * np.random.randn(<span style="color: #B452CD">100</span>)
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.tree</span> <span style="color: #8B008B; font-weight: bold">import</span> DecisionTreeRegressor
|
||||
|
||||
tree_reg1 = DecisionTreeRegressor(max_depth=<span style="color: #B452CD">2</span>, random_state=<span style="color: #B452CD">42</span>)
|
||||
tree_reg1.fit(X, y)
|
||||
|
||||
y2 = y - tree_reg1.predict(X)
|
||||
tree_reg2 = DecisionTreeRegressor(max_depth=<span style="color: #B452CD">2</span>, random_state=<span style="color: #B452CD">42</span>)
|
||||
tree_reg2.fit(X, y2)
|
||||
|
||||
y3 = y2 - tree_reg2.predict(X)
|
||||
tree_reg3 = DecisionTreeRegressor(max_depth=<span style="color: #B452CD">2</span>, random_state=<span style="color: #B452CD">42</span>)
|
||||
tree_reg3.fit(X, y3)
|
||||
|
||||
X_new = np.array([[<span style="color: #B452CD">0.8</span>]])
|
||||
y_pred = <span style="color: #658b00">sum</span>(tree.predict(X_new) <span style="color: #8B008B; font-weight: bold">for</span> tree <span style="color: #8B008B">in</span> (tree_reg1, tree_reg2, tree_reg3))
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">def</span> <span style="color: #008b45">plot_predictions</span>(regressors, X, y, axes, label=<span style="color: #658b00">None</span>, style=<span style="color: #CD5555">"r-"</span>, data_style=<span style="color: #CD5555">"b."</span>, data_label=<span style="color: #658b00">None</span>):
|
||||
x1 = np.linspace(axes[<span style="color: #B452CD">0</span>], axes[<span style="color: #B452CD">1</span>], <span style="color: #B452CD">500</span>)
|
||||
y_pred = <span style="color: #658b00">sum</span>(regressor.predict(x1.reshape(-<span style="color: #B452CD">1</span>, <span style="color: #B452CD">1</span>)) <span style="color: #8B008B; font-weight: bold">for</span> regressor <span style="color: #8B008B">in</span> regressors)
|
||||
plt.plot(X[:, <span style="color: #B452CD">0</span>], y, data_style, label=data_label)
|
||||
plt.plot(x1, y_pred, style, linewidth=<span style="color: #B452CD">2</span>, label=label)
|
||||
<span style="color: #8B008B; font-weight: bold">if</span> label <span style="color: #8B008B">or</span> data_label:
|
||||
plt.legend(loc=<span style="color: #CD5555">"upper center"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
plt.axis(axes)
|
||||
|
||||
plt.figure(figsize=(<span style="color: #B452CD">11</span>,<span style="color: #B452CD">11</span>))
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">321</span>)
|
||||
plot_predictions([tree_reg1], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>], label=<span style="color: #CD5555">"$h_1(x_1)$"</span>, style=<span style="color: #CD5555">"g-"</span>, data_label=<span style="color: #CD5555">"Training set"</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y$"</span>, fontsize=<span style="color: #B452CD">16</span>, rotation=<span style="color: #B452CD">0</span>)
|
||||
plt.title(<span style="color: #CD5555">"Residuals and tree predictions"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">322</span>)
|
||||
plot_predictions([tree_reg1], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>], label=<span style="color: #CD5555">"$h(x_1) = h_1(x_1)$"</span>, data_label=<span style="color: #CD5555">"Training set"</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y$"</span>, fontsize=<span style="color: #B452CD">16</span>, rotation=<span style="color: #B452CD">0</span>)
|
||||
plt.title(<span style="color: #CD5555">"Ensemble predictions"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">323</span>)
|
||||
plot_predictions([tree_reg2], X, y2, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>], label=<span style="color: #CD5555">"$h_2(x_1)$"</span>, style=<span style="color: #CD5555">"g-"</span>, data_style=<span style="color: #CD5555">"k+"</span>, data_label=<span style="color: #CD5555">"Residuals"</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y - h_1(x_1)$"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">324</span>)
|
||||
plot_predictions([tree_reg1, tree_reg2], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>], label=<span style="color: #CD5555">"$h(x_1) = h_1(x_1) + h_2(x_1)$"</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y$"</span>, fontsize=<span style="color: #B452CD">16</span>, rotation=<span style="color: #B452CD">0</span>)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">325</span>)
|
||||
plot_predictions([tree_reg3], X, y3, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>], label=<span style="color: #CD5555">"$h_3(x_1)$"</span>, style=<span style="color: #CD5555">"g-"</span>, data_style=<span style="color: #CD5555">"k+"</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y - h_1(x_1) - h_2(x_1)$"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
plt.xlabel(<span style="color: #CD5555">"$x_1$"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">326</span>)
|
||||
plot_predictions([tree_reg1, tree_reg2, tree_reg3], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>], label=<span style="color: #CD5555">"$h(x_1) = h_1(x_1) + h_2(x_1) + h_3(x_1)$"</span>)
|
||||
plt.xlabel(<span style="color: #CD5555">"$x_1$"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y$"</span>, fontsize=<span style="color: #B452CD">16</span>, rotation=<span style="color: #B452CD">0</span>)
|
||||
|
||||
save_fig(<span style="color: #CD5555">"gradient_boosting_plot"</span>)
|
||||
plt.show()
|
||||
|
||||
<div class="highlight" style="background: #eeeedd"><pre style="font-size: 80%; line-height: 125%"><span></span><span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">matplotlib.pyplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">plt</span>
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">numpy</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">np</span>
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.model_selection</span> <span style="color: #8B008B; font-weight: bold">import</span> train_test_split
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.ensemble</span> <span style="color: #8B008B; font-weight: bold">import</span> GradientBoostingRegressor
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.preprocessing</span> <span style="color: #8B008B; font-weight: bold">import</span> StandardScaler
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">scikitplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">skplt</span>
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.metrics</span> <span style="color: #8B008B; font-weight: bold">import</span> mean_squared_error
|
||||
|
||||
gbrt = GradientBoostingRegressor(max_depth=<span style="color: #B452CD">2</span>, n_estimators=<span style="color: #B452CD">3</span>, learning_rate=<span style="color: #B452CD">1.0</span>, random_state=<span style="color: #B452CD">42</span>)
|
||||
gbrt.fit(X, y)
|
||||
n = <span style="color: #B452CD">100</span>
|
||||
maxdegree = <span style="color: #B452CD">6</span>
|
||||
|
||||
gbrt_slow = GradientBoostingRegressor(max_depth=<span style="color: #B452CD">2</span>, n_estimators=<span style="color: #B452CD">200</span>, learning_rate=<span style="color: #B452CD">0.1</span>, random_state=<span style="color: #B452CD">42</span>)
|
||||
gbrt_slow.fit(X, y)
|
||||
<span style="color: #228B22"># Make data set.</span>
|
||||
x = np.linspace(-<span style="color: #B452CD">3</span>, <span style="color: #B452CD">3</span>, n).reshape(-<span style="color: #B452CD">1</span>, <span style="color: #B452CD">1</span>)
|
||||
y = np.exp(-x**<span style="color: #B452CD">2</span>) + <span style="color: #B452CD">1.5</span> * np.exp(-(x-<span style="color: #B452CD">2</span>)**<span style="color: #B452CD">2</span>)+ np.random.normal(<span style="color: #B452CD">0</span>, <span style="color: #B452CD">0.1</span>, x.shape)
|
||||
|
||||
plt.figure(figsize=(<span style="color: #B452CD">11</span>,<span style="color: #B452CD">4</span>))
|
||||
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=<span style="color: #B452CD">0.2</span>)
|
||||
scaler = StandardScaler()
|
||||
scaler.fit(X_train)
|
||||
X_train_scaled = scaler.transform(X_train)
|
||||
X_test_scaled = scaler.transform(X_test)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">121</span>)
|
||||
plot_predictions([gbrt], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>], label=<span style="color: #CD5555">"Ensemble predictions"</span>)
|
||||
plt.title(<span style="color: #CD5555">"learning_rate={}, n_estimators={}"</span>.format(gbrt.learning_rate, gbrt.n_estimators), fontsize=<span style="color: #B452CD">14</span>)
|
||||
<span style="color: #8B008B; font-weight: bold">for</span> degree <span style="color: #8B008B">in</span> <span style="color: #658b00">range</span>(<span style="color: #B452CD">1</span>,maxdegree):
|
||||
model = GradientBoostingRegressor(max_depth=degree, n_estimators=<span style="color: #B452CD">100</span>, learning_rate=<span style="color: #B452CD">1.0</span>)
|
||||
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)**<span style="color: #B452CD">2</span>) )
|
||||
bias[degree] = np.mean( (y_test - np.mean(y_pred))**<span style="color: #B452CD">2</span> )
|
||||
variance[degree] = np.mean( np.var(y_pred) )
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">'Max depth:'</span>, degree)
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">'Error:'</span>, error[degree])
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">'Bias^2:'</span>, bias[degree])
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">'Var:'</span>, variance[degree])
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">'{} >= {} + {} = {}'</span>.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree]))
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">122</span>)
|
||||
plot_predictions([gbrt_slow], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>])
|
||||
plt.title(<span style="color: #CD5555">"learning_rate={}, n_estimators={}"</span>.format(gbrt_slow.learning_rate, gbrt_slow.n_estimators), fontsize=<span style="color: #B452CD">14</span>)
|
||||
|
||||
save_fig(<span style="color: #CD5555">"gbrt_learning_rate_plot"</span>)
|
||||
plt.xlim(<span style="color: #B452CD">1</span>,maxdegree-<span style="color: #B452CD">1</span>)
|
||||
plt.plot(polydegree, error, label=<span style="color: #CD5555">'Error'</span>)
|
||||
plt.plot(polydegree, bias, label=<span style="color: #CD5555">'bias'</span>)
|
||||
plt.plot(polydegree, variance, label=<span style="color: #CD5555">'Variance'</span>)
|
||||
plt.legend()
|
||||
plt.show()
|
||||
</pre></div>
|
||||
</section>
|
||||
|
||||
|
||||
<section>
|
||||
<h2 id="___sec56">XGBoost: Extreme Gradient Boosting </h2>
|
||||
<h2 id="___sec56">Gradient Boosting, Examples of Classification </h2>
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "perldoc" -->
|
||||
<div class="highlight" style="background: #eeeedd"><pre style="font-size: 80%; line-height: 125%"><span></span><span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">matplotlib.pyplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">plt</span>
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">numpy</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">np</span>
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.model_selection</span> <span style="color: #8B008B; font-weight: bold">import</span> train_test_split
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.datasets</span> <span style="color: #8B008B; font-weight: bold">import</span> load_breast_cancer
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">scikitplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">skplt</span>
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.ensemble</span> <span style="color: #8B008B; font-weight: bold">import</span> GradientBoostingClassifier
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.model_selection</span> <span style="color: #8B008B; font-weight: bold">import</span> cross_validate
|
||||
|
||||
<span style="color: #228B22"># Load the data</span>
|
||||
cancer = load_breast_cancer()
|
||||
|
||||
X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=<span style="color: #B452CD">0</span>)
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(X_train.shape)
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(X_test.shape)
|
||||
<span style="color: #228B22">#now scale the data</span>
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.preprocessing</span> <span style="color: #8B008B; font-weight: bold">import</span> 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=<span style="color: #B452CD">3</span>, n_estimators=<span style="color: #B452CD">100</span>, learning_rate=<span style="color: #B452CD">1.0</span>)
|
||||
gd_clf.fit(X_train_scaled, y_train)
|
||||
<span style="color: #228B22">#Cross validation</span>
|
||||
accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=<span style="color: #B452CD">10</span>)[<span style="color: #CD5555">'test_score'</span>]
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(accuracy)
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">"Test set accuracy with Random Forests and scaled data: {:.2f}"</span>.format(gd_clf.score(X_test_scaled,y_test)))
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">scikitplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">skplt</span>
|
||||
y_pred = gd_clf.predict(X_test_scaled)
|
||||
skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=<span style="color: #658b00">True</span>)
|
||||
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()
|
||||
</pre></div>
|
||||
</section>
|
||||
|
||||
|
||||
<section>
|
||||
<h2 id="___sec57">XGBoost: Extreme Gradient Boosting </h2>
|
||||
|
||||
<p>
|
||||
<a href="https://github.com/dmlc/xgboost" target="_blank">XGBoost</a> or Extreme Gradient
|
||||
@@ -2425,7 +2437,7 @@ It is now the algorithm which wins essentially all ML competitions!!!
|
||||
|
||||
|
||||
<section>
|
||||
<h2 id="___sec57">Regression Case </h2>
|
||||
<h2 id="___sec58">Regression Case </h2>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -2456,8 +2468,8 @@ X_train_scaled = scaler.transform(X_train)
|
||||
X_test_scaled = scaler.transform(X_test)
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">for</span> degree <span style="color: #8B008B">in</span> <span style="color: #658b00">range</span>(maxdegree):
|
||||
model = xgb.XGBRegressor(objective =<span style="color: #CD5555">'reg:squarederror'</span>, colsample_bytree = <span style="color: #B452CD">0.3</span>, learning_rate = <span style="color: #B452CD">0.1</span>,
|
||||
max_depth = degree, alpha = <span style="color: #B452CD">10</span>, n_estimators = <span style="color: #B452CD">10</span>)
|
||||
model = xgb.XGBRegressor(objective =<span style="color: #CD5555">'reg:squarederror'</span>, colsaobjective =<span style="color: #CD5555">'reg:squarederror'</span>, colsample_bytree = <span style="color: #B452CD">0.3</span>, learning_rate = <span style="color: #B452CD">0.1</span>,max_depth = degree, alpha = <span style="color: #B452CD">10</span>, n_estimators = <span style="color: #B452CD">200</span>)
|
||||
|
||||
model.fit(X_train_scaled,y_train)
|
||||
y_pred = model.predict(X_test_scaled)
|
||||
polydegree[degree] = degree
|
||||
@@ -2481,7 +2493,7 @@ plt.show()
|
||||
|
||||
|
||||
<section>
|
||||
<h2 id="___sec58">Xgboost on the Cancer Data </h2>
|
||||
<h2 id="___sec59">Xgboost on the Cancer Data </h2>
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "perldoc" -->
|
||||
@@ -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)
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">"Test set accuracy with Random Forests and scaled data: {:.2f}"</span>.format(xg_clf.score(X_test_scaled,y_test)))
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">scikitplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">skplt</span>
|
||||
y_pred = xg_clf.predict(X_test_scaled)
|
||||
skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=<span style="color: #658b00">True</span>)
|
||||
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=<span style="color: #B452CD">0</span>)
|
||||
plt.rcParams[<span style="color: #CD5555">'figure.figsize'</span>] = [<span style="color: #B452CD">50</span>, <span style="color: #B452CD">10</span>]
|
||||
plt.show()
|
||||
|
||||
xgb.plot_importance(xg_clf)
|
||||
plt.rcParams[<span style="color: #CD5555">'figure.figsize'</span>] = [<span style="color: #B452CD">5</span>, <span style="color: #B452CD">5</span>]
|
||||
plt.show()
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -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
|
||||
</ol>
|
||||
|
||||
$$
|
||||
\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 @@ $$
|
||||
<ol type="a"></li>
|
||||
<li> Fit then a given classifier to the training using the weights \( w_i \).</li>
|
||||
<li> Compute then \( \mathrm{err} \) and figure out which events are classified properly and which are classified wrongly.</li>
|
||||
<li> Define a quantity \( \alpha_{m} = \log{(1-\mathrm{err})/\mathrm{err}} \)</li>
|
||||
<li> Define a quantity \( \alpha_{m} = \log{(1-\mathrm{\overline{err}}_m)/\mathrm{\overline{err}}_m} \)</li>
|
||||
<li> Set the new weights to \( w_i = w_i\times \exp{(\alpha_m I(y_i\ne G(x_i)} \).</li>
|
||||
</ol>
|
||||
|
||||
@@ -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.
|
||||
|
||||
<p>
|
||||
See discussion during lecture November 8.
|
||||
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
@@ -2261,7 +2271,7 @@ The way we proceed in an iterative fashion is to
|
||||
<li> For \( m=1:M \), we
|
||||
|
||||
<ol type="a"></li>
|
||||
<li> 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);</li>
|
||||
<li> 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) \);</li>
|
||||
<li> fit the so-called base-learner to the negative gradient \( h_m(u_m,x) \);</li>
|
||||
<li> update the estimate \( f_m(x) = f_{m-1}(x)+\nu h_m(u_m,x) \);</li>
|
||||
</ol>
|
||||
@@ -2271,97 +2281,105 @@ The way we proceed in an iterative fashion is to
|
||||
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<h2 id="___sec55">Gradient Boosting, Examples </h2>
|
||||
<h2 id="___sec55">Gradient Boosting, Examples of Regression </h2>
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "perldoc" -->
|
||||
<div class="highlight" style="background: #eeeedd"><pre style="line-height: 125%"><span></span>np.random.seed(<span style="color: #B452CD">42</span>)
|
||||
X = np.random.rand(<span style="color: #B452CD">100</span>, <span style="color: #B452CD">1</span>) - <span style="color: #B452CD">0.5</span>
|
||||
y = <span style="color: #B452CD">3</span>*X[:, <span style="color: #B452CD">0</span>]**<span style="color: #B452CD">2</span> + <span style="color: #B452CD">0.05</span> * np.random.randn(<span style="color: #B452CD">100</span>)
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.tree</span> <span style="color: #8B008B; font-weight: bold">import</span> DecisionTreeRegressor
|
||||
|
||||
tree_reg1 = DecisionTreeRegressor(max_depth=<span style="color: #B452CD">2</span>, random_state=<span style="color: #B452CD">42</span>)
|
||||
tree_reg1.fit(X, y)
|
||||
|
||||
y2 = y - tree_reg1.predict(X)
|
||||
tree_reg2 = DecisionTreeRegressor(max_depth=<span style="color: #B452CD">2</span>, random_state=<span style="color: #B452CD">42</span>)
|
||||
tree_reg2.fit(X, y2)
|
||||
|
||||
y3 = y2 - tree_reg2.predict(X)
|
||||
tree_reg3 = DecisionTreeRegressor(max_depth=<span style="color: #B452CD">2</span>, random_state=<span style="color: #B452CD">42</span>)
|
||||
tree_reg3.fit(X, y3)
|
||||
|
||||
X_new = np.array([[<span style="color: #B452CD">0.8</span>]])
|
||||
y_pred = <span style="color: #658b00">sum</span>(tree.predict(X_new) <span style="color: #8B008B; font-weight: bold">for</span> tree <span style="color: #8B008B">in</span> (tree_reg1, tree_reg2, tree_reg3))
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">def</span> <span style="color: #008b45">plot_predictions</span>(regressors, X, y, axes, label=<span style="color: #658b00">None</span>, style=<span style="color: #CD5555">"r-"</span>, data_style=<span style="color: #CD5555">"b."</span>, data_label=<span style="color: #658b00">None</span>):
|
||||
x1 = np.linspace(axes[<span style="color: #B452CD">0</span>], axes[<span style="color: #B452CD">1</span>], <span style="color: #B452CD">500</span>)
|
||||
y_pred = <span style="color: #658b00">sum</span>(regressor.predict(x1.reshape(-<span style="color: #B452CD">1</span>, <span style="color: #B452CD">1</span>)) <span style="color: #8B008B; font-weight: bold">for</span> regressor <span style="color: #8B008B">in</span> regressors)
|
||||
plt.plot(X[:, <span style="color: #B452CD">0</span>], y, data_style, label=data_label)
|
||||
plt.plot(x1, y_pred, style, linewidth=<span style="color: #B452CD">2</span>, label=label)
|
||||
<span style="color: #8B008B; font-weight: bold">if</span> label <span style="color: #8B008B">or</span> data_label:
|
||||
plt.legend(loc=<span style="color: #CD5555">"upper center"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
plt.axis(axes)
|
||||
|
||||
plt.figure(figsize=(<span style="color: #B452CD">11</span>,<span style="color: #B452CD">11</span>))
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">321</span>)
|
||||
plot_predictions([tree_reg1], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>], label=<span style="color: #CD5555">"$h_1(x_1)$"</span>, style=<span style="color: #CD5555">"g-"</span>, data_label=<span style="color: #CD5555">"Training set"</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y$"</span>, fontsize=<span style="color: #B452CD">16</span>, rotation=<span style="color: #B452CD">0</span>)
|
||||
plt.title(<span style="color: #CD5555">"Residuals and tree predictions"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">322</span>)
|
||||
plot_predictions([tree_reg1], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>], label=<span style="color: #CD5555">"$h(x_1) = h_1(x_1)$"</span>, data_label=<span style="color: #CD5555">"Training set"</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y$"</span>, fontsize=<span style="color: #B452CD">16</span>, rotation=<span style="color: #B452CD">0</span>)
|
||||
plt.title(<span style="color: #CD5555">"Ensemble predictions"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">323</span>)
|
||||
plot_predictions([tree_reg2], X, y2, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>], label=<span style="color: #CD5555">"$h_2(x_1)$"</span>, style=<span style="color: #CD5555">"g-"</span>, data_style=<span style="color: #CD5555">"k+"</span>, data_label=<span style="color: #CD5555">"Residuals"</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y - h_1(x_1)$"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">324</span>)
|
||||
plot_predictions([tree_reg1, tree_reg2], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>], label=<span style="color: #CD5555">"$h(x_1) = h_1(x_1) + h_2(x_1)$"</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y$"</span>, fontsize=<span style="color: #B452CD">16</span>, rotation=<span style="color: #B452CD">0</span>)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">325</span>)
|
||||
plot_predictions([tree_reg3], X, y3, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>], label=<span style="color: #CD5555">"$h_3(x_1)$"</span>, style=<span style="color: #CD5555">"g-"</span>, data_style=<span style="color: #CD5555">"k+"</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y - h_1(x_1) - h_2(x_1)$"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
plt.xlabel(<span style="color: #CD5555">"$x_1$"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">326</span>)
|
||||
plot_predictions([tree_reg1, tree_reg2, tree_reg3], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>], label=<span style="color: #CD5555">"$h(x_1) = h_1(x_1) + h_2(x_1) + h_3(x_1)$"</span>)
|
||||
plt.xlabel(<span style="color: #CD5555">"$x_1$"</span>, fontsize=<span style="color: #B452CD">16</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">"$y$"</span>, fontsize=<span style="color: #B452CD">16</span>, rotation=<span style="color: #B452CD">0</span>)
|
||||
|
||||
save_fig(<span style="color: #CD5555">"gradient_boosting_plot"</span>)
|
||||
plt.show()
|
||||
|
||||
<div class="highlight" style="background: #eeeedd"><pre style="line-height: 125%"><span></span><span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">matplotlib.pyplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">plt</span>
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">numpy</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">np</span>
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.model_selection</span> <span style="color: #8B008B; font-weight: bold">import</span> train_test_split
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.ensemble</span> <span style="color: #8B008B; font-weight: bold">import</span> GradientBoostingRegressor
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.preprocessing</span> <span style="color: #8B008B; font-weight: bold">import</span> StandardScaler
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">scikitplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">skplt</span>
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.metrics</span> <span style="color: #8B008B; font-weight: bold">import</span> mean_squared_error
|
||||
|
||||
gbrt = GradientBoostingRegressor(max_depth=<span style="color: #B452CD">2</span>, n_estimators=<span style="color: #B452CD">3</span>, learning_rate=<span style="color: #B452CD">1.0</span>, random_state=<span style="color: #B452CD">42</span>)
|
||||
gbrt.fit(X, y)
|
||||
n = <span style="color: #B452CD">100</span>
|
||||
maxdegree = <span style="color: #B452CD">6</span>
|
||||
|
||||
gbrt_slow = GradientBoostingRegressor(max_depth=<span style="color: #B452CD">2</span>, n_estimators=<span style="color: #B452CD">200</span>, learning_rate=<span style="color: #B452CD">0.1</span>, random_state=<span style="color: #B452CD">42</span>)
|
||||
gbrt_slow.fit(X, y)
|
||||
<span style="color: #228B22"># Make data set.</span>
|
||||
x = np.linspace(-<span style="color: #B452CD">3</span>, <span style="color: #B452CD">3</span>, n).reshape(-<span style="color: #B452CD">1</span>, <span style="color: #B452CD">1</span>)
|
||||
y = np.exp(-x**<span style="color: #B452CD">2</span>) + <span style="color: #B452CD">1.5</span> * np.exp(-(x-<span style="color: #B452CD">2</span>)**<span style="color: #B452CD">2</span>)+ np.random.normal(<span style="color: #B452CD">0</span>, <span style="color: #B452CD">0.1</span>, x.shape)
|
||||
|
||||
plt.figure(figsize=(<span style="color: #B452CD">11</span>,<span style="color: #B452CD">4</span>))
|
||||
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=<span style="color: #B452CD">0.2</span>)
|
||||
scaler = StandardScaler()
|
||||
scaler.fit(X_train)
|
||||
X_train_scaled = scaler.transform(X_train)
|
||||
X_test_scaled = scaler.transform(X_test)
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">121</span>)
|
||||
plot_predictions([gbrt], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>], label=<span style="color: #CD5555">"Ensemble predictions"</span>)
|
||||
plt.title(<span style="color: #CD5555">"learning_rate={}, n_estimators={}"</span>.format(gbrt.learning_rate, gbrt.n_estimators), fontsize=<span style="color: #B452CD">14</span>)
|
||||
<span style="color: #8B008B; font-weight: bold">for</span> degree <span style="color: #8B008B">in</span> <span style="color: #658b00">range</span>(<span style="color: #B452CD">1</span>,maxdegree):
|
||||
model = GradientBoostingRegressor(max_depth=degree, n_estimators=<span style="color: #B452CD">100</span>, learning_rate=<span style="color: #B452CD">1.0</span>)
|
||||
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)**<span style="color: #B452CD">2</span>) )
|
||||
bias[degree] = np.mean( (y_test - np.mean(y_pred))**<span style="color: #B452CD">2</span> )
|
||||
variance[degree] = np.mean( np.var(y_pred) )
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">'Max depth:'</span>, degree)
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">'Error:'</span>, error[degree])
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">'Bias^2:'</span>, bias[degree])
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">'Var:'</span>, variance[degree])
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">'{} >= {} + {} = {}'</span>.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree]))
|
||||
|
||||
plt.subplot(<span style="color: #B452CD">122</span>)
|
||||
plot_predictions([gbrt_slow], X, y, axes=[-<span style="color: #B452CD">0.5</span>, <span style="color: #B452CD">0.5</span>, -<span style="color: #B452CD">0.1</span>, <span style="color: #B452CD">0.8</span>])
|
||||
plt.title(<span style="color: #CD5555">"learning_rate={}, n_estimators={}"</span>.format(gbrt_slow.learning_rate, gbrt_slow.n_estimators), fontsize=<span style="color: #B452CD">14</span>)
|
||||
|
||||
save_fig(<span style="color: #CD5555">"gbrt_learning_rate_plot"</span>)
|
||||
plt.xlim(<span style="color: #B452CD">1</span>,maxdegree-<span style="color: #B452CD">1</span>)
|
||||
plt.plot(polydegree, error, label=<span style="color: #CD5555">'Error'</span>)
|
||||
plt.plot(polydegree, bias, label=<span style="color: #CD5555">'bias'</span>)
|
||||
plt.plot(polydegree, variance, label=<span style="color: #CD5555">'Variance'</span>)
|
||||
plt.legend()
|
||||
plt.show()
|
||||
</pre></div>
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<h2 id="___sec56">XGBoost: Extreme Gradient Boosting </h2>
|
||||
<h2 id="___sec56">Gradient Boosting, Examples of Classification </h2>
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "perldoc" -->
|
||||
<div class="highlight" style="background: #eeeedd"><pre style="line-height: 125%"><span></span><span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">matplotlib.pyplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">plt</span>
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">numpy</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">np</span>
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.model_selection</span> <span style="color: #8B008B; font-weight: bold">import</span> train_test_split
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.datasets</span> <span style="color: #8B008B; font-weight: bold">import</span> load_breast_cancer
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">scikitplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">skplt</span>
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.ensemble</span> <span style="color: #8B008B; font-weight: bold">import</span> GradientBoostingClassifier
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.model_selection</span> <span style="color: #8B008B; font-weight: bold">import</span> cross_validate
|
||||
|
||||
<span style="color: #228B22"># Load the data</span>
|
||||
cancer = load_breast_cancer()
|
||||
|
||||
X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=<span style="color: #B452CD">0</span>)
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(X_train.shape)
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(X_test.shape)
|
||||
<span style="color: #228B22">#now scale the data</span>
|
||||
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">sklearn.preprocessing</span> <span style="color: #8B008B; font-weight: bold">import</span> 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=<span style="color: #B452CD">3</span>, n_estimators=<span style="color: #B452CD">100</span>, learning_rate=<span style="color: #B452CD">1.0</span>)
|
||||
gd_clf.fit(X_train_scaled, y_train)
|
||||
<span style="color: #228B22">#Cross validation</span>
|
||||
accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=<span style="color: #B452CD">10</span>)[<span style="color: #CD5555">'test_score'</span>]
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(accuracy)
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">"Test set accuracy with Random Forests and scaled data: {:.2f}"</span>.format(gd_clf.score(X_test_scaled,y_test)))
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">scikitplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">skplt</span>
|
||||
y_pred = gd_clf.predict(X_test_scaled)
|
||||
skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=<span style="color: #658b00">True</span>)
|
||||
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()
|
||||
</pre></div>
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<h2 id="___sec57">XGBoost: Extreme Gradient Boosting </h2>
|
||||
|
||||
<p>
|
||||
<a href="https://github.com/dmlc/xgboost" target="_blank">XGBoost</a> or Extreme Gradient
|
||||
@@ -2382,7 +2400,7 @@ It is now the algorithm which wins essentially all ML competitions!!!
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<h2 id="___sec57">Regression Case </h2>
|
||||
<h2 id="___sec58">Regression Case </h2>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -2413,8 +2431,8 @@ X_train_scaled = scaler.transform(X_train)
|
||||
X_test_scaled = scaler.transform(X_test)
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">for</span> degree <span style="color: #8B008B">in</span> <span style="color: #658b00">range</span>(maxdegree):
|
||||
model = xgb.XGBRegressor(objective =<span style="color: #CD5555">'reg:squarederror'</span>, colsample_bytree = <span style="color: #B452CD">0.3</span>, learning_rate = <span style="color: #B452CD">0.1</span>,
|
||||
max_depth = degree, alpha = <span style="color: #B452CD">10</span>, n_estimators = <span style="color: #B452CD">10</span>)
|
||||
model = xgb.XGBRegressor(objective =<span style="color: #CD5555">'reg:squarederror'</span>, colsaobjective =<span style="color: #CD5555">'reg:squarederror'</span>, colsample_bytree = <span style="color: #B452CD">0.3</span>, learning_rate = <span style="color: #B452CD">0.1</span>,max_depth = degree, alpha = <span style="color: #B452CD">10</span>, n_estimators = <span style="color: #B452CD">200</span>)
|
||||
|
||||
model.fit(X_train_scaled,y_train)
|
||||
y_pred = model.predict(X_test_scaled)
|
||||
polydegree[degree] = degree
|
||||
@@ -2437,7 +2455,7 @@ plt.show()
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<h2 id="___sec58">Xgboost on the Cancer Data </h2>
|
||||
<h2 id="___sec59">Xgboost on the Cancer Data </h2>
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "perldoc" -->
|
||||
@@ -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)
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">"Test set accuracy with Random Forests and scaled data: {:.2f}"</span>.format(xg_clf.score(X_test_scaled,y_test)))
|
||||
|
||||
<span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">scikitplot</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">skplt</span>
|
||||
y_pred = xg_clf.predict(X_test_scaled)
|
||||
skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=<span style="color: #658b00">True</span>)
|
||||
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=<span style="color: #B452CD">0</span>)
|
||||
plt.rcParams[<span style="color: #CD5555">'figure.figsize'</span>] = [<span style="color: #B452CD">50</span>, <span style="color: #B452CD">10</span>]
|
||||
plt.show()
|
||||
|
||||
xgb.plot_importance(xg_clf)
|
||||
plt.rcParams[<span style="color: #CD5555">'figure.figsize'</span>] = [<span style="color: #B452CD">5</span>, <span style="color: #B452CD">5</span>]
|
||||
plt.show()
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
<body>
|
||||
@@ -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
|
||||
</ol>
|
||||
|
||||
$$
|
||||
\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 @@ $$
|
||||
<ol type="a"></li>
|
||||
<li> Fit then a given classifier to the training using the weights \( w_i \).</li>
|
||||
<li> Compute then \( \mathrm{err} \) and figure out which events are classified properly and which are classified wrongly.</li>
|
||||
<li> Define a quantity \( \alpha_{m} = \log{(1-\mathrm{err})/\mathrm{err}} \)</li>
|
||||
<li> Define a quantity \( \alpha_{m} = \log{(1-\mathrm{\overline{err}}_m)/\mathrm{\overline{err}}_m} \)</li>
|
||||
<li> Set the new weights to \( w_i = w_i\times \exp{(\alpha_m I(y_i\ne G(x_i)} \).</li>
|
||||
</ol>
|
||||
|
||||
@@ -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.
|
||||
|
||||
<p>
|
||||
See discussion during lecture November 8.
|
||||
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
@@ -2266,7 +2276,7 @@ The way we proceed in an iterative fashion is to
|
||||
<li> For \( m=1:M \), we
|
||||
|
||||
<ol type="a"></li>
|
||||
<li> 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);</li>
|
||||
<li> 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) \);</li>
|
||||
<li> fit the so-called base-learner to the negative gradient \( h_m(u_m,x) \);</li>
|
||||
<li> update the estimate \( f_m(x) = f_{m-1}(x)+\nu h_m(u_m,x) \);</li>
|
||||
</ol>
|
||||
@@ -2276,97 +2286,105 @@ The way we proceed in an iterative fashion is to
|
||||
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<h2 id="___sec55">Gradient Boosting, Examples </h2>
|
||||
<h2 id="___sec55">Gradient Boosting, Examples of Regression </h2>
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
|
||||
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>seed(<span style="color: #666666">42</span>)
|
||||
X <span style="color: #666666">=</span> np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>rand(<span style="color: #666666">100</span>, <span style="color: #666666">1</span>) <span style="color: #666666">-</span> <span style="color: #666666">0.5</span>
|
||||
y <span style="color: #666666">=</span> <span style="color: #666666">3*</span>X[:, <span style="color: #666666">0</span>]<span style="color: #666666">**2</span> <span style="color: #666666">+</span> <span style="color: #666666">0.05</span> <span style="color: #666666">*</span> np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>randn(<span style="color: #666666">100</span>)
|
||||
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.tree</span> <span style="color: #008000; font-weight: bold">import</span> DecisionTreeRegressor
|
||||
|
||||
tree_reg1 <span style="color: #666666">=</span> DecisionTreeRegressor(max_depth<span style="color: #666666">=2</span>, random_state<span style="color: #666666">=42</span>)
|
||||
tree_reg1<span style="color: #666666">.</span>fit(X, y)
|
||||
|
||||
y2 <span style="color: #666666">=</span> y <span style="color: #666666">-</span> tree_reg1<span style="color: #666666">.</span>predict(X)
|
||||
tree_reg2 <span style="color: #666666">=</span> DecisionTreeRegressor(max_depth<span style="color: #666666">=2</span>, random_state<span style="color: #666666">=42</span>)
|
||||
tree_reg2<span style="color: #666666">.</span>fit(X, y2)
|
||||
|
||||
y3 <span style="color: #666666">=</span> y2 <span style="color: #666666">-</span> tree_reg2<span style="color: #666666">.</span>predict(X)
|
||||
tree_reg3 <span style="color: #666666">=</span> DecisionTreeRegressor(max_depth<span style="color: #666666">=2</span>, random_state<span style="color: #666666">=42</span>)
|
||||
tree_reg3<span style="color: #666666">.</span>fit(X, y3)
|
||||
|
||||
X_new <span style="color: #666666">=</span> np<span style="color: #666666">.</span>array([[<span style="color: #666666">0.8</span>]])
|
||||
y_pred <span style="color: #666666">=</span> <span style="color: #008000">sum</span>(tree<span style="color: #666666">.</span>predict(X_new) <span style="color: #008000; font-weight: bold">for</span> tree <span style="color: #AA22FF; font-weight: bold">in</span> (tree_reg1, tree_reg2, tree_reg3))
|
||||
|
||||
<span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">plot_predictions</span>(regressors, X, y, axes, label<span style="color: #666666">=</span><span style="color: #008000">None</span>, style<span style="color: #666666">=</span><span style="color: #BA2121">"r-"</span>, data_style<span style="color: #666666">=</span><span style="color: #BA2121">"b."</span>, data_label<span style="color: #666666">=</span><span style="color: #008000">None</span>):
|
||||
x1 <span style="color: #666666">=</span> np<span style="color: #666666">.</span>linspace(axes[<span style="color: #666666">0</span>], axes[<span style="color: #666666">1</span>], <span style="color: #666666">500</span>)
|
||||
y_pred <span style="color: #666666">=</span> <span style="color: #008000">sum</span>(regressor<span style="color: #666666">.</span>predict(x1<span style="color: #666666">.</span>reshape(<span style="color: #666666">-1</span>, <span style="color: #666666">1</span>)) <span style="color: #008000; font-weight: bold">for</span> regressor <span style="color: #AA22FF; font-weight: bold">in</span> regressors)
|
||||
plt<span style="color: #666666">.</span>plot(X[:, <span style="color: #666666">0</span>], y, data_style, label<span style="color: #666666">=</span>data_label)
|
||||
plt<span style="color: #666666">.</span>plot(x1, y_pred, style, linewidth<span style="color: #666666">=2</span>, label<span style="color: #666666">=</span>label)
|
||||
<span style="color: #008000; font-weight: bold">if</span> label <span style="color: #AA22FF; font-weight: bold">or</span> data_label:
|
||||
plt<span style="color: #666666">.</span>legend(loc<span style="color: #666666">=</span><span style="color: #BA2121">"upper center"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
plt<span style="color: #666666">.</span>axis(axes)
|
||||
|
||||
plt<span style="color: #666666">.</span>figure(figsize<span style="color: #666666">=</span>(<span style="color: #666666">11</span>,<span style="color: #666666">11</span>))
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">321</span>)
|
||||
plot_predictions([tree_reg1], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h_1(x_1)$"</span>, style<span style="color: #666666">=</span><span style="color: #BA2121">"g-"</span>, data_label<span style="color: #666666">=</span><span style="color: #BA2121">"Training set"</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y$"</span>, fontsize<span style="color: #666666">=16</span>, rotation<span style="color: #666666">=0</span>)
|
||||
plt<span style="color: #666666">.</span>title(<span style="color: #BA2121">"Residuals and tree predictions"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">322</span>)
|
||||
plot_predictions([tree_reg1], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h(x_1) = h_1(x_1)$"</span>, data_label<span style="color: #666666">=</span><span style="color: #BA2121">"Training set"</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y$"</span>, fontsize<span style="color: #666666">=16</span>, rotation<span style="color: #666666">=0</span>)
|
||||
plt<span style="color: #666666">.</span>title(<span style="color: #BA2121">"Ensemble predictions"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">323</span>)
|
||||
plot_predictions([tree_reg2], X, y2, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h_2(x_1)$"</span>, style<span style="color: #666666">=</span><span style="color: #BA2121">"g-"</span>, data_style<span style="color: #666666">=</span><span style="color: #BA2121">"k+"</span>, data_label<span style="color: #666666">=</span><span style="color: #BA2121">"Residuals"</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y - h_1(x_1)$"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">324</span>)
|
||||
plot_predictions([tree_reg1, tree_reg2], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h(x_1) = h_1(x_1) + h_2(x_1)$"</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y$"</span>, fontsize<span style="color: #666666">=16</span>, rotation<span style="color: #666666">=0</span>)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">325</span>)
|
||||
plot_predictions([tree_reg3], X, y3, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h_3(x_1)$"</span>, style<span style="color: #666666">=</span><span style="color: #BA2121">"g-"</span>, data_style<span style="color: #666666">=</span><span style="color: #BA2121">"k+"</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y - h_1(x_1) - h_2(x_1)$"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
plt<span style="color: #666666">.</span>xlabel(<span style="color: #BA2121">"$x_1$"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">326</span>)
|
||||
plot_predictions([tree_reg1, tree_reg2, tree_reg3], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"$h(x_1) = h_1(x_1) + h_2(x_1) + h_3(x_1)$"</span>)
|
||||
plt<span style="color: #666666">.</span>xlabel(<span style="color: #BA2121">"$x_1$"</span>, fontsize<span style="color: #666666">=16</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">"$y$"</span>, fontsize<span style="color: #666666">=16</span>, rotation<span style="color: #666666">=0</span>)
|
||||
|
||||
save_fig(<span style="color: #BA2121">"gradient_boosting_plot"</span>)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
|
||||
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">matplotlib.pyplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">plt</span>
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">numpy</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">np</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.model_selection</span> <span style="color: #008000; font-weight: bold">import</span> train_test_split
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.ensemble</span> <span style="color: #008000; font-weight: bold">import</span> GradientBoostingRegressor
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.preprocessing</span> <span style="color: #008000; font-weight: bold">import</span> StandardScaler
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">scikitplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">skplt</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.metrics</span> <span style="color: #008000; font-weight: bold">import</span> mean_squared_error
|
||||
|
||||
gbrt <span style="color: #666666">=</span> GradientBoostingRegressor(max_depth<span style="color: #666666">=2</span>, n_estimators<span style="color: #666666">=3</span>, learning_rate<span style="color: #666666">=1.0</span>, random_state<span style="color: #666666">=42</span>)
|
||||
gbrt<span style="color: #666666">.</span>fit(X, y)
|
||||
n <span style="color: #666666">=</span> <span style="color: #666666">100</span>
|
||||
maxdegree <span style="color: #666666">=</span> <span style="color: #666666">6</span>
|
||||
|
||||
gbrt_slow <span style="color: #666666">=</span> GradientBoostingRegressor(max_depth<span style="color: #666666">=2</span>, n_estimators<span style="color: #666666">=200</span>, learning_rate<span style="color: #666666">=0.1</span>, random_state<span style="color: #666666">=42</span>)
|
||||
gbrt_slow<span style="color: #666666">.</span>fit(X, y)
|
||||
<span style="color: #408080; font-style: italic"># Make data set.</span>
|
||||
x <span style="color: #666666">=</span> np<span style="color: #666666">.</span>linspace(<span style="color: #666666">-3</span>, <span style="color: #666666">3</span>, n)<span style="color: #666666">.</span>reshape(<span style="color: #666666">-1</span>, <span style="color: #666666">1</span>)
|
||||
y <span style="color: #666666">=</span> np<span style="color: #666666">.</span>exp(<span style="color: #666666">-</span>x<span style="color: #666666">**2</span>) <span style="color: #666666">+</span> <span style="color: #666666">1.5</span> <span style="color: #666666">*</span> np<span style="color: #666666">.</span>exp(<span style="color: #666666">-</span>(x<span style="color: #666666">-2</span>)<span style="color: #666666">**2</span>)<span style="color: #666666">+</span> np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>normal(<span style="color: #666666">0</span>, <span style="color: #666666">0.1</span>, x<span style="color: #666666">.</span>shape)
|
||||
|
||||
plt<span style="color: #666666">.</span>figure(figsize<span style="color: #666666">=</span>(<span style="color: #666666">11</span>,<span style="color: #666666">4</span>))
|
||||
error <span style="color: #666666">=</span> np<span style="color: #666666">.</span>zeros(maxdegree)
|
||||
bias <span style="color: #666666">=</span> np<span style="color: #666666">.</span>zeros(maxdegree)
|
||||
variance <span style="color: #666666">=</span> np<span style="color: #666666">.</span>zeros(maxdegree)
|
||||
polydegree <span style="color: #666666">=</span> np<span style="color: #666666">.</span>zeros(maxdegree)
|
||||
X_train, X_test, y_train, y_test <span style="color: #666666">=</span> train_test_split(x, y, test_size<span style="color: #666666">=0.2</span>)
|
||||
scaler <span style="color: #666666">=</span> StandardScaler()
|
||||
scaler<span style="color: #666666">.</span>fit(X_train)
|
||||
X_train_scaled <span style="color: #666666">=</span> scaler<span style="color: #666666">.</span>transform(X_train)
|
||||
X_test_scaled <span style="color: #666666">=</span> scaler<span style="color: #666666">.</span>transform(X_test)
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">121</span>)
|
||||
plot_predictions([gbrt], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>], label<span style="color: #666666">=</span><span style="color: #BA2121">"Ensemble predictions"</span>)
|
||||
plt<span style="color: #666666">.</span>title(<span style="color: #BA2121">"learning_rate={}, n_estimators={}"</span><span style="color: #666666">.</span>format(gbrt<span style="color: #666666">.</span>learning_rate, gbrt<span style="color: #666666">.</span>n_estimators), fontsize<span style="color: #666666">=14</span>)
|
||||
<span style="color: #008000; font-weight: bold">for</span> degree <span style="color: #AA22FF; font-weight: bold">in</span> <span style="color: #008000">range</span>(<span style="color: #666666">1</span>,maxdegree):
|
||||
model <span style="color: #666666">=</span> GradientBoostingRegressor(max_depth<span style="color: #666666">=</span>degree, n_estimators<span style="color: #666666">=100</span>, learning_rate<span style="color: #666666">=1.0</span>)
|
||||
model<span style="color: #666666">.</span>fit(X_train_scaled,y_train)
|
||||
y_pred <span style="color: #666666">=</span> model<span style="color: #666666">.</span>predict(X_test_scaled)
|
||||
polydegree[degree] <span style="color: #666666">=</span> degree
|
||||
error[degree] <span style="color: #666666">=</span> np<span style="color: #666666">.</span>mean( np<span style="color: #666666">.</span>mean((y_test <span style="color: #666666">-</span> y_pred)<span style="color: #666666">**2</span>) )
|
||||
bias[degree] <span style="color: #666666">=</span> np<span style="color: #666666">.</span>mean( (y_test <span style="color: #666666">-</span> np<span style="color: #666666">.</span>mean(y_pred))<span style="color: #666666">**2</span> )
|
||||
variance[degree] <span style="color: #666666">=</span> np<span style="color: #666666">.</span>mean( np<span style="color: #666666">.</span>var(y_pred) )
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">'Max depth:'</span>, degree)
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">'Error:'</span>, error[degree])
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">'Bias^2:'</span>, bias[degree])
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">'Var:'</span>, variance[degree])
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">'{} >= {} + {} = {}'</span><span style="color: #666666">.</span>format(error[degree], bias[degree], variance[degree], bias[degree]<span style="color: #666666">+</span>variance[degree]))
|
||||
|
||||
plt<span style="color: #666666">.</span>subplot(<span style="color: #666666">122</span>)
|
||||
plot_predictions([gbrt_slow], X, y, axes<span style="color: #666666">=</span>[<span style="color: #666666">-0.5</span>, <span style="color: #666666">0.5</span>, <span style="color: #666666">-0.1</span>, <span style="color: #666666">0.8</span>])
|
||||
plt<span style="color: #666666">.</span>title(<span style="color: #BA2121">"learning_rate={}, n_estimators={}"</span><span style="color: #666666">.</span>format(gbrt_slow<span style="color: #666666">.</span>learning_rate, gbrt_slow<span style="color: #666666">.</span>n_estimators), fontsize<span style="color: #666666">=14</span>)
|
||||
|
||||
save_fig(<span style="color: #BA2121">"gbrt_learning_rate_plot"</span>)
|
||||
plt<span style="color: #666666">.</span>xlim(<span style="color: #666666">1</span>,maxdegree<span style="color: #666666">-1</span>)
|
||||
plt<span style="color: #666666">.</span>plot(polydegree, error, label<span style="color: #666666">=</span><span style="color: #BA2121">'Error'</span>)
|
||||
plt<span style="color: #666666">.</span>plot(polydegree, bias, label<span style="color: #666666">=</span><span style="color: #BA2121">'bias'</span>)
|
||||
plt<span style="color: #666666">.</span>plot(polydegree, variance, label<span style="color: #666666">=</span><span style="color: #BA2121">'Variance'</span>)
|
||||
plt<span style="color: #666666">.</span>legend()
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
</pre></div>
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<h2 id="___sec56">XGBoost: Extreme Gradient Boosting </h2>
|
||||
<h2 id="___sec56">Gradient Boosting, Examples of Classification </h2>
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
|
||||
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">matplotlib.pyplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">plt</span>
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">numpy</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">np</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.model_selection</span> <span style="color: #008000; font-weight: bold">import</span> train_test_split
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.datasets</span> <span style="color: #008000; font-weight: bold">import</span> load_breast_cancer
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">scikitplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">skplt</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.ensemble</span> <span style="color: #008000; font-weight: bold">import</span> GradientBoostingClassifier
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.model_selection</span> <span style="color: #008000; font-weight: bold">import</span> cross_validate
|
||||
|
||||
<span style="color: #408080; font-style: italic"># Load the data</span>
|
||||
cancer <span style="color: #666666">=</span> load_breast_cancer()
|
||||
|
||||
X_train, X_test, y_train, y_test <span style="color: #666666">=</span> train_test_split(cancer<span style="color: #666666">.</span>data,cancer<span style="color: #666666">.</span>target,random_state<span style="color: #666666">=0</span>)
|
||||
<span style="color: #008000; font-weight: bold">print</span>(X_train<span style="color: #666666">.</span>shape)
|
||||
<span style="color: #008000; font-weight: bold">print</span>(X_test<span style="color: #666666">.</span>shape)
|
||||
<span style="color: #408080; font-style: italic">#now scale the data</span>
|
||||
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.preprocessing</span> <span style="color: #008000; font-weight: bold">import</span> StandardScaler
|
||||
scaler <span style="color: #666666">=</span> StandardScaler()
|
||||
scaler<span style="color: #666666">.</span>fit(X_train)
|
||||
X_train_scaled <span style="color: #666666">=</span> scaler<span style="color: #666666">.</span>transform(X_train)
|
||||
X_test_scaled <span style="color: #666666">=</span> scaler<span style="color: #666666">.</span>transform(X_test)
|
||||
|
||||
gd_clf <span style="color: #666666">=</span> GradientBoostingClassifier(max_depth<span style="color: #666666">=3</span>, n_estimators<span style="color: #666666">=100</span>, learning_rate<span style="color: #666666">=1.0</span>)
|
||||
gd_clf<span style="color: #666666">.</span>fit(X_train_scaled, y_train)
|
||||
<span style="color: #408080; font-style: italic">#Cross validation</span>
|
||||
accuracy <span style="color: #666666">=</span> cross_validate(gd_clf,X_test_scaled,y_test,cv<span style="color: #666666">=10</span>)[<span style="color: #BA2121">'test_score'</span>]
|
||||
<span style="color: #008000; font-weight: bold">print</span>(accuracy)
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">"Test set accuracy with Random Forests and scaled data: {:.2f}"</span><span style="color: #666666">.</span>format(gd_clf<span style="color: #666666">.</span>score(X_test_scaled,y_test)))
|
||||
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">scikitplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">skplt</span>
|
||||
y_pred <span style="color: #666666">=</span> gd_clf<span style="color: #666666">.</span>predict(X_test_scaled)
|
||||
skplt<span style="color: #666666">.</span>metrics<span style="color: #666666">.</span>plot_confusion_matrix(y_test, y_pred, normalize<span style="color: #666666">=</span><span style="color: #008000">True</span>)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
y_probas <span style="color: #666666">=</span> gd_clf<span style="color: #666666">.</span>predict_proba(X_test_scaled)
|
||||
skplt<span style="color: #666666">.</span>metrics<span style="color: #666666">.</span>plot_roc(y_test, y_probas)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
skplt<span style="color: #666666">.</span>metrics<span style="color: #666666">.</span>plot_cumulative_gain(y_test, y_probas)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
</pre></div>
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<h2 id="___sec57">XGBoost: Extreme Gradient Boosting </h2>
|
||||
|
||||
<p>
|
||||
<a href="https://github.com/dmlc/xgboost" target="_blank">XGBoost</a> or Extreme Gradient
|
||||
@@ -2387,7 +2405,7 @@ It is now the algorithm which wins essentially all ML competitions!!!
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<h2 id="___sec57">Regression Case </h2>
|
||||
<h2 id="___sec58">Regression Case </h2>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -2418,8 +2436,8 @@ X_train_scaled <span style="color: #666666">=</span> scaler<span style="color: #
|
||||
X_test_scaled <span style="color: #666666">=</span> scaler<span style="color: #666666">.</span>transform(X_test)
|
||||
|
||||
<span style="color: #008000; font-weight: bold">for</span> degree <span style="color: #AA22FF; font-weight: bold">in</span> <span style="color: #008000">range</span>(maxdegree):
|
||||
model <span style="color: #666666">=</span> xgb<span style="color: #666666">.</span>XGBRegressor(objective <span style="color: #666666">=</span><span style="color: #BA2121">'reg:squarederror'</span>, colsample_bytree <span style="color: #666666">=</span> <span style="color: #666666">0.3</span>, learning_rate <span style="color: #666666">=</span> <span style="color: #666666">0.1</span>,
|
||||
max_depth <span style="color: #666666">=</span> degree, alpha <span style="color: #666666">=</span> <span style="color: #666666">10</span>, n_estimators <span style="color: #666666">=</span> <span style="color: #666666">10</span>)
|
||||
model <span style="color: #666666">=</span> xgb<span style="color: #666666">.</span>XGBRegressor(objective <span style="color: #666666">=</span><span style="color: #BA2121">'reg:squarederror'</span>, colsaobjective <span style="color: #666666">=</span><span style="color: #BA2121">'reg:squarederror'</span>, colsample_bytree <span style="color: #666666">=</span> <span style="color: #666666">0.3</span>, learning_rate <span style="color: #666666">=</span> <span style="color: #666666">0.1</span>,max_depth <span style="color: #666666">=</span> degree, alpha <span style="color: #666666">=</span> <span style="color: #666666">10</span>, n_estimators <span style="color: #666666">=</span> <span style="color: #666666">200</span>)
|
||||
|
||||
model<span style="color: #666666">.</span>fit(X_train_scaled,y_train)
|
||||
y_pred <span style="color: #666666">=</span> model<span style="color: #666666">.</span>predict(X_test_scaled)
|
||||
polydegree[degree] <span style="color: #666666">=</span> degree
|
||||
@@ -2442,7 +2460,7 @@ plt<span style="color: #666666">.</span>show()
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<h2 id="___sec58">Xgboost on the Cancer Data </h2>
|
||||
<h2 id="___sec59">Xgboost on the Cancer Data </h2>
|
||||
<p>
|
||||
|
||||
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
|
||||
@@ -2469,9 +2487,26 @@ X_test_scaled <span style="color: #666666">=</span> scaler<span style="color: #6
|
||||
|
||||
xg_clf <span style="color: #666666">=</span> xgb<span style="color: #666666">.</span>XGBClassifier()
|
||||
xg_clf<span style="color: #666666">.</span>fit(X_train_scaled,y_train)
|
||||
|
||||
y_test <span style="color: #666666">=</span> xg_clf<span style="color: #666666">.</span>predict(X_test_scaled)
|
||||
|
||||
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">"Test set accuracy with Random Forests and scaled data: {:.2f}"</span><span style="color: #666666">.</span>format(xg_clf<span style="color: #666666">.</span>score(X_test_scaled,y_test)))
|
||||
|
||||
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">scikitplot</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">skplt</span>
|
||||
y_pred <span style="color: #666666">=</span> xg_clf<span style="color: #666666">.</span>predict(X_test_scaled)
|
||||
skplt<span style="color: #666666">.</span>metrics<span style="color: #666666">.</span>plot_confusion_matrix(y_test, y_pred, normalize<span style="color: #666666">=</span><span style="color: #008000">True</span>)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
y_probas <span style="color: #666666">=</span> xg_clf<span style="color: #666666">.</span>predict_proba(X_test_scaled)
|
||||
skplt<span style="color: #666666">.</span>metrics<span style="color: #666666">.</span>plot_roc(y_test, y_probas)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
skplt<span style="color: #666666">.</span>metrics<span style="color: #666666">.</span>plot_cumulative_gain(y_test, y_probas)
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
|
||||
|
||||
xgb<span style="color: #666666">.</span>plot_tree(xg_clf,num_trees<span style="color: #666666">=0</span>)
|
||||
plt<span style="color: #666666">.</span>rcParams[<span style="color: #BA2121">'figure.figsize'</span>] <span style="color: #666666">=</span> [<span style="color: #666666">50</span>, <span style="color: #666666">10</span>]
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
|
||||
xgb<span style="color: #666666">.</span>plot_importance(xg_clf)
|
||||
plt<span style="color: #666666">.</span>rcParams[<span style="color: #BA2121">'figure.figsize'</span>] <span style="color: #666666">=</span> [<span style="color: #666666">5</span>, <span style="color: #666666">5</span>]
|
||||
plt<span style="color: #666666">.</span>show()
|
||||
|
||||
@@ -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()"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user