Closed
Description
In _split.py
, cv is 'warn'
will not work as intended since cv will be copied if n_jobs=-1
.
from sklearn.datasets import load_iris
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import cross_validate
from sklearn.svm import SVC
X, y = load_iris(return_X_y=True)
clf = SVC(gamma='auto')
grid = GridSearchCV(clf, param_grid={'C': [1, 10]}, iid=False)
score = cross_validate(grid, X, y,
n_jobs=-1,
cv=5, error_score='raise') # to remove deprecation warning
ValueError: Expected cv as an integer, cross-validation object (from sklearn.model_selection) or an iterable. Got warn.