Skip to content

ValueError on Multiple Calls to fit_conformalize in CrossConformalRegressor #710

@CyrilJl

Description

@CyrilJl

This is not a bug, but a question regarding the following code:

from sklearn.datasets import make_regression
from mapie.regression import CrossConformalRegressor
from sklearn.linear_model import Ridge

model = CrossConformalRegressor(estimator=Ridge())

X, y = make_regression()
model.fit_conformalize(X, y)

another_X, another_y = make_regression()
model.fit_conformalize(another_X, another_y)

When executed, this code raises a ValueError: fit_conformalize method already called. MAPIE does not currently support calling fit_conformalize several times.

I couldn't find any information about this behavior in the documentation. It surprised me as it differs from the behavior in versions prior to v1 and also from scikit-learn, which allows the object to be reused. I'm curious about the reasoning behind this implementation. Additionally, I'm wondering if, for my needs, I have no choice but to create a new instance of the Mapie regressor each time I use it on a new dataset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RegressionRelated to regression (excluding time series)Unprioritized backlogGood ideas yet to be prioritized.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions