Skip to content

Commit b2ba05c

Browse files
committed
added html files
1 parent cfd31ba commit b2ba05c

12 files changed

+1332
-29
lines changed

doc/pub/DecisionTrees/html/._DecisionTrees-bs054.html

Lines changed: 347 additions & 0 deletions
Large diffs are not rendered by default.

doc/pub/DecisionTrees/html/._DecisionTrees-bs055.html

Lines changed: 303 additions & 0 deletions
Large diffs are not rendered by default.

doc/pub/DecisionTrees/html/._DecisionTrees-bs056.html

Lines changed: 336 additions & 0 deletions
Large diffs are not rendered by default.

doc/pub/DecisionTrees/html/._DecisionTrees-bs057.html

Lines changed: 317 additions & 0 deletions
Large diffs are not rendered by default.

doc/pub/DecisionTrees/html/DecisionTrees-reveal.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,9 +2431,8 @@ <h2 id="___sec55">Regression Case </h2>
24312431
<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>
24322432
<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
24332433

2434-
n = <span style="color: #B452CD">40</span>
2435-
n_boostraps = <span style="color: #B452CD">100</span>
2436-
maxdegree = <span style="color: #B452CD">8</span>
2434+
n = <span style="color: #B452CD">100</span>
2435+
maxdegree = <span style="color: #B452CD">6</span>
24372436

24382437
<span style="color: #228B22"># Make data set.</span>
24392438
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>)
@@ -2450,8 +2449,8 @@ <h2 id="___sec55">Regression Case </h2>
24502449
X_test_scaled = scaler.transform(X_test)
24512450

24522451
<span style="color: #8B008B; font-weight: bold">for</span> degree <span style="color: #8B008B">in</span> <span style="color: #658b00">range</span>(maxdegree):
2453-
model = xgb.XGBRegressor(objective =<span style="color: #CD5555">&#39;reg:linear&#39;</span>, colsample_bytree = <span style="color: #B452CD">0.3</span>, learning_rate = <span style="color: #B452CD">0.1</span>,
2454-
max_depth = maxdegree, alpha = <span style="color: #B452CD">10</span>, n_estimators = <span style="color: #B452CD">10</span>)
2452+
model = xgb.XGBRegressor(objective =<span style="color: #CD5555">&#39;reg:squarederror&#39;</span>, colsample_bytree = <span style="color: #B452CD">0.3</span>, learning_rate = <span style="color: #B452CD">0.1</span>,
2453+
max_depth = degree, alpha = <span style="color: #B452CD">10</span>, n_estimators = <span style="color: #B452CD">10</span>)
24552454
model.fit(X_train_scaled,y_train)
24562455
y_pred = model.predict(X_test_scaled)
24572456
polydegree[degree] = degree
@@ -2464,6 +2463,7 @@ <h2 id="___sec55">Regression Case </h2>
24642463
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">&#39;Var:&#39;</span>, variance[degree])
24652464
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">&#39;{} &gt;= {} + {} = {}&#39;</span>.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree]))
24662465

2466+
plt.xlim(<span style="color: #B452CD">1</span>,maxdegree-<span style="color: #B452CD">1</span>)
24672467
plt.plot(polydegree, error, label=<span style="color: #CD5555">&#39;Error&#39;</span>)
24682468
plt.plot(polydegree, bias, label=<span style="color: #CD5555">&#39;bias&#39;</span>)
24692469
plt.plot(polydegree, variance, label=<span style="color: #CD5555">&#39;Variance&#39;</span>)

doc/pub/DecisionTrees/html/DecisionTrees-solarized.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,9 +2410,8 @@ <h2 id="___sec55">Regression Case </h2>
24102410
<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>
24112411
<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
24122412

2413-
n = <span style="color: #B452CD">40</span>
2414-
n_boostraps = <span style="color: #B452CD">100</span>
2415-
maxdegree = <span style="color: #B452CD">8</span>
2413+
n = <span style="color: #B452CD">100</span>
2414+
maxdegree = <span style="color: #B452CD">6</span>
24162415

24172416
<span style="color: #228B22"># Make data set.</span>
24182417
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>)
@@ -2429,8 +2428,8 @@ <h2 id="___sec55">Regression Case </h2>
24292428
X_test_scaled = scaler.transform(X_test)
24302429

24312430
<span style="color: #8B008B; font-weight: bold">for</span> degree <span style="color: #8B008B">in</span> <span style="color: #658b00">range</span>(maxdegree):
2432-
model = xgb.XGBRegressor(objective =<span style="color: #CD5555">&#39;reg:linear&#39;</span>, colsample_bytree = <span style="color: #B452CD">0.3</span>, learning_rate = <span style="color: #B452CD">0.1</span>,
2433-
max_depth = maxdegree, alpha = <span style="color: #B452CD">10</span>, n_estimators = <span style="color: #B452CD">10</span>)
2431+
model = xgb.XGBRegressor(objective =<span style="color: #CD5555">&#39;reg:squarederror&#39;</span>, colsample_bytree = <span style="color: #B452CD">0.3</span>, learning_rate = <span style="color: #B452CD">0.1</span>,
2432+
max_depth = degree, alpha = <span style="color: #B452CD">10</span>, n_estimators = <span style="color: #B452CD">10</span>)
24342433
model.fit(X_train_scaled,y_train)
24352434
y_pred = model.predict(X_test_scaled)
24362435
polydegree[degree] = degree
@@ -2443,6 +2442,7 @@ <h2 id="___sec55">Regression Case </h2>
24432442
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">&#39;Var:&#39;</span>, variance[degree])
24442443
<span style="color: #8B008B; font-weight: bold">print</span>(<span style="color: #CD5555">&#39;{} &gt;= {} + {} = {}&#39;</span>.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree]))
24452444

2445+
plt.xlim(<span style="color: #B452CD">1</span>,maxdegree-<span style="color: #B452CD">1</span>)
24462446
plt.plot(polydegree, error, label=<span style="color: #CD5555">&#39;Error&#39;</span>)
24472447
plt.plot(polydegree, bias, label=<span style="color: #CD5555">&#39;bias&#39;</span>)
24482448
plt.plot(polydegree, variance, label=<span style="color: #CD5555">&#39;Variance&#39;</span>)

doc/pub/DecisionTrees/html/DecisionTrees.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,9 +2415,8 @@ <h2 id="___sec55">Regression Case </h2>
24152415
<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>
24162416
<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
24172417

2418-
n <span style="color: #666666">=</span> <span style="color: #666666">40</span>
2419-
n_boostraps <span style="color: #666666">=</span> <span style="color: #666666">100</span>
2420-
maxdegree <span style="color: #666666">=</span> <span style="color: #666666">8</span>
2418+
n <span style="color: #666666">=</span> <span style="color: #666666">100</span>
2419+
maxdegree <span style="color: #666666">=</span> <span style="color: #666666">6</span>
24212420

24222421
<span style="color: #408080; font-style: italic"># Make data set.</span>
24232422
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>)
@@ -2434,8 +2433,8 @@ <h2 id="___sec55">Regression Case </h2>
24342433
X_test_scaled <span style="color: #666666">=</span> scaler<span style="color: #666666">.</span>transform(X_test)
24352434

24362435
<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):
2437-
model <span style="color: #666666">=</span> xgb<span style="color: #666666">.</span>XGBRegressor(objective <span style="color: #666666">=</span><span style="color: #BA2121">&#39;reg:linear&#39;</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>,
2438-
max_depth <span style="color: #666666">=</span> maxdegree, 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>)
2436+
model <span style="color: #666666">=</span> xgb<span style="color: #666666">.</span>XGBRegressor(objective <span style="color: #666666">=</span><span style="color: #BA2121">&#39;reg:squarederror&#39;</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>,
2437+
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>)
24392438
model<span style="color: #666666">.</span>fit(X_train_scaled,y_train)
24402439
y_pred <span style="color: #666666">=</span> model<span style="color: #666666">.</span>predict(X_test_scaled)
24412440
polydegree[degree] <span style="color: #666666">=</span> degree
@@ -2448,6 +2447,7 @@ <h2 id="___sec55">Regression Case </h2>
24482447
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">&#39;Var:&#39;</span>, variance[degree])
24492448
<span style="color: #008000; font-weight: bold">print</span>(<span style="color: #BA2121">&#39;{} &gt;= {} + {} = {}&#39;</span><span style="color: #666666">.</span>format(error[degree], bias[degree], variance[degree], bias[degree]<span style="color: #666666">+</span>variance[degree]))
24502449

2450+
plt<span style="color: #666666">.</span>xlim(<span style="color: #666666">1</span>,maxdegree<span style="color: #666666">-1</span>)
24512451
plt<span style="color: #666666">.</span>plot(polydegree, error, label<span style="color: #666666">=</span><span style="color: #BA2121">&#39;Error&#39;</span>)
24522452
plt<span style="color: #666666">.</span>plot(polydegree, bias, label<span style="color: #666666">=</span><span style="color: #BA2121">&#39;bias&#39;</span>)
24532453
plt<span style="color: #666666">.</span>plot(polydegree, variance, label<span style="color: #666666">=</span><span style="color: #BA2121">&#39;Variance&#39;</span>)

doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,9 +2509,8 @@
25092509
"import scikitplot as skplt\n",
25102510
"from sklearn.metrics import mean_squared_error\n",
25112511
"\n",
2512-
"n = 40\n",
2513-
"n_boostraps = 100\n",
2514-
"maxdegree = 8\n",
2512+
"n = 100\n",
2513+
"maxdegree = 6\n",
25152514
"\n",
25162515
"# Make data set.\n",
25172516
"x = np.linspace(-3, 3, n).reshape(-1, 1)\n",
@@ -2528,8 +2527,8 @@
25282527
"X_test_scaled = scaler.transform(X_test)\n",
25292528
"\n",
25302529
"for degree in range(maxdegree):\n",
2531-
" model = xgb.XGBRegressor(objective ='reg:linear', colsample_bytree = 0.3, learning_rate = 0.1,\n",
2532-
" max_depth = maxdegree, alpha = 10, n_estimators = 10)\n",
2530+
" model = xgb.XGBRegressor(objective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1,\n",
2531+
" max_depth = degree, alpha = 10, n_estimators = 10)\n",
25332532
" model.fit(X_train_scaled,y_train)\n",
25342533
" y_pred = model.predict(X_test_scaled)\n",
25352534
" polydegree[degree] = degree\n",
@@ -2542,6 +2541,7 @@
25422541
" print('Var:', variance[degree])\n",
25432542
" print('{} >= {} + {} = {}'.format(error[degree], bias[degree], variance[degree], bias[degree]+variance[degree]))\n",
25442543
"\n",
2544+
"plt.xlim(1,maxdegree-1)\n",
25452545
"plt.plot(polydegree, error, label='Error')\n",
25462546
"plt.plot(polydegree, bias, label='bias')\n",
25472547
"plt.plot(polydegree, variance, label='Variance')\n",
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)