Skip to content

Multiprocessing in MAPIE fails with Python 3.12/3.13 #661

@Valentin-Laurent

Description

@Valentin-Laurent

Multiprocessing (ie: n_jobs=-1) in MAPIE fails when using python 3.13 and 3.12 (maybe it was failing silently for older versions).

This is the case at least when using _MapieClassifier, and also most probably using _MapieRegressor, TimeSeriesRegressor, and PrecisionRecallController.

Minimal code example:

from sklearn.datasets import make_classification
from mapie.classification import _MapieClassifier

n_classes = 4
X, y = make_classification(
    n_samples=500,
    n_features=10,
    n_informative=3,
    n_classes=n_classes,
)

mapie_clf_multi = _MapieClassifier(n_jobs=-1)
mapie_clf_multi.fit(X, y)
mapie_clf_multi.predict(X)

Returns ChildProcessError: [Errno 10] No child processes [..] (in the ResourceTracker module)

When running the test suite, the test_results_single_and_multi_jobs tests raise exceptions. Those exceptions are displayed but ignored, so the test suite passes, but the code would fail in a regular environnement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BacklogThis is in the MAPIE team development backlog, yet to be prioritised.Contributors welcome 👋🏻Especially relevant issue/PR for contributors to work on.Other or internalIf no other grey tag is relevant or if issue from the MAPIE team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions