config_context¶
sklearn_wrap.config.config_context(*, trusted_modules=None)
¶
Context manager to temporarily set sklearn-wrap configuration.
Configuration is restored to its previous state when the context exits, even if an exception is raised.
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
trusted_modules
|
frozenset[str] or None
|
If not |
None
|
Examples¶
>>> with config_context(trusted_modules=frozenset({"sklearn", "xgboost"})):
... get_config()["trusted_modules"] == frozenset({"sklearn", "xgboost"})
True
>>> get_config()["trusted_modules"] == DEFAULT_TRUSTED_MODULES
True
See Also¶
set_config : Persistently update the configuration. get_config : Retrieve the current configuration.