我试图使用 GridSearch 来迭代 MeanShift 算法的不同带宽值,它显示了这个错误;你们有谁知道我该如何解决这个问题?非常感谢!
# Using GridSearch for Algorithm Tuning
from sklearn.model_selection import GridSearchCV
meanshift=MeanShift()
C = range(48, 69) # For MeanShift bandwidth
param_grid = {"bandwidth": range(48, 69)}
mean_grid = GridSearchCV(estimator=meanshift, param_grid=param_grid, scoring=None)
mean_grid.fit(X)
这是我得到的错误:
TypeError: If no scoring is specified, the estimator passed should have a 'score' method. The estimator MeanShift(bandwidth=None, bin_seeding=False, cluster_all=True, min_bin_freq=1,
n_jobs=1, seeds=None) does not.