config_context#

skrub.config_context(*, use_tablereport=None, use_tablereport_expr=None, max_plot_columns=None, max_association_columns=None, subsampling_seed=None, enable_subsampling=None)[source]#

Context manager for global skrub configuration.

Parameters:
use_tablereportbool, default=None

The type of display used for dataframes. Default is False.

  • If True, replace the default DataFrame HTML displays with TableReport.

  • If False, the original Pandas or Polars dataframe HTML representation will be used.

This configuration can also be set with the SKB_USE_TABLEREPORT environment variable.

use_tablereport_exprbool, default=None

The type of HTML representation used for the dataframes preview in skrub expressions. Default is True.

  • If True, TableReport will be used.

  • If False, the original Pandas or Polars dataframe display will be used.

This configuration can also be set with the SKB_USE_TABLEREPORT_EXPR environment variable.

max_plot_columnsint, default=None

Set the max_plot_columns argument of TableReport. Default is 30.

This configuration can also be set with the SKB_MAX_PLOT_COLUMNS environment variable.

max_association_columnsint, default=None

Set the max_association_columns argument of TableReport. Default is 30.

This configuration can also be set with the SKB_MAX_ASSOCIATION_COLUMNS environment variable.

subsampling_seedint, default=None

Set the random seed of subsampling in skrub expressions skrub.Expr.skb.subsample(), when how="random" is passed.

This configuration can also be set with the SKB_SUBSAMPLING_SEED environment variable.

enable_subsampling{‘default’, ‘disable’, ‘force’}, default=None

Control the activation of subsampling in skrub expressions skrub.Expr.skb.subsample(). Default is "default".

  • If "default", the behavior of skrub.Expr.skb.subsample() is used.

  • If "disable", subsampling is never used, so skb.subsample becomes a no-op.

  • If "force", subsampling is used in all expression evaluation modes (preview, fit_transform, etc.).

This configuration can also be set with the SKB_ENABLE_SUBSAMPLING environment variable.

Yields:
None.

See also

get_config

Retrieve current values for global configuration.

set_config

Set global skrub configuration.

Examples

>>> import skrub
>>> with skrub.config_context(max_plot_columns=1):
...     ...