Skip to content

StratifiedShuffleSplit still buggy #6471

@amueller

Description

@amueller
y = [0, 1, 2, 3] * 3 + [4, 5] * 5                                                                  
X = np.ones_like(y)                                                                                

splits = StratifiedShuffleSplit(n_iter=1, train_size=11, test_size=11, random_state=0)                                     

train, test = next(iter(splits.split(X=X, y=y)))                                                   

assert_array_equal(np.intersect1d(train, test), [])   
assert_equal(len(train), 11)
assert_equal(len(test), 11)

raise self.failureException('12 != 11')

this is a follow-up on #6379 and a sign that the logic is too complex. I'm doing a rewrite to fix this bug but it is not as clean as I'd like.

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