0

我正在使用 pycaret 2.2.3 这是我正在运行的代码的基本版本:

from pycaret.regression import *
setup = setup(data = data_used,  target = 'BAI')
lightgbm = create_model('lightgbm')
tuned_lightgbm = tune_model(lightgbm)
print(tuned_lightgbm)

功能tune_model()

对 10 个候选者中的每一个进行拟合 10 次,总共 100 次拟合

结果,我从测试的 100 个模型中获得了最佳拟合模型的 10 倍交叉验证的指标:

MAE MSE RMSE    R2  RMSLE   MAPE
0   2.0706  7.6366  2.7634  0.9658  0.1449  0.1540
1   2.2962  9.3864  3.0637  0.9557  0.1599  0.1489
2   2.2041  9.6054  3.0993  0.9585  0.2201  0.1907
3   1.9354  8.4334  2.9040  0.9539  0.2101  0.3200
4   1.8326  7.5099  2.7404  0.9584  0.1853  0.2637
5   1.8118  8.5014  2.9157  0.9289  0.2276  0.4220
6   1.4395  4.1903  2.0470  0.9803  0.1414  0.1685
7   2.9774  34.8474 5.9032  0.7861  0.4410  0.4381
8   2.2774  9.8567  3.1395  0.9480  0.1415  0.1194
9   2.1810  8.5512  2.9242  0.9605  0.1607  0.2271
Mean 2.1026 10.8519 3.1501  0.9396  0.2032  0.2452
SD  0.3842  8.1427  0.9639  0.0526  0.0851  0.1082

当我使用时,print(tuned_lightgbm)我得到以下超参数:

 LGBMRegressor(bagging_fraction=0.8, bagging_freq=4, boosting_type='gbdt',
          class_weight=None, colsample_bytree=1.0, feature_fraction=0.4,
          importance_type='split', learning_rate=0.062, max_depth=-1,
          min_child_samples=55, min_child_weight=0.001, min_split_gain=0.8,
          n_estimators=170, n_jobs=-1, num_leaves=50, objective=None,
          random_state=989, reg_alpha=4, reg_lambda=0.4, silent=True,
          subsample=1.0, subsample_for_bin=200000, subsample_freq=0)

有没有办法查看/打印/访问所有 100 个测试模型的指标和超参数?

4

0 回答 0