I am using logistic regression on loan prediction data. I am using GridSearchCV for Hyperparameter tuning and I have been trying to find a source where I could add multiple number of values for cv. for example; I want to run my model with 3, 5, 6, 7, 10 folds. This is my code:
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)
parameters = {'penalty': ['l1', 'l2'],
'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000],
'solver' : ['liblinear', 'newton-cg', 'lbfgs', 'saga', 'sag'],
'multi_class' : ['auto'],
'max_iter' : [5,15,25],
}
s_scaled_X_train = s_scaler.fit_transform(X_train)
s_scaled_X_test = s_scaler.transform(X_test)
logmodel = GridSearchCV(LogisticRegression(), parameters, cv = 10, refit = True)
I tried to look into sources where I could find a solution on how to add more numbers in the cv value here.
logmodel = GridSearchCV(LogisticRegression(), parameters, cv = 10, refit = True)
I tried something like:
bb = [3, 5, 6, 7, 10]
cv_folds = bb
and I tried to add it to the logmodel.
logmodel = GridSearchCV(LogisticRegression(), parameters, cv = cv_folds, refit = True)
This is the error I got while running it
TypeError: cannot unpack non-iterable int object