I would like to use train, test, validate set for parameter tuning using randomsearchcv. I test with iris data and here is my code.
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import RandomizedSearchCV
from scipy.stats import uniform
iris = load_iris()
train_idx = list(range(100)) # just make it simple without using randomization
val_idx = list(range(100, 125)) # just make it simple without using randomization
test_idx = list(range(125, 150)) # just make it simple without using randomization
logistic = LogisticRegression(solver='saga', tol=1e-2, max_iter=200,random_state=0)
distributions = dict(C=uniform(loc=0, scale=4),penalty=['l2', 'l1'])
clf = RandomizedSearchCV(logistic, distributions, random_state=0,
cv=[train_idx, val_idx])
search = clf.fit(iris.data, iris.target)
search.best_params_
But I got ValueError: too many values to unpack (expected 2)
. May I have your suggestions of how to apply randomsearchcv for train, test, validate?