我正在使用以下多输出分离器:
from xgboost import XGBRegressor
from sklearn.multioutput import MultiOutputRegressor
#Define the estimator
estimator = XGBRegressor(
objective = 'reg:squarederror'
)
# Define the model
my_model = MultiOutputRegressor(estimator = estimator, n_jobs = -1).fit(X_train, y_train)
我希望使用验证集来评估XGBRegressionr的性能,但是我认为MultiOutputRegressor
不支持将eval_set
传递给fit函数
在这种情况下,如何使用验证集?是否有任何变通方法可以调整XGBRegressionor以获得多个输出
您可以尝试编辑
MultiOutputRegressor
对象的fit
方法,如下所示:然后将
eval_set
传递给fit
方法:相关问题 更多 >
编程相关推荐