当前位置: 首页 > 工具软件 > FLAML > 使用案例 >

AutoML之flaml:基于OpenML数据集利用pipeline结合flaml框架(自动化选择最佳模型+重加载模型并推理)实现预测航班是否延误二分类案例

郏兴贤
2023-12-01

AutoML之flaml:基于OpenML数据集利用pipeline结合flaml框架(自动化选择最佳模型+重加载模型并推理)实现预测航班是否延误二分类案例

目录

基于OpenML数据集利用pipeline结合flaml框架(自动化选择最佳模型+重加载模型并推理)实现预测航班是否延误二分类案例

 # 1、定义数据集

# 3、模型流水线自动化调优

# 3.1、构建建模流水线

# 3.2、模型训练

# 设定参数

# 3.3、输出最佳算法及其最佳参数


相关文章
AutoML之flaml:基于OpenML数据集利用pipeline结合flaml框架(自动化选择最佳模型+重加载模型并推理)实现预测航班是否延误二分类案例
AutoML之flaml:基于OpenML数据集利用pipeline结合flaml框架(自动化选择最佳模型+重加载模型并推理)实现预测航班是否延误二分类案例实现代码

基于OpenML数据集利用pipeline结合flaml框架(自动化选择最佳模型+重加载模型并推理)实现预测航班是否延误二分类案例

 # 1、定义数据集

load dataset from ./openml_ds1169.pkl
Dataset name: airlines
X_train.shape: (404537, 7), y_train.shape: (404537,);
X_test.shape: (134846, 7), y_test.shape: (134846,)
<class 'numpy.ndarray'>
[[1.000e+00 8.600e+02 1.830e+02 ... 1.000e+00 1.045e+03 1.850e+02]
 [5.000e+00 4.630e+02 1.500e+01 ... 6.000e+00 9.900e+02 2.160e+02]
 [1.400e+01 2.747e+03 7.100e+01 ... 4.000e+00 1.185e+03 1.300e+02]
 ...
 [8.000e+00 3.862e+03 3.900e+01 ... 3.000e+00 3.450e+02 1.190e+02]
 [4.000e+00 2.799e+03 2.500e+01 ... 3.000e+00 8.750e+02 2.010e+02]
 [1.700e+01 6.160e+02 2.050e+02 ... 4.000e+00 3.900e+02 1.400e+02]]
[1 0 1 ... 0 1 1]

# 3、模型流水线自动化调优

# 3.1、构建建模流水线

Pipeline(steps=[('imputuer', SimpleImputer()),
                ('standardizer', StandardScaler()),
                ('automl',
                 AutoML(append_log=False, auto_augment=True, custom_hp={},
                        cv_score_agg_func=None, early_stop=False,
                        ensemble=False, estimator_list='auto',
                        eval_method='auto', fit_kwargs_by_estimator={},
                        force_cancel=False, free_mem_ratio=0, hpo_method='auto',
                        keep_search_state=False, learner_selector='sample',
                        log_file_name='', log_training_metric=False,
                        log_type='better', max_iter=None, mem_thres=4294967296,
                        metric='auto', metric_constraints=[],
                        min_sample_size=10000, model_history=False,
                        n_concurrent_trials=1, n_jobs=-1, n_splits=5,
                        pred_time_limit=inf, preserve_checkpoint=True,
                        retrain_full=True, sample=True, ...))])

# 3.2、模型训练

# 设定参数

[flaml.automl.automl: 03-16 23:01:20] {2726} INFO - task = classification
[flaml.automl.automl: 03-16 23:01:20] {2728} INFO - Data split method: stratified
[flaml.automl.automl: 03-16 23:01:20] {2731} INFO - Evaluation method: holdout
[flaml.automl.automl: 03-16 23:01:21] {2858} INFO - Minimizing error metric: 1-accuracy
[flaml.automl.automl: 03-16 23:01:21] {3004} INFO - List of ML learners in AutoML Run: ['xgboost', 'catboost', 'lgbm']
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 0, current learner xgboost
[flaml.automl.automl: 03-16 23:01:21] {3472} INFO - Estimated sufficient time budget=185004s. Estimated necessary time budget=204s.
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.7s,	estimator xgboost's best error=0.3745,	best estimator xgboost's best error=0.3745
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 1, current learner lgbm
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.7s,	estimator lgbm's best error=0.3782,	best estimator xgboost's best error=0.3745
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 2, current learner lgbm
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.7s,	estimator lgbm's best error=0.3782,	best estimator xgboost's best error=0.3745
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 3, current learner lgbm
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.7s,	estimator lgbm's best error=0.3745,	best estimator xgboost's best error=0.3745
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 4, current learner xgboost
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.8s,	estimator xgboost's best error=0.3745,	best estimator xgboost's best error=0.3745
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 5, current learner lgbm
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.8s,	estimator lgbm's best error=0.3610,	best estimator lgbm's best error=0.3610
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 6, current learner lgbm
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.8s,	estimator lgbm's best error=0.3610,	best estimator lgbm's best error=0.3610
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 7, current learner lgbm
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.8s,	estimator lgbm's best error=0.3610,	best estimator lgbm's best error=0.3610
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 8, current learner lgbm
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.8s,	estimator lgbm's best error=0.3610,	best estimator lgbm's best error=0.3610
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 9, current learner lgbm
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.9s,	estimator lgbm's best error=0.3574,	best estimator lgbm's best error=0.3574
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 10, current learner lgbm
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 0.9s,	estimator lgbm's best error=0.3574,	best estimator lgbm's best error=0.3574
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 11, current learner lgbm
[flaml.automl.automl: 03-16 23:01:21] {3519} INFO -  at 1.0s,	estimator lgbm's best error=0.3520,	best estimator lgbm's best error=0.3520
[flaml.automl.automl: 03-16 23:01:21] {3334} INFO - iteration 12, current learner lgbm
[flaml.automl.automl: 03-16 23:01:22] {3519} INFO -  at 1.1s,	estimator lgbm's best error=0.3520,	best estimator lgbm's best error=0.3520
[flaml.automl.automl: 03-16 23:01:22] {3334} INFO - iteration 13, current learner lgbm
[flaml.automl.automl: 03-16 23:01:22] {3519} INFO -  at 1.3s,	estimator lgbm's best error=0.3485,	best estimator lgbm's best error=0.3485
[flaml.automl.automl: 03-16 23:01:22] {3334} INFO - iteration 14, current learner xgboost
[flaml.automl.automl: 03-16 23:01:22] {3519} INFO -  at 1.3s,	estimator xgboost's best error=0.3745,	best estimator lgbm's best error=0.3485
[flaml.automl.automl: 03-16 23:01:22] {3334} INFO - iteration 15, current learner lgbm
[flaml.automl.automl: 03-16 23:01:22] {3519} INFO -  at 1.6s,	estimator lgbm's best error=0.3485,	best estimator lgbm's best error=0.3485
[flaml.automl.automl: 03-16 23:01:22] {3334} INFO - iteration 16, current learner xgboost
[flaml.automl.automl: 03-16 23:01:22] {3519} INFO -  at 1.6s,	estimator xgboost's best error=0.3736,	best estimator lgbm's best error=0.3485
[flaml.automl.automl: 03-16 23:01:22] {3334} INFO - iteration 17, current learner lgbm
[flaml.automl.automl: 03-16 23:01:22] {3519} INFO -  at 1.8s,	estimator lgbm's best error=0.3485,	best estimator lgbm's best error=0.3485
[flaml.automl.automl: 03-16 23:01:22] {3334} INFO - iteration 18, current learner lgbm
[flaml.automl.automl: 03-16 23:01:23] {3519} INFO -  at 2.1s,	estimator lgbm's best error=0.3485,	best estimator lgbm's best error=0.3485
[flaml.automl.automl: 03-16 23:01:23] {3334} INFO - iteration 19, current learner lgbm
[flaml.automl.automl: 03-16 23:01:23] {3519} INFO -  at 2.4s,	estimator lgbm's best error=0.3470,	best estimator lgbm's best error=0.3470
[flaml.automl.automl: 03-16 23:01:23] {3334} INFO - iteration 20, current learner xgboost
[flaml.automl.automl: 03-16 23:01:23] {3519} INFO -  at 2.5s,	estimator xgboost's best error=0.3702,	best estimator lgbm's best error=0.3470
[flaml.automl.automl: 03-16 23:01:23] {3334} INFO - iteration 21, current learner xgboost
[flaml.automl.automl: 03-16 23:01:23] {3519} INFO -  at 2.5s,	estimator xgboost's best error=0.3702,	best estimator lgbm's best error=0.3470
[flaml.automl.automl: 03-16 23:01:23] {3334} INFO - iteration 22, current learner lgbm
[flaml.automl.automl: 03-16 23:01:24] {3519} INFO -  at 3.4s,	estimator lgbm's best error=0.3470,	best estimator lgbm's best error=0.3470
[flaml.automl.automl: 03-16 23:01:24] {3334} INFO - iteration 23, current learner lgbm
[flaml.automl.automl: 03-16 23:01:24] {3519} INFO -  at 3.7s,	estimator lgbm's best error=0.3470,	best estimator lgbm's best error=0.3470
[flaml.automl.automl: 03-16 23:01:24] {3334} INFO - iteration 24, current learner xgboost
[flaml.automl.automl: 03-16 23:01:24] {3519} INFO -  at 3.7s,	estimator xgboost's best error=0.3604,	best estimator lgbm's best error=0.3470
[flaml.automl.automl: 03-16 23:01:24] {3334} INFO - iteration 25, current learner xgboost
[flaml.automl.automl: 03-16 23:01:24] {3519} INFO -  at 3.7s,	estimator xgboost's best error=0.3604,	best estimator lgbm's best error=0.3470
[flaml.automl.automl: 03-16 23:01:24] {3334} INFO - iteration 26, current learner lgbm
[flaml.automl.automl: 03-16 23:01:25] {3519} INFO -  at 4.6s,	estimator lgbm's best error=0.3470,	best estimator lgbm's best error=0.3470
[flaml.automl.automl: 03-16 23:01:25] {3334} INFO - iteration 27, current learner lgbm
[flaml.automl.automl: 03-16 23:01:27] {3519} INFO -  at 6.4s,	estimator lgbm's best error=0.3355,	best estimator lgbm's best error=0.3355
[flaml.automl.automl: 03-16 23:01:27] {3334} INFO - iteration 28, current learner xgboost
[flaml.automl.automl: 03-16 23:01:27] {3519} INFO -  at 6.4s,	estimator xgboost's best error=0.3604,	best estimator lgbm's best error=0.3355
[flaml.automl.automl: 03-16 23:01:27] {3334} INFO - iteration 29, current learner xgboost
[flaml.automl.automl: 03-16 23:01:27] {3519} INFO -  at 6.4s,	estimator xgboost's best error=0.3584,	best estimator lgbm's best error=0.3355
[flaml.automl.automl: 03-16 23:01:27] {3334} INFO - iteration 30, current learner xgboost
[flaml.automl.automl: 03-16 23:01:27] {3519} INFO -  at 6.5s,	estimator xgboost's best error=0.3584,	best estimator lgbm's best error=0.3355
[flaml.automl.automl: 03-16 23:01:27] {3334} INFO - iteration 31, current learner lgbm
[flaml.automl.automl: 03-16 23:01:28] {3519} INFO -  at 7.3s,	estimator lgbm's best error=0.3355,	best estimator lgbm's best error=0.3355
[flaml.automl.automl: 03-16 23:01:28] {3334} INFO - iteration 32, current learner xgboost
[flaml.automl.automl: 03-16 23:01:28] {3519} INFO -  at 7.3s,	estimator xgboost's best error=0.3584,	best estimator lgbm's best error=0.3355
[flaml.automl.automl: 03-16 23:01:28] {3334} INFO - iteration 33, current learner xgboost
[flaml.automl.automl: 03-16 23:01:28] {3519} INFO -  at 7.4s,	estimator xgboost's best error=0.3584,	best estimator lgbm's best error=0.3355
[flaml.automl.automl: 03-16 23:01:28] {3334} INFO - iteration 34, current learner lgbm
[flaml.automl.automl: 03-16 23:01:33] {3519} INFO -  at 12.7s,	estimator lgbm's best error=0.3312,	best estimator lgbm's best error=0.3312
[flaml.automl.automl: 03-16 23:01:33] {3334} INFO - iteration 35, current learner catboost
[flaml.automl.automl: 03-16 23:01:34] {3519} INFO -  at 13.9s,	estimator catboost's best error=0.3584,	best estimator lgbm's best error=0.3312
[flaml.automl.automl: 03-16 23:01:34] {3334} INFO - iteration 36, current learner catboost
[flaml.automl.automl: 03-16 23:01:37] {3519} INFO -  at 17.0s,	estimator catboost's best error=0.3581,	best estimator lgbm's best error=0.3312
[flaml.automl.automl: 03-16 23:01:37] {3334} INFO - iteration 37, current learner lgbm
[flaml.automl.automl: 03-16 23:01:44] {3519} INFO -  at 23.8s,	estimator lgbm's best error=0.3311,	best estimator lgbm's best error=0.3311
[flaml.automl.automl: 03-16 23:01:44] {3334} INFO - iteration 38, current learner xgboost
[flaml.automl.automl: 03-16 23:01:44] {3519} INFO -  at 23.8s,	estimator xgboost's best error=0.3584,	best estimator lgbm's best error=0.3311
[flaml.automl.automl: 03-16 23:01:44] {3334} INFO - iteration 39, current learner lgbm
[flaml.automl.automl: 03-16 23:01:49] {3519} INFO -  at 28.8s,	estimator lgbm's best error=0.3311,	best estimator lgbm's best error=0.3311
[flaml.automl.automl: 03-16 23:01:49] {3334} INFO - iteration 40, current learner lgbm
[flaml.automl.automl: 03-16 23:01:57] {3519} INFO -  at 37.0s,	estimator lgbm's best error=0.3311,	best estimator lgbm's best error=0.3311
[flaml.automl.automl: 03-16 23:01:57] {3334} INFO - iteration 41, current learner xgboost
[flaml.automl.automl: 03-16 23:01:58] {3519} INFO -  at 37.1s,	estimator xgboost's best error=0.3520,	best estimator lgbm's best error=0.3311
[flaml.automl.automl: 03-16 23:01:58] {3334} INFO - iteration 42, current learner xgboost
[flaml.automl.automl: 03-16 23:01:58] {3519} INFO -  at 37.2s,	estimator xgboost's best error=0.3520,	best estimator lgbm's best error=0.3311
[flaml.automl.automl: 03-16 23:01:58] {3334} INFO - iteration 43, current learner lgbm
[flaml.automl.automl: 03-16 23:02:04] {3519} INFO -  at 43.7s,	estimator lgbm's best error=0.3279,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:04] {3334} INFO - iteration 44, current learner xgboost
[flaml.automl.automl: 03-16 23:02:04] {3519} INFO -  at 43.9s,	estimator xgboost's best error=0.3508,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:04] {3334} INFO - iteration 45, current learner xgboost
[flaml.automl.automl: 03-16 23:02:04] {3519} INFO -  at 43.9s,	estimator xgboost's best error=0.3508,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:04] {3334} INFO - iteration 46, current learner lgbm
[flaml.automl.automl: 03-16 23:02:19] {3519} INFO -  at 58.1s,	estimator lgbm's best error=0.3279,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:19] {3334} INFO - iteration 47, current learner xgboost
[flaml.automl.automl: 03-16 23:02:19] {3519} INFO -  at 58.4s,	estimator xgboost's best error=0.3482,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:19] {3334} INFO - iteration 48, current learner xgboost
[flaml.automl.automl: 03-16 23:02:19] {3519} INFO -  at 58.5s,	estimator xgboost's best error=0.3482,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:19] {3334} INFO - iteration 49, current learner lgbm
[flaml.automl.automl: 03-16 23:02:23] {3519} INFO -  at 62.3s,	estimator lgbm's best error=0.3279,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:23] {3334} INFO - iteration 50, current learner xgboost
[flaml.automl.automl: 03-16 23:02:25] {3519} INFO -  at 64.4s,	estimator xgboost's best error=0.3482,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:25] {3334} INFO - iteration 51, current learner xgboost
[flaml.automl.automl: 03-16 23:02:26] {3519} INFO -  at 65.7s,	estimator xgboost's best error=0.3384,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:26] {3334} INFO - iteration 52, current learner xgboost
[flaml.automl.automl: 03-16 23:02:27] {3519} INFO -  at 66.6s,	estimator xgboost's best error=0.3374,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:27] {3334} INFO - iteration 53, current learner xgboost
[flaml.automl.automl: 03-16 23:02:28] {3519} INFO -  at 67.9s,	estimator xgboost's best error=0.3374,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:28] {3334} INFO - iteration 54, current learner lgbm
[flaml.automl.automl: 03-16 23:02:47] {3519} INFO -  at 86.6s,	estimator lgbm's best error=0.3279,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:47] {3334} INFO - iteration 55, current learner xgboost
[flaml.automl.automl: 03-16 23:02:48] {3519} INFO -  at 87.3s,	estimator xgboost's best error=0.3374,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:48] {3334} INFO - iteration 56, current learner xgboost
[flaml.automl.automl: 03-16 23:02:50] {3519} INFO -  at 89.3s,	estimator xgboost's best error=0.3374,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:50] {3334} INFO - iteration 57, current learner lgbm
[flaml.automl.automl: 03-16 23:02:52] {3519} INFO -  at 91.9s,	estimator lgbm's best error=0.3279,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:52] {3334} INFO - iteration 58, current learner xgboost
[flaml.automl.automl: 03-16 23:02:53] {3519} INFO -  at 92.3s,	estimator xgboost's best error=0.3374,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:53] {3334} INFO - iteration 59, current learner lgbm
[flaml.automl.automl: 03-16 23:02:56] {3519} INFO -  at 95.3s,	estimator lgbm's best error=0.3279,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:02:56] {3334} INFO - iteration 60, current learner xgboost
[flaml.automl.automl: 03-16 23:03:00] {3519} INFO -  at 99.9s,	estimator xgboost's best error=0.3289,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:03:00] {3334} INFO - iteration 61, current learner xgboost
[flaml.automl.automl: 03-16 23:03:03] {3519} INFO -  at 102.4s,	estimator xgboost's best error=0.3289,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:03:03] {3334} INFO - iteration 62, current learner xgboost
[flaml.automl.automl: 03-16 23:03:11] {3519} INFO -  at 110.2s,	estimator xgboost's best error=0.3289,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:03:11] {3334} INFO - iteration 63, current learner xgboost
[flaml.automl.automl: 03-16 23:03:12] {3519} INFO -  at 111.5s,	estimator xgboost's best error=0.3289,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:03:12] {3334} INFO - iteration 64, current learner xgboost
[flaml.automl.automl: 03-16 23:03:29] {3519} INFO -  at 128.6s,	estimator xgboost's best error=0.3289,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:03:29] {3334} INFO - iteration 65, current learner lgbm
[flaml.automl.automl: 03-16 23:03:53] {3519} INFO -  at 152.2s,	estimator lgbm's best error=0.3279,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:03:53] {3334} INFO - iteration 66, current learner xgboost
[flaml.automl.automl: 03-16 23:03:59] {3519} INFO -  at 158.5s,	estimator xgboost's best error=0.3289,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:03:59] {3334} INFO - iteration 67, current learner xgboost
[flaml.automl.automl: 03-16 23:04:04] {3519} INFO -  at 163.4s,	estimator xgboost's best error=0.3289,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:04:04] {3334} INFO - iteration 68, current learner xgboost
[flaml.automl.automl: 03-16 23:04:12] {3519} INFO -  at 171.3s,	estimator xgboost's best error=0.3286,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:04:12] {3334} INFO - iteration 69, current learner lgbm
[flaml.automl.automl: 03-16 23:04:16] {3519} INFO -  at 175.6s,	estimator lgbm's best error=0.3279,	best estimator lgbm's best error=0.3279
[flaml.automl.automl: 03-16 23:04:16] {3334} INFO - iteration 70, current learner lgbm
[flaml.automl.automl: 03-16 23:04:28] {3519} INFO -  at 187.9s,	estimator lgbm's best error=0.3263,	best estimator lgbm's best error=0.3263
[flaml.automl.automl: 03-16 23:04:28] {3334} INFO - iteration 71, current learner lgbm
[flaml.automl.automl: 03-16 23:04:40] {3519} INFO -  at 199.5s,	estimator lgbm's best error=0.3263,	best estimator lgbm's best error=0.3263
[flaml.automl.automl: 03-16 23:04:40] {3334} INFO - iteration 72, current learner lgbm
[flaml.automl.automl: 03-16 23:04:55] {3519} INFO -  at 214.7s,	estimator lgbm's best error=0.3263,	best estimator lgbm's best error=0.3263
[flaml.automl.automl: 03-16 23:04:55] {3334} INFO - iteration 73, current learner lgbm
[flaml.automl.automl: 03-16 23:05:56] {3519} INFO -  at 276.0s,	estimator lgbm's best error=0.3263,	best estimator lgbm's best error=0.3263
[flaml.automl.automl: 03-16 23:06:05] {3783} INFO - retrain lgbm for 8.8s
[flaml.automl.automl: 03-16 23:06:05] {3790} INFO - retrained model: LGBMClassifier(colsample_bytree=0.44895237755639833,
               learning_rate=0.07437934949304319, max_bin=1023,
               min_child_samples=6, n_estimators=752, num_leaves=121,
               reg_alpha=0.11710512108661866, reg_lambda=0.05724124558328808,
               verbose=-1)
[flaml.automl.automl: 03-16 23:06:05] {3034} INFO - fit succeeded
[flaml.automl.automl: 03-16 23:06:05] {3035} INFO - Time taken to find the best model: 187.91257643699646
estimator: LGBMClassifier(colsample_bytree=0.44895237755639833,
               learning_rate=0.07437934949304319, max_bin=1023,
               min_child_samples=6, n_estimators=752, num_leaves=121,
               reg_alpha=0.11710512108661866, reg_lambda=0.05724124558328808,
               verbose=-1)

# 3.3、输出最佳算法及其最佳参数

best_estimator: lgbm
best_config: {'n_estimators': 752, 'num_leaves': 121, 'min_child_samples': 6, 'learning_rate': 0.07437934949304319, 'log_max_bin': 10, 'colsample_bytree': 0.44895237755639833, 'reg_alpha': 0.11710512108661866, 'reg_lambda': 0.05724124558328808}
best_loss: 0.6737
best_config_train_time: 8.756 s

 类似资料: