sklearn.config_context(**new_config)
[source]
Context manager for global scikit-learn configuration
Parameters: |
|
---|
All settings, not just those presently modified, will be returned to their previous values when the context manager is exited. This is not thread-safe.
>>> import sklearn >>> from sklearn.utils.validation import assert_all_finite >>> with sklearn.config_context(assume_finite=True): ... assert_all_finite([float('nan')]) >>> with sklearn.config_context(assume_finite=True): ... with sklearn.config_context(assume_finite=False): ... assert_all_finite([float('nan')]) ... Traceback (most recent call last): ... ValueError: Input contains NaN, ...
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.config_context.html