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
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
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
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
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:
>>> from model_diagnostics import set_config
>>> set_config(plot_backend="plotly")
Source code in src/model_diagnostics/_config.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
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
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
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:
>>> from model_diagnostics import set_config
>>> set_config(plot_backend="plotly")
Source code in src/model_diagnostics/_config.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
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
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|