在 Scikit 中找到最佳超参数时出现 ValueError 使用 GridSearchCV 学习 LogisticRegression
ValueError while finding best hyperparameter in Scikit learn LogisticRegression using GridSearchCV
在使用 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_)
Refer sci-kit Logistic Regression,Hparam 未列为逻辑回归的超参数
在使用 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_)
Refer sci-kit Logistic Regression,Hparam 未列为逻辑回归的超参数