ProgressBar#

class sklearn.callback.ProgressBar(max_propagation_depth=1)[source]#

Callback that displays progress bars for each iterative step of an estimator.

Parameters:
max_propagation_depthint, default=1

The maximum depth of nested levels of estimators to display progress bars for. 0 means that the progress of only the outermost estimator is displayed. If set to None, all levels are displayed.

Notes

This callback requires rich to be installed.

get_metadata_routing()[source]#

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Returns:
routingMetadataRequest

A MetadataRequest encapsulating routing information.

property max_propagation_depth#

The maximum number of nested estimators at which the callback should be propagated.

If set to None, the callback is propagated to sub-estimators at all nesting levels.

on_fit_task_begin(estimator, context)[source]#

Method called at the beginning of each fit task of the estimator.

Parameters:
estimatorestimator instance

The estimator calling this callback hook.

contextsklearn.callback.CallbackContext instance

Context of the corresponding task.

on_fit_task_end(estimator, context)[source]#

Method called at the end of each fit task of the estimator.

Parameters:
estimatorestimator instance

The estimator calling this callback hook.

contextsklearn.callback.CallbackContext instance

Context of the corresponding task.

setup(estimator, context)[source]#

Method called at the beginning of the fit method of the estimator.

For auto-propagated callbacks, this method is called only once, before running the fit method of the outermost estimator.

Parameters:
estimatorestimator instance

The estimator calling this callback hook.

contextsklearn.callback.CallbackContext instance

Context of the corresponding task. This is usually the root context of the estimator but it can be an intermediate context if the estimator is a sub-estimator of a meta-estimator.

teardown(estimator, context)[source]#

Method called after finishing the fit method of the estimator.

For auto-propagated callbacks, this method is called only once, after finishing the fit method of the outermost estimator.

Parameters:
estimatorestimator instance

The estimator calling this callback hook.

contextsklearn.callback.CallbackContext instance

Context of the corresponding task. This is usually the root context of the estimator but it can be an intermediate context if the estimator is a sub-estimator of a meta-estimator.