diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs036.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs036.html index eace42fbd..75cf17e21 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs036.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs036.html @@ -276,6 +276,7 @@ plt.xlabel(&quo plt.ylabel("Heads ratio") plt.legend(loc="lower right") plt.axis([0, 10000, 0.42, 0.58]) +save_fig("votingsimple") plt.show()

diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs039.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs039.html index bcad02a86..90537a6ee 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs039.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs039.html @@ -317,6 +317,7 @@ plt.title(" plt.subplot(122) plot_decision_boundary(bag_clf, X, y) plt.title("Decision Trees with Bagging", fontsize=14) +save_fig("baggingtree") plt.show()

diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs040.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs040.html index 29ad457ea..a51dee7d6 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs040.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs040.html @@ -315,6 +315,7 @@ plt.plot(polydegree, error, label.plot(polydegree, bias, label='bias') plt.plot(polydegree, variance, label='Variance') plt.legend() +save_fig("baggingboot") plt.show()

diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs056.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs056.html index dce64e77d..c493898ac 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs056.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs056.html @@ -309,6 +309,7 @@ plt.plot(polydegree, error, label.plot(polydegree, bias, label='bias') plt.plot(polydegree, variance, label='Variance') plt.legend() +save_fig("gdregression") plt.show()

diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs057.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs057.html index 92b6b8885..bc50690a3 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs057.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs057.html @@ -296,11 +296,14 @@ accuracy = cross_validate(gd_clf,X_test_scal import scikitplot as skplt y_pred = gd_clf.predict(X_test_scaled) skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +save_fig("gdclassiffierconfusion") plt.show() y_probas = gd_clf.predict_proba(X_test_scaled) skplt.metrics.plot_roc(y_test, y_probas) +save_fig("gdclassiffierroc") plt.show() skplt.metrics.plot_cumulative_gain(y_test, y_probas) +save_fig("gdclassiffiercgain") plt.show()

diff --git a/doc/pub/DecisionTrees/html/._DecisionTrees-bs060.html b/doc/pub/DecisionTrees/html/._DecisionTrees-bs060.html index 91925956f..6fa737500 100644 --- a/doc/pub/DecisionTrees/html/._DecisionTrees-bs060.html +++ b/doc/pub/DecisionTrees/html/._DecisionTrees-bs060.html @@ -296,20 +296,25 @@ y_test = xg_clf import scikitplot as skplt y_pred = xg_clf.predict(X_test_scaled) skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +save_fig("xdclassiffierconfusion") plt.show() y_probas = xg_clf.predict_proba(X_test_scaled) skplt.metrics.plot_roc(y_test, y_probas) +save_fig("xdclassiffierroc") plt.show() skplt.metrics.plot_cumulative_gain(y_test, y_probas) +save_fig("gdclassiffiercgain") plt.show() xgb.plot_tree(xg_clf,num_trees=0) plt.rcParams['figure.figsize'] = [50, 10] +save_fig("xgtree") plt.show() xgb.plot_importance(xg_clf) plt.rcParams['figure.figsize'] = [5, 5] +save_fig("xgparams") plt.show()

diff --git a/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html b/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html index 64672f5a8..4c4501a21 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees-reveal.html @@ -1537,6 +1537,7 @@ plt.xlabel("Number of coin tosses" plt.ylabel("Heads ratio") plt.legend(loc="lower right") plt.axis([0, 10000, 0.42, 0.58]) +save_fig("votingsimple") plt.show() @@ -1710,6 +1711,7 @@ plt.title("Decision Tree", fontsiz plt.subplot(122) plot_decision_boundary(bag_clf, X, y) plt.title("Decision Trees with Bagging", fontsize=14) +save_fig("baggingtree") plt.show() @@ -1770,6 +1772,7 @@ plt.plot(polydegree, error, label='Error''bias') plt.plot(polydegree, variance, label='Variance') plt.legend() +save_fig("baggingboot") plt.show() @@ -2364,6 +2367,7 @@ plt.plot(polydegree, error, label='Error''bias') plt.plot(polydegree, variance, label='Variance') plt.legend() +save_fig("gdregression") plt.show() @@ -2405,11 +2409,14 @@ accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=import scikitplot as skplt y_pred = gd_clf.predict(X_test_scaled) skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +save_fig("gdclassiffierconfusion") plt.show() y_probas = gd_clf.predict_proba(X_test_scaled) skplt.metrics.plot_roc(y_test, y_probas) +save_fig("gdclassiffierroc") plt.show() skplt.metrics.plot_cumulative_gain(y_test, y_probas) +save_fig("gdclassiffiercgain") plt.show() @@ -2528,20 +2535,25 @@ y_test = xg_clf.predict(X_test_scaled) import scikitplot as skplt y_pred = xg_clf.predict(X_test_scaled) skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +save_fig("xdclassiffierconfusion") plt.show() y_probas = xg_clf.predict_proba(X_test_scaled) skplt.metrics.plot_roc(y_test, y_probas) +save_fig("xdclassiffierroc") plt.show() skplt.metrics.plot_cumulative_gain(y_test, y_probas) +save_fig("gdclassiffiercgain") plt.show() xgb.plot_tree(xg_clf,num_trees=0) plt.rcParams['figure.figsize'] = [50, 10] +save_fig("xgtree") plt.show() xgb.plot_importance(xg_clf) plt.rcParams['figure.figsize'] = [5, 5] +save_fig("xgparams") plt.show() diff --git a/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html b/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html index 70eb4082b..76a78b168 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees-solarized.html @@ -1558,6 +1558,7 @@ plt.xlabel("Number of coin tosses" plt.ylabel("Heads ratio") plt.legend(loc="lower right") plt.axis([0, 10000, 0.42, 0.58]) +save_fig("votingsimple") plt.show()

@@ -1728,6 +1729,7 @@ plt.title("Decision Tree", fontsiz plt.subplot(122) plot_decision_boundary(bag_clf, X, y) plt.title("Decision Trees with Bagging", fontsize=14) +save_fig("baggingtree") plt.show()

@@ -1787,6 +1789,7 @@ plt.plot(polydegree, error, label='Error''bias') plt.plot(polydegree, variance, label='Variance') plt.legend() +save_fig("baggingboot") plt.show()

@@ -2329,6 +2332,7 @@ plt.plot(polydegree, error, label='Error''bias') plt.plot(polydegree, variance, label='Variance') plt.legend() +save_fig("gdregression") plt.show()

@@ -2369,11 +2373,14 @@ accuracy = cross_validate(gd_clf,X_test_scaled,y_test,cv=import scikitplot as skplt y_pred = gd_clf.predict(X_test_scaled) skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +save_fig("gdclassiffierconfusion") plt.show() y_probas = gd_clf.predict_proba(X_test_scaled) skplt.metrics.plot_roc(y_test, y_probas) +save_fig("gdclassiffierroc") plt.show() skplt.metrics.plot_cumulative_gain(y_test, y_probas) +save_fig("gdclassiffiercgain") plt.show()

@@ -2490,20 +2497,25 @@ y_test = xg_clf.predict(X_test_scaled) import scikitplot as skplt y_pred = xg_clf.predict(X_test_scaled) skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +save_fig("xdclassiffierconfusion") plt.show() y_probas = xg_clf.predict_proba(X_test_scaled) skplt.metrics.plot_roc(y_test, y_probas) +save_fig("xdclassiffierroc") plt.show() skplt.metrics.plot_cumulative_gain(y_test, y_probas) +save_fig("gdclassiffiercgain") plt.show() xgb.plot_tree(xg_clf,num_trees=0) plt.rcParams['figure.figsize'] = [50, 10] +save_fig("xgtree") plt.show() xgb.plot_importance(xg_clf) plt.rcParams['figure.figsize'] = [5, 5] +save_fig("xgparams") plt.show()

diff --git a/doc/pub/DecisionTrees/html/DecisionTrees.html b/doc/pub/DecisionTrees/html/DecisionTrees.html index a0192166f..23369f66c 100644 --- a/doc/pub/DecisionTrees/html/DecisionTrees.html +++ b/doc/pub/DecisionTrees/html/DecisionTrees.html @@ -1563,6 +1563,7 @@ plt.xlabel(&quo plt.ylabel("Heads ratio") plt.legend(loc="lower right") plt.axis([0, 10000, 0.42, 0.58]) +save_fig("votingsimple") plt.show()

@@ -1733,6 +1734,7 @@ plt.title(" plt.subplot(122) plot_decision_boundary(bag_clf, X, y) plt.title("Decision Trees with Bagging", fontsize=14) +save_fig("baggingtree") plt.show()

@@ -1792,6 +1794,7 @@ plt.plot(polydegree, error, label.plot(polydegree, bias, label='bias') plt.plot(polydegree, variance, label='Variance') plt.legend() +save_fig("baggingboot") plt.show()

@@ -2334,6 +2337,7 @@ plt.plot(polydegree, error, label.plot(polydegree, bias, label='bias') plt.plot(polydegree, variance, label='Variance') plt.legend() +save_fig("gdregression") plt.show()

@@ -2374,11 +2378,14 @@ accuracy = cross_validate(gd_clf,X_test_scal import scikitplot as skplt y_pred = gd_clf.predict(X_test_scaled) skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +save_fig("gdclassiffierconfusion") plt.show() y_probas = gd_clf.predict_proba(X_test_scaled) skplt.metrics.plot_roc(y_test, y_probas) +save_fig("gdclassiffierroc") plt.show() skplt.metrics.plot_cumulative_gain(y_test, y_probas) +save_fig("gdclassiffiercgain") plt.show()

@@ -2495,20 +2502,25 @@ y_test = xg_clf import scikitplot as skplt y_pred = xg_clf.predict(X_test_scaled) skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +save_fig("xdclassiffierconfusion") plt.show() y_probas = xg_clf.predict_proba(X_test_scaled) skplt.metrics.plot_roc(y_test, y_probas) +save_fig("xdclassiffierroc") plt.show() skplt.metrics.plot_cumulative_gain(y_test, y_probas) +save_fig("gdclassiffiercgain") plt.show() xgb.plot_tree(xg_clf,num_trees=0) plt.rcParams['figure.figsize'] = [50, 10] +save_fig("xgtree") plt.show() xgb.plot_importance(xg_clf) plt.rcParams['figure.figsize'] = [5, 5] +save_fig("xgparams") plt.show()

diff --git a/doc/pub/DecisionTrees/ipynb/DataFiles/cancer.dot b/doc/pub/DecisionTrees/ipynb/DataFiles/cancer.dot index 711a1e353..518b63ff3 100644 --- a/doc/pub/DecisionTrees/ipynb/DataFiles/cancer.dot +++ b/doc/pub/DecisionTrees/ipynb/DataFiles/cancer.dot @@ -6,11 +6,11 @@ edge [fontname=helvetica] ; 0 -> 1 [labeldistance=2.5, labelangle=45, headlabel="True"] ; 2 [label="worst concave points <= 0.135\ngini = 0.031\nsamples = 253\nvalue = [[249, 4]\n[4, 249]]", fillcolor="#e58139ee"] ; 1 -> 2 ; -3 [label="radius error <= 0.643\ngini = 0.008\nsamples = 242\nvalue = [[241, 1]\n[1, 241]]", fillcolor="#e58139fb"] ; +3 [label="area error <= 48.975\ngini = 0.008\nsamples = 242\nvalue = [[241, 1]\n[1, 241]]", fillcolor="#e58139fb"] ; 2 -> 3 ; 4 [label="gini = 0.0\nsamples = 239\nvalue = [[239, 0]\n[0, 239]]", fillcolor="#e58139ff"] ; 3 -> 4 ; -5 [label="mean symmetry <= 0.166\ngini = 0.444\nsamples = 3\nvalue = [[2, 1]\n[1, 2]]", fillcolor="#e5813913"] ; +5 [label="area error <= 51.38\ngini = 0.444\nsamples = 3\nvalue = [[2, 1]\n[1, 2]]", fillcolor="#e5813913"] ; 3 -> 5 ; 6 [label="gini = 0.0\nsamples = 1\nvalue = [[0, 1]\n[1, 0]]", fillcolor="#e58139ff"] ; 5 -> 6 ; @@ -22,7 +22,7 @@ edge [fontname=helvetica] ; 8 -> 9 ; 10 [label="gini = 0.0\nsamples = 3\nvalue = [[0, 3]\n[3, 0]]", fillcolor="#e58139ff"] ; 8 -> 10 ; -11 [label="mean texture <= 16.22\ngini = 0.278\nsamples = 6\nvalue = [[1, 5]\n[5, 1]]", fillcolor="#e581396b"] ; +11 [label="area error <= 13.475\ngini = 0.278\nsamples = 6\nvalue = [[1, 5]\n[5, 1]]", fillcolor="#e581396b"] ; 1 -> 11 ; 12 [label="gini = 0.0\nsamples = 1\nvalue = [[1, 0]\n[0, 1]]", fillcolor="#e58139ff"] ; 11 -> 12 ; @@ -30,11 +30,11 @@ edge [fontname=helvetica] ; 11 -> 13 ; 14 [label="worst texture <= 20.645\ngini = 0.202\nsamples = 167\nvalue = [[19, 148]\n[148, 19]]", fillcolor="#e5813994"] ; 0 -> 14 [labeldistance=2.5, labelangle=-45, headlabel="False"] ; -15 [label="worst area <= 964.4\ngini = 0.375\nsamples = 16\nvalue = [[12, 4]\n[4, 12]]", fillcolor="#e5813938"] ; +15 [label="worst concavity <= 0.318\ngini = 0.375\nsamples = 16\nvalue = [[12, 4]\n[4, 12]]", fillcolor="#e5813938"] ; 14 -> 15 ; 16 [label="gini = 0.0\nsamples = 11\nvalue = [[11, 0]\n[0, 11]]", fillcolor="#e58139ff"] ; 15 -> 16 ; -17 [label="mean symmetry <= 0.141\ngini = 0.32\nsamples = 5\nvalue = [[1, 4]\n[4, 1]]", fillcolor="#e5813955"] ; +17 [label="radius error <= 0.251\ngini = 0.32\nsamples = 5\nvalue = [[1, 4]\n[4, 1]]", fillcolor="#e5813955"] ; 15 -> 17 ; 18 [label="gini = 0.0\nsamples = 1\nvalue = [[1, 0]\n[0, 1]]", fillcolor="#e58139ff"] ; 17 -> 18 ; @@ -42,13 +42,13 @@ edge [fontname=helvetica] ; 17 -> 19 ; 20 [label="mean concave points <= 0.049\ngini = 0.088\nsamples = 151\nvalue = [[7, 144]\n[144, 7]]", fillcolor="#e58139d0"] ; 14 -> 20 ; -21 [label="compactness error <= 0.016\ngini = 0.48\nsamples = 15\nvalue = [[6, 9]\n[9, 6]]", fillcolor="#e5813900"] ; +21 [label="concave points error <= 0.01\ngini = 0.48\nsamples = 15\nvalue = [[6, 9]\n[9, 6]]", fillcolor="#e5813900"] ; 20 -> 21 ; 22 [label="gini = 0.0\nsamples = 9\nvalue = [[0, 9]\n[9, 0]]", fillcolor="#e58139ff"] ; 21 -> 22 ; 23 [label="gini = 0.0\nsamples = 6\nvalue = [[6, 0]\n[0, 6]]", fillcolor="#e58139ff"] ; 21 -> 23 ; -24 [label="mean smoothness <= 0.079\ngini = 0.015\nsamples = 136\nvalue = [[1, 135]\n[135, 1]]", fillcolor="#e58139f7"] ; +24 [label="worst smoothness <= 0.096\ngini = 0.015\nsamples = 136\nvalue = [[1, 135]\n[135, 1]]", fillcolor="#e58139f7"] ; 20 -> 24 ; 25 [label="gini = 0.0\nsamples = 1\nvalue = [[1, 0]\n[0, 1]]", fillcolor="#e58139ff"] ; 24 -> 25 ; diff --git a/doc/pub/DecisionTrees/ipynb/DataFiles/cancer.png b/doc/pub/DecisionTrees/ipynb/DataFiles/cancer.png index d25b0e959..f40109f5c 100644 Binary files a/doc/pub/DecisionTrees/ipynb/DataFiles/cancer.png and b/doc/pub/DecisionTrees/ipynb/DataFiles/cancer.png differ diff --git a/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb b/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb index bb4157450..107b9dd2d 100644 --- a/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb +++ b/doc/pub/DecisionTrees/ipynb/DecisionTrees.ipynb @@ -1492,6 +1492,7 @@ "plt.ylabel(\"Heads ratio\")\n", "plt.legend(loc=\"lower right\")\n", "plt.axis([0, 10000, 0.42, 0.58])\n", + "save_fig(\"votingsimple\")\n", "plt.show()" ] }, @@ -1724,6 +1725,7 @@ "plt.subplot(122)\n", "plot_decision_boundary(bag_clf, X, y)\n", "plt.title(\"Decision Trees with Bagging\", fontsize=14)\n", + "save_fig(\"baggingtree\")\n", "plt.show()" ] }, @@ -1792,6 +1794,7 @@ "plt.plot(polydegree, bias, label='bias')\n", "plt.plot(polydegree, variance, label='Variance')\n", "plt.legend()\n", + "save_fig(\"baggingboot\")\n", "plt.show()" ] }, @@ -2535,6 +2538,7 @@ "plt.plot(polydegree, bias, label='bias')\n", "plt.plot(polydegree, variance, label='Variance')\n", "plt.legend()\n", + "save_fig(\"gdregression\")\n", "plt.show()" ] }, @@ -2584,11 +2588,14 @@ "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", + "save_fig(\"gdclassiffierconfusion\")\n", "plt.show()\n", "y_probas = gd_clf.predict_proba(X_test_scaled)\n", "skplt.metrics.plot_roc(y_test, y_probas)\n", + "save_fig(\"gdclassiffierroc\")\n", "plt.show()\n", "skplt.metrics.plot_cumulative_gain(y_test, y_probas)\n", + "save_fig(\"gdclassiffiercgain\")\n", "plt.show()" ] }, @@ -2718,20 +2725,25 @@ "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", + "save_fig(\"xdclassiffierconfusion\")\n", "plt.show()\n", "y_probas = xg_clf.predict_proba(X_test_scaled)\n", "skplt.metrics.plot_roc(y_test, y_probas)\n", + "save_fig(\"xdclassiffierroc\")\n", "plt.show()\n", "skplt.metrics.plot_cumulative_gain(y_test, y_probas)\n", + "save_fig(\"gdclassiffiercgain\")\n", "plt.show()\n", "\n", "\n", "xgb.plot_tree(xg_clf,num_trees=0)\n", "plt.rcParams['figure.figsize'] = [50, 10]\n", + "save_fig(\"xgtree\")\n", "plt.show()\n", "\n", "xgb.plot_importance(xg_clf)\n", "plt.rcParams['figure.figsize'] = [5, 5]\n", + "save_fig(\"xgparams\")\n", "plt.show()" ] } diff --git a/doc/pub/DecisionTrees/ipynb/ipynb-DecisionTrees-src.tar.gz b/doc/pub/DecisionTrees/ipynb/ipynb-DecisionTrees-src.tar.gz index 3edcdce6c..94698822b 100644 Binary files a/doc/pub/DecisionTrees/ipynb/ipynb-DecisionTrees-src.tar.gz and b/doc/pub/DecisionTrees/ipynb/ipynb-DecisionTrees-src.tar.gz differ diff --git a/doc/pub/DecisionTrees/pdf/DecisionTrees-minted.pdf b/doc/pub/DecisionTrees/pdf/DecisionTrees-minted.pdf index eb8c19711..bf798a0b1 100644 Binary files a/doc/pub/DecisionTrees/pdf/DecisionTrees-minted.pdf and b/doc/pub/DecisionTrees/pdf/DecisionTrees-minted.pdf differ diff --git a/doc/src/DecisionTrees/DecisionTrees.do.txt b/doc/src/DecisionTrees/DecisionTrees.do.txt index 2c9ec5a9a..c5545ed8f 100644 --- a/doc/src/DecisionTrees/DecisionTrees.do.txt +++ b/doc/src/DecisionTrees/DecisionTrees.do.txt @@ -1228,6 +1228,7 @@ plt.xlabel("Number of coin tosses") plt.ylabel("Heads ratio") plt.legend(loc="lower right") plt.axis([0, 10000, 0.42, 0.58]) +save_fig("votingsimple") plt.show() !ec @@ -1386,6 +1387,7 @@ plt.title("Decision Tree", fontsize=14) plt.subplot(122) plot_decision_boundary(bag_clf, X, y) plt.title("Decision Trees with Bagging", fontsize=14) +save_fig("baggingtree") plt.show() !ec @@ -1445,6 +1447,7 @@ plt.plot(polydegree, error, label='Error') plt.plot(polydegree, bias, label='bias') plt.plot(polydegree, variance, label='Variance') plt.legend() +save_fig("baggingboot") plt.show() !ec @@ -1940,6 +1943,7 @@ plt.plot(polydegree, error, label='Error') plt.plot(polydegree, bias, label='bias') plt.plot(polydegree, variance, label='Variance') plt.legend() +save_fig("gdregression") plt.show() !ec @@ -1978,11 +1982,14 @@ print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(gd_ import scikitplot as skplt y_pred = gd_clf.predict(X_test_scaled) skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +save_fig("gdclassiffierconfusion") plt.show() y_probas = gd_clf.predict_proba(X_test_scaled) skplt.metrics.plot_roc(y_test, y_probas) +save_fig("gdclassiffierroc") plt.show() skplt.metrics.plot_cumulative_gain(y_test, y_probas) +save_fig("gdclassiffiercgain") plt.show() !ec @@ -2092,20 +2099,25 @@ print("Test set accuracy with Random Forests and scaled data: {:.2f}".format(xg_ import scikitplot as skplt y_pred = xg_clf.predict(X_test_scaled) skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True) +save_fig("xdclassiffierconfusion") plt.show() y_probas = xg_clf.predict_proba(X_test_scaled) skplt.metrics.plot_roc(y_test, y_probas) +save_fig("xdclassiffierroc") plt.show() skplt.metrics.plot_cumulative_gain(y_test, y_probas) +save_fig("gdclassiffiercgain") plt.show() xgb.plot_tree(xg_clf,num_trees=0) plt.rcParams['figure.figsize'] = [50, 10] +save_fig("xgtree") plt.show() xgb.plot_importance(xg_clf) plt.rcParams['figure.figsize'] = [5, 5] +save_fig("xgparams") plt.show() !ec