Skip to content

Unable to set random_state without setting shuffle=True #29

@raahilshah

Description

@raahilshah

Despite documentation suggesting that since randomness is applied not just on shuffle, that this use case is intended, but doesn't seem to work:

    cv = MultilabelStratifiedKFold(cv, random_state=RANDOM_STATE)
  File "/Users/raahilshah/opt/anaconda3/envs/storm/lib/python3.8/site-packages/iterstrat/ml_stratifiers.py", line 157, in __init__
    super(MultilabelStratifiedKFold, self).__init__(n_splits=n_splits, shuffle=shuffle, random_state=random_state)
  File "/Users/raahilshah/opt/anaconda3/envs/storm/lib/python3.8/site-packages/sklearn/model_selection/_split.py", line 296, in __init__
    raise ValueError(
ValueError: Setting a random_state has no effect since shuffle is False. You should leave random_state to its default (None), or set shuffle=True.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions