Skip to content

Wrong documentation of gridsearch.ParameterSampler #7364

@FlorianWilhelm

Description

@FlorianWilhelm

In the documentation of gridsearch.ParameterSampler it is stated:

Note that as of SciPy 0.12, the scipy.stats.distributions do not accept a custom RNG instance and always use the singleton RNG from numpy.random. Hence setting random_state will not guarantee a deterministic iteration whenever scipy.stats distributions are used to define the parameter search space.

This is not really true and misleading. As of SciPy 0.16 you can easily set the random state of a distribution with

from scipy import stats
dist = stats.norm(loc=-1., scale=2.)
dist.random_state = 42

Therefore, one should rather point out to the user that one needs to additionally set the random state as shown above in order to get deterministic results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions