sklearn 之调参GridSearchCV

sklearn.model_selection.GridSearchCV

 

GridSearchCV(estimator, param_grid, scoring=None, n_jobs=None, iid='deprecated', refit=True, cv=None, verbose=0, pre_dispatch='2*n_jobs', error_score=nan, return_train_score=False)

cv_results_         dict of numpy (masked) ndarrays

 

 

will be represented by a cv_results_ dict of:

{
'param_kernel': masked_array(data = ['poly', 'poly', 'rbf', 'rbf'],
                             mask = [False False False False]...)
'param_gamma': masked_array(data = [-- -- 0.1 0.2],
                            mask = [ True  True False False]...),
'param_degree': masked_array(data = [2.0 3.0 -- --],
                             mask = [False False  True  True]...),
'split0_test_score'  : [0.80, 0.70, 0.80, 0.93],
'split1_test_score'  : [0.82, 0.50, 0.70, 0.78],
'mean_test_score'    : [0.81, 0.60, 0.75, 0.85],
'std_test_score'     : [0.01, 0.10, 0.05, 0.08],
'rank_test_score'    : [2, 4, 3, 1],
'split0_train_score' : [0.80, 0.92, 0.70, 0.93],
'split1_train_score' : [0.82, 0.55, 0.70, 0.87],
'mean_train_score'   : [0.81, 0.74, 0.70, 0.90],
'std_train_score'    : [0.01, 0.19, 0.00, 0.03],
'mean_fit_time'      : [0.73, 0.63, 0.43, 0.49],
'std_fit_time'       : [0.01, 0.02, 0.01, 0.01],
'mean_score_time'    : [0.01, 0.06, 0.04, 0.04],
'std_score_time'     : [0.00, 0.00, 0.00, 0.01],
'params'             : [{'kernel': 'poly', 'degree': 2}, ...],
}

best_estimator_      estimator

 

 

best_score_     float

Mean cross-validated score of the best_estimator

 

 

best_params_   dict

Parameter setting that gave the best results on the hold out data.

 

best_index_   int

The index (of the cv_results_ arrays) which corresponds to the best candidate parameter setting.

The dict at search.cv_results_['params'][search.best_index_] gives the parameter setting for the best model, that gives the highest mean score (search.best_score_).

 

scorer_   function or a dict

Scorer function used on the held out data to choose the best parameters for the model.

 

n_splits_    int

The number of cross-validation splits (folds/iterations).

refit_time_    float

Seconds used for refitting the best model on the whole dataset.

 

Methods

decision_function(self, X)

Call decision_function on the estimator with the best found parameters.

fit(self, X[, y, groups])

Run fit with all sets of parameters.

get_params(self[, deep])

Get parameters for this estimator.

inverse_transform(self, Xt)

Call inverse_transform on the estimator with the best found params.

predict(self, X)

Call predict on the estimator with the best found parameters.

predict_log_proba(self, X)

Call predict_log_proba on the estimator with the best found parameters.

predict_proba(self, X)

Call predict_proba on the estimator with the best found parameters.

score(self, X[, y])

Returns the score on the given data, if the estimator has been refit.

set_params(self, \*\*params)

Set the parameters of this estimator.

transform(self, X)

Call transform on the estimator with the best found parameters.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值