Skip to content

[Callbacks] FEA Define behavior for callbacks registered on estimators used in third party functions #33323

@jeremiedbb

Description

@jeremiedbb

From #28760 (comment) and #28760 (comment).
related to #27676

The current implementation requires that estimators used in meta-estimators can only have callbacks if the meta-estimator supports callbacks.
It may be a too strong requirement, or at least we need to define it properly, for user code.

A typical problematic use case is when several clones of an estimator are fitted in parallel in a user defined function (like a custom cross validation).
It implies in particular that we settle on the expected behavior of clone w.r.t callbacks.

An "easy" first step would be that clone discards the callbacks. Afterall callbacks are not constructor parameters strictly. With that callbacks would just be disabled for estimators used in non-callback-aware code. (it would be silent though)

Then we can investigate whether a second step where we don't impose that estimators within a meta estimator (or function that behaves like a meta-estimator) have their CallbackContext tree merged with the one of the parent estimator.
In such situations, the callbacks may not provide their full capabilities. For instance progress bars could not be displayed in a single rich live object with bars inserted dynamically and intuitive layout, but would pop one below the other.

ping @FrancoisPgm

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions