在使用GridSearchCV进行LogisticRegression进行超参数调整时,出现以下错误:
ValueError: Invalid parameter Hparam
对于估算器:
LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True, intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=-1, penalty='l1', random_state=None, solver='liblinear', tol=0.0001, verbose=1, warm_start=False)
我在下面编写了代码:
hparam=[]
a = 0.0001
while(a<100000):
hparam.append(a)
a*=2
LReg = LogisticRegression(penalty='l1',verbose=1,n_jobs=-1)
param_grid = {'Hparam':hparam}
grid_ = GridSearchCV(LReg, param_grid, scoring='roc_auc', cv=10)
grid_.fit(xtr_,ytr_)