【发布时间】:2022-01-03 21:18:10
【问题描述】:
我正在尝试使用 XGBRanker 模型通过 RandomizedSearchCV 调整我的超参数。
我可以将数据分组,将其输入模型并进行预测。但是我不确定如何设置 Search 对象,即 2 个具体的东西 - 如何通知它关于组以及我需要提供什么样的分数。
model = xg.XGBRanker(
tree_method='exact',
booster='gbtree',
objective='rank:pairwise',
random_state=42,
learning_rate=0.06,
max_depth=5,
n_estimators=700,
subsample=0.75,
#colsample_bytree=0.9,
#subsample=0.75
min_child_weight=0.06
)
model.fit(x_train, y_train, group=train_groups, verbose=True)
这很好用。 这是我需要帮助的地方
param_dist = {'n_estimators': stats.randint(40, 1000),
'learning_rate': stats.uniform(0.01, 0.59),
'subsample': stats.uniform(0.3, 0.6),
'max_depth': [3, 4, 5, 6, 7, 8, 9],
'colsample_bytree': stats.uniform(0.5, 0.4),
'min_child_weight': [0.05, 0.1, 0.02]
}
clf = RandomizedSearchCV(model,
param_distributions=param_dist,
cv=5,
n_iter=5,
scoring=???, #
error_score=0,
verbose=3,
n_jobs=-1)
#also what about the groups?
【问题讨论】:
标签: xgboost ranking hyperparameters lightgbm