noise
X, y = make_moons(n_samples=500, noise=0.3, random_state=42)
X_train, X_test, y_train, y_test...= train_test_split(X, y, random_state=42)
plt.plot(X[:, 0][y == 0], X[:, 1][y == 0], 'ro', alpha=0.6)...=True, # 是否随机采样
n_jobs=-1, # 是否多线程计算,-1表⽰使⽤所有CPU
random_state=42)
bag_clf.fit(X_train, y_train)
y_pred...=42)
gbdt = GradientBoostingRegressor(max_depth=2,
n_estimators=120,
learning_rate=1.0,
random_state...GradientBoostingRegressor(max_depth=2,
n_estimators=best_n_estimators,
random_state=42)
gbdt_best.fit