model_diagnostics
model_diagnostics
¶
config_context(*, plot_backend=None)
¶
Context manager for global model-diagnostics configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plot_backend
|
bool
|
The library used for plotting. Can be "matplotlib" or "plotly". If None, the existing value won't change. Global default: "matplotlib". |
None
|
Yields:
Type | Description |
---|---|
None.
|
|
See Also
set_config : Set global model-diagnostics configuration. get_config : Retrieve current values of the global configuration.
Notes
All settings, not just those presently modified, will be returned to their previous values when the context manager is exited.
Examples:
>>> import model_diagnostics
>>> from model_diagnostics.calibration import plot_reliability_diagram
>>> with model_diagnostics.config_context(plot_backend="plotly"):
... plot_reliability_diagram(y_obs=[0, 1], y_pred=[0.3, 0.7])
Source code in src/model_diagnostics/_config.py
get_config()
¶
Retrieve current values for configuration set by :func:set_config
.
Returns:
Name | Type | Description |
---|---|---|
config |
dict
|
A copy of the configuration dictionary. Keys are parameter names that can be
passed to :func: |
See Also
config_context : Context manager for global model-diagnostics configuration. set_config : Set global model-diagnostics configuration.
Examples:
>>> import model_diagnostics
>>> config = model_diagnostics.get_config()
>>> config.keys()
dict_keys([...])
Source code in src/model_diagnostics/_config.py
set_config(plot_backend=None)
¶
Set global model-diagnostics configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plot_backend
|
bool
|
The library used for plotting. Can be "matplotlib" or "plotly". If None, the existing value won't change. Global default: "matplotlib". |
None
|
See Also
config_context : Context manager for global scikit-learn configuration. get_config : Retrieve current values of the global configuration.
Examples:
Source code in src/model_diagnostics/_config.py
get_config()
¶
Retrieve current values for configuration set by :func:set_config
.
Returns:
Name | Type | Description |
---|---|---|
config |
dict
|
A copy of the configuration dictionary. Keys are parameter names that can be
passed to :func: |
See Also
config_context : Context manager for global model-diagnostics configuration. set_config : Set global model-diagnostics configuration.
Examples:
>>> import model_diagnostics
>>> config = model_diagnostics.get_config()
>>> config.keys()
dict_keys([...])
Source code in src/model_diagnostics/_config.py
set_config(plot_backend=None)
¶
Set global model-diagnostics configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plot_backend
|
bool
|
The library used for plotting. Can be "matplotlib" or "plotly". If None, the existing value won't change. Global default: "matplotlib". |
None
|
See Also
config_context : Context manager for global scikit-learn configuration. get_config : Retrieve current values of the global configuration.
Examples:
Source code in src/model_diagnostics/_config.py
config_context(*, plot_backend=None)
¶
Context manager for global model-diagnostics configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plot_backend
|
bool
|
The library used for plotting. Can be "matplotlib" or "plotly". If None, the existing value won't change. Global default: "matplotlib". |
None
|
Yields:
Type | Description |
---|---|
None.
|
|
See Also
set_config : Set global model-diagnostics configuration. get_config : Retrieve current values of the global configuration.
Notes
All settings, not just those presently modified, will be returned to their previous values when the context manager is exited.
Examples:
>>> import model_diagnostics
>>> from model_diagnostics.calibration import plot_reliability_diagram
>>> with model_diagnostics.config_context(plot_backend="plotly"):
... plot_reliability_diagram(y_obs=[0, 1], y_pred=[0.3, 0.7])