CallbackSupportMixin#
- class sklearn.callback.CallbackSupportMixin[source]#
Mixin class to add callback support to an estimator.
- _init_callback_context(task_name='fit', task_id=0, max_subtasks=0, sequential_subtasks=True)[source]#
Initialize the callback context for the estimator and setup its callbacks.
This method should be called once, at the beginning of the fit method.
It will only setup callbacks that are not propagated from a meta-estimator.
- Parameters:
- task_namestr, default=”fit”
The name of the root task.
- task_idint, default=0
Identifier for the root task.
- max_subtasksint or None, default=0
The maximum number of subtasks that can be children of the root task. None means the maximum number of subtasks is not known in advance. 0 means it’s a leaf.
- sequential_subtasksbool, default=True
Whether the root context has sequential subtasks. If True, children contexts of the root context, created via
subcontext, will have automatically assigned consecutive integer task_ids starting from 0.
- Returns:
- callback_fit_ctxCallbackContext
The root callback context for the estimator.