|
35 | 35 |
|
36 | 36 | from sklearn.datasets import make_gaussian_quantiles |
37 | 37 | from sklearn.ensemble import AdaBoostClassifier |
38 | | -from sklearn.externals.six.moves import xrange |
39 | 38 | from sklearn.metrics import accuracy_score |
40 | 39 | from sklearn.tree import DecisionTreeClassifier |
41 | 40 |
|
|
84 | 83 | plt.figure(figsize=(15, 5)) |
85 | 84 |
|
86 | 85 | plt.subplot(131) |
87 | | -plt.plot(xrange(1, n_trees_discrete + 1), |
| 86 | +plt.plot(range(1, n_trees_discrete + 1), |
88 | 87 | discrete_test_errors, c='black', label='SAMME') |
89 | | -plt.plot(xrange(1, n_trees_real + 1), |
| 88 | +plt.plot(range(1, n_trees_real + 1), |
90 | 89 | real_test_errors, c='black', |
91 | 90 | linestyle='dashed', label='SAMME.R') |
92 | 91 | plt.legend() |
|
95 | 94 | plt.xlabel('Number of Trees') |
96 | 95 |
|
97 | 96 | plt.subplot(132) |
98 | | -plt.plot(xrange(1, n_trees_discrete + 1), discrete_estimator_errors, |
| 97 | +plt.plot(range(1, n_trees_discrete + 1), discrete_estimator_errors, |
99 | 98 | "b", label='SAMME', alpha=.5) |
100 | | -plt.plot(xrange(1, n_trees_real + 1), real_estimator_errors, |
| 99 | +plt.plot(range(1, n_trees_real + 1), real_estimator_errors, |
101 | 100 | "r", label='SAMME.R', alpha=.5) |
102 | 101 | plt.legend() |
103 | 102 | plt.ylabel('Error') |
|
108 | 107 | plt.xlim((-20, len(bdt_discrete) + 20)) |
109 | 108 |
|
110 | 109 | plt.subplot(133) |
111 | | -plt.plot(xrange(1, n_trees_discrete + 1), discrete_estimator_weights, |
| 110 | +plt.plot(range(1, n_trees_discrete + 1), discrete_estimator_weights, |
112 | 111 | "b", label='SAMME') |
113 | 112 | plt.legend() |
114 | 113 | plt.ylabel('Weight') |
|
0 commit comments