【发布时间】:2022-01-04 04:57:36
【问题描述】:
我正在做一个项目,我需要估计分布的密度函数。所以我使用了 GridSearchCV:
param_grid = {'kernel': ['gaussian', 'epanechnikov', 'exponential', 'linear', 'tophat', 'cosine'], 'bandwidth': np.linspace (0.01, .5, 1000)}
grid = GridSearchCV (
estimator = KernelDensity (),
param_grid = param_grid,
n_jobs = -1,
cv = 2,
verbose = 0,
)
我打印了 print(grid.best_params_, ":", grid.best_score_)
但是 best_score 给我的值在 16 和 cv = 2 或 800 和 cv = 50 之间。我真的不明白 best_score_ 是什么意思,因为在库中它说:
best_score_float
Mean cross-validated score of the best_estimator
它是如何计算的?我们是在寻找 best_estimator 的大值还是小值以获得更好的拟合?
谢谢
【问题讨论】:
-
超参数搜索总是试图最大化分数(很容易从
cv_results_检查);因此像 negative 均方误差之类的东西。
标签: python scikit-learn gridsearchcv