def test_logitboost_hastie_fitting():
c = LogitBoostClassifier(
base_estimator=DecisionTreeRegressor(max_depth=1),
n_estimators=30,
learning_rate=1.0
)
data = Hastie_10_2()
c.fit(data.data, np.sign(data.labels))
assert_array_less(c.estimator_errors_, 0.5)
assert zero_one_loss(np.sign(data.labels), c.predict(data.data)) < 0.2
评论列表
文章目录