h2o4gpu package¶
Subpackages¶
h2o4gpu.solvers h2o4gpu.util h2o4gpu.utils
Module contents¶
| copyright: | 2017-2019 H2O.ai, Inc. |
|---|---|
| license: | Apache License Version 2.0 (see LICENSE for details) |
-
h2o4gpu.clone(estimator, safe=True)[source]¶ Constructs a new estimator with the same parameters.
Clone does a deep copy of the model in an estimator without actually copying attached data. It yields a new estimator with the same parameters that has not been fit on any data.
Parameters: - estimator : estimator object, or list, tuple or set of objects
The estimator or group of estimators to be cloned
- safe : boolean, optional
If safe is false, clone will fall back to a deep copy on objects that are not estimators.
-
h2o4gpu.get_config()[source]¶ Retrieve current values for configuration set by
set_config()Returns: - config : dict
Keys are parameter names that can be passed to
set_config().
-
h2o4gpu.set_config(assume_finite=None, working_memory=None, print_changed_only=None)[source]¶ Set global h2o4gpu configuration
New in version 0.19.
Parameters: - assume_finite : bool, optional
If True, validation for finiteness will be skipped, saving time, but leading to potential crashes. If False, validation for finiteness will be performed, avoiding error. Global default: False.
New in version 0.19.
- working_memory : int, optional
If set, h2o4gpu will attempt to limit the size of temporary arrays to this number of MiB (per job when parallelised), often saving both computation time and memory on expensive operations that can be performed in chunks. Global default: 1024.
New in version 0.20.
- print_changed_only : bool, optional
If True, only the parameters that were set to non-default values will be printed when printing an estimator. For example,
print(SVC())while True will only print ‘SVC()’ while the default behaviour would be to print ‘SVC(C=1.0, cache_size=200, …)’ with all the non-changed parameters.New in version 0.21.
-
h2o4gpu.config_context(**new_config)[source]¶ Context manager for global h2o4gpu configuration
Parameters: - assume_finite : bool, optional
If True, validation for finiteness will be skipped, saving time, but leading to potential crashes. If False, validation for finiteness will be performed, avoiding error. Global default: False.
- working_memory : int, optional
If set, h2o4gpu will attempt to limit the size of temporary arrays to this number of MiB (per job when parallelised), often saving both computation time and memory on expensive operations that can be performed in chunks. Global default: 1024.
Notes
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.
Examples
>>> import h2o4gpu >>> from h2o4gpu.utils.validation import assert_all_finite >>> with h2o4gpu.config_context(assume_finite=True): ... assert_all_finite([float('nan')]) >>> with h2o4gpu.config_context(assume_finite=True): ... with h2o4gpu.config_context(assume_finite=False): ... assert_all_finite([float('nan')]) ... # doctest: +ELLIPSIS Traceback (most recent call last): ... ValueError: Input contains NaN, ...