【问题标题】:Hyperopt in Python: how to define the real loss value decreased by functionPython中的Hyperopt:如何定义函数减少的真实损失值
【发布时间】:2020-10-12 11:52:51
【问题描述】:

我在 Python 3.7 中使用 Hyperopt 选择 XGBoost 模型的参数。

作为目标,我使用返回多个值的函数,包括损失:

def objective(params, n_folds = nfold):
...
    return {'loss': loss, 'params': params, 'iteration': ITERATION,
            'estimators': n_estimators, 
            'train_time': run_time, 'status': STATUS_OK}

在我的例子中,'loss' - 不是交叉验证中的包容性参数(例如'auc'),但它是自制的指标。 我希望,这将通过迭代减少,但它会继续变化,就像在随机方法中一样。

此外,当我看到 fmin 计算状态时(示例 - 如下)。我看到完全不同的指标正在下降。

XGB CV model report                                                                                                    
    Best test-auc-mean 98.51% (std: 0.21%)
 83%|███████████████████████████████████████▏       | 25/30 [08:26<07:23, 88.64s/trial, best loss: 0.22099999999999997] 

我怎么知道,Hyperopt 降低的实际指标是什么?

【问题讨论】:

    标签: python python-3.x xgboost hyperparameters hyperopt


    【解决方案1】:

    下面的最佳损失 - 是我的指标。我很困惑,因为它显示的不是当前的度量值,而是最好的。 此外,该算法正在尝试改进它。但是,可能在 30 次而不是数百次迭代后看到指标的改进。

    XGB CV 模型报告
    最佳测试-auc-mean 98.51% (std: 0.21%) 83%|███████████████████████████████████████▏ | 25/30 [08:26

    【讨论】:

      猜你喜欢
      • 2020-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-20
      • 2021-09-05
      • 2021-12-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多