Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does n_jobs =-1 work on SPE? #35

Open
IncubatorShokuhou opened this issue Feb 19, 2025 · 0 comments
Open

Does n_jobs =-1 work on SPE? #35

IncubatorShokuhou opened this issue Feb 19, 2025 · 0 comments

Comments

@IncubatorShokuhou
Copy link

IncubatorShokuhou commented Feb 19, 2025

import imbens

from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split

RANDOM_STATE = 42
X, y = make_classification(
    n_classes=3,
    n_samples=20_000,
    class_sep=2,
    weights=[0.01, 0.29, 0.6],
    n_informative=3,
    n_redundant=1,
    flip_y=0,
    n_features=400,
    n_clusters_per_class=2,
    random_state=RANDOM_STATE,
)
X_train, X_valid, y_train, y_valid = train_test_split(
    X, y, test_size=0.5, stratify=y, random_state=RANDOM_STATE
)
clf = imbens.ensemble.SelfPacedEnsembleClassifier(random_state=RANDOM_STATE,n_jobs=-1)
clf.fit(X_train, y_train)

Here is my code. I set n_jobs=-1 in SPEClassfier, but when I looked at bpytop, I can only see one or two cores running. Is there something wrong with my code, or SPE is not designed for parallelization?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant