Customizing the global configuration#
Skrub includes a configuration manager that allows setting various parameters
(see the set_config()
documentation for more detail).
It is possible to change configuration options using the set_config()
function:
>>> from skrub import set_config
>>> set_config(use_table_report=True)
This alters the behavior of skrub in the current script. Each configuration parameter has an environment variable that can be used to set it permanently.
Additionally, a config_context()
is provided to allow temporarily altering the
configuration:
>>> import skrub
>>> with skrub.config_context(max_plot_columns=1):
... pass
Within this context, only the code executed inside the with
statement is affected.
The get_config()
function allows retrieving the current configuration.
Configuration parameters#
The configuration parameters that can be set with set_config
and config_context
are available by using
>>> import skrub
>>> config = skrub.get_config()
>>> config.keys()
dict_keys(['use_table_report', 'use_table_report_data_ops', 'max_plot_columns', 'max_association_columns', 'subsampling_seed', 'enable_subsampling', 'float_precision', 'cardinality_threshold'])
These are the parameters currently available in the global configuration:
Parameter Name |
Default Value |
Env Variable |
Description |
---|---|---|---|
|
|
|
If set to |
|
|
|
Set the HTML representation used for the Data Ops previews. If |
|
30 |
|
If a dataframe has more columns than the value set here, the |
|
30 |
|
If a dataframe has more columns than the value set here, the |
|
0 |
|
Set the random seed of subsampling in |
|
|
|
Control the activation of subsampling in |
|
3 |
|
Control the number of significant digits shown when formatting floats. Applies overall precision rather than fixed decimal places. |
|
40 |
|
Set the |