【发布时间】:2019-01-28 00:43:33
【问题描述】:
我正在使用 XGBoost 算法进行回归,
clf = XGBRegressor(eval_set = [(X_train, y_train), (X_val, y_val)],
early_stopping_rounds = 10,
n_estimators = 10,
verbose = 50)
clf.fit(X_train, y_train, verbose=False)
print("Best Iteration: {}".format(clf.booster().best_iteration))
它正确地训练自己,但打印函数引发以下错误,
TypeError: 'str' object is not callable
如何获得模型的最佳 迭代次数?
此外,如何打印每个 round的training error?
【问题讨论】:
标签: python-3.x machine-learning regression xgboost