【问题标题】:Too many lines output from gridsearch when njobs large than 1当 njobs 大于 1 时,gridsearch 输出的行数过多
【发布时间】:2018-08-22 03:04:30
【问题描述】:

我使用以下代码进行网格搜索,设置 njobs=crossvalidation 折叠,但我得到了很多行,如下所示:

GridSearchCV(estimator = est,
                                cv = crossval_n,
                                n_jobs = crossval_n,
                                param_grid = param_grid,
                                scoring = grid_score,
                                verbose = 1000)

信息是这样的:

Pickling array (shape=(2,), dtype=object).
Pickling array (shape=(7,), dtype=object).
Pickling array (shape=(5,), dtype=object).
Pickling array (shape=(5,), dtype=object).
Pickling array (shape=(2,), dtype=object).
Memmaping (shape=(300000,), dtype=float64) to old file /dev/shm/joblib_memmaping_pool_31858_140577309572624/31858-140577424627920-252eb20f1c96190cb0ef65643005ff1e.pkl
Memmaping (shape=(199999,), dtype=int64) to old file /dev/shm/joblib_memmaping_pool_31858_140577309572624/31858-140577424627920-e2ad805d63b492d1bda22f6ecd785fa9.pkl
Pickling array (shape=(100001,), dtype=int64).
[CV]  n_estimators=25, loss=deviance, learning_rate=0.05, max_depth=3, score=0.663848252373, total= 4.5min
[CV] n_estimators=100, loss=deviance, learning_rate=0.05, max_depth=3 
[Parallel(n_jobs=3)]: Done   1 tasks      | elapsed:  4.9min
Pickling array (shape=(3376,), dtype=object).
Memmaping (shape=(73, 300000), dtype=float64) to old file /dev/shm/joblib_memmaping_pool_31858_140577309572624/31858-140577424627920-2a1a398dde29f0da54a999a91072b77b.pkl
Memmaping (shape=(1, 300000), dtype=int64) to old file /dev/shm/joblib_memmaping_pool_31858_140577309572624/31858-140577424627920-108448b3fbe2af627fc26e0b965874b9.pkl
Memmaping (shape=(62, 300000), dtype=float64) to old file /dev/shm/joblib_memmaping_pool_31858_140577309572624/31858-140577424627920-32d40c577c413ff0ea04ade1cc62a62e.pkl

不确定 1)关于什么信息? 2)如果我得到这些信息有什么错误吗? 3) 如果不是错误信息,如何禁用打印出来?

【问题讨论】:

    标签: python scikit-learn cloudera grid-search


    【解决方案1】:

    查看您正在使用的 verbose 参数。

    verbose : integer
    
        Controls the verbosity: the higher, the more messages.
    

    您正在使用verbose=1000,因此您将在输出中获得调整过程的进度。

    更改 verbose=0 以禁用它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-04
      • 2020-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多