FIX make deterministic RandomizedSearchCV example#14227
FIX make deterministic RandomizedSearchCV example#14227qinhanmin2014 merged 2 commits intoscikit-learn:masterfrom
Conversation
|
@rth Do you think this is the right fix? |
sklearn/model_selection/_search.py
Outdated
| >>> from scipy.stats import uniform | ||
| >>> iris = load_iris() | ||
| >>> logistic = LogisticRegression(solver='saga', tol=1e-2, max_iter=200) | ||
| >>> np.random.seed(seed=233423) # make sure uniform will be deterministic |
There was a problem hiding this comment.
That would be global I think? Shouldn't we pass a random state to LogisticRegression in addition to the GridSearchCV?
There was a problem hiding this comment.
We could but I am not sure that this is actually the issue. I think it should be linked to the uniform for which the random state cannot be set
There was a problem hiding this comment.
Uhm locally, I get determimistic results with master. I see that the behaviour of the random state could be an issue but this is for SciPy < 0.16 which is not the case with the failing build.
|
I checked the code under and @rth could you merge it? |
It seems that the CI on the PR did not catch that the example was not deterministic.