def test_one_sided_selection_multiclass():
    """Check the validity of the fitted attributes `estimators_`."""
    X, y = make_classification(
        n_samples=1_000,
        n_classes=4,
        weights=[0.1, 0.2, 0.2, 0.5],
        n_clusters_per_class=1,
        random_state=0,
    )
    oss = OneSidedSelection(random_state=RND_SEED)
    oss.fit_resample(X, y)

    assert len(oss.estimators_) == len(oss.sampling_strategy_)
    other_classes = []
    for est in oss.estimators_:
        assert est.classes_[0] == 0  # minority class
        assert est.classes_[1] in {1, 2, 3}  # other classes
        other_classes.append(est.classes_[1])
    assert len(set(other_classes)) == len(other_classes)
Check the validity of the fitted attributes `estimators_`.
imblearn/under_sampling/_prototype_selection/tests/test_one_sided_selection.py