class sklearn.utils.Memory(location=None, backend=’local’, cachedir=None, mmap_mode=None, compress=False, verbose=1, bytes_limit=None, backend_options=None)
[source]
A context object for caching a function’s return value each time it is called with the same input arguments.
All values are cached on the filesystem, in a deep directory structure.
Read more in the User Guide.
Parameters: |
|
---|---|
Attributes: |
|
cache ([func, ignore, verbose, mmap_mode]) | Decorates the given function func to only compute its return value for input arguments not cached on disk. |
clear ([warn]) | Erase the complete cache directory. |
eval (func, *args, **kwargs) | Eval function func with arguments *args and **kwargs , in the context of the memory. |
format (obj[, indent]) | Return the formatted representation of the object. |
reduce_size () | Remove cache elements to make cache size fit in bytes_limit . |
debug | |
warn |
__init__(location=None, backend=’local’, cachedir=None, mmap_mode=None, compress=False, verbose=1, bytes_limit=None, backend_options=None)
[source]
cache(func=None, ignore=None, verbose=None, mmap_mode=False)
[source]
Decorates the given function func to only compute its return value for input arguments not cached on disk.
Parameters: |
|
---|---|
Returns: |
|
clear(warn=True)
[source]
Erase the complete cache directory.
eval(func, *args, **kwargs)
[source]
Eval function func with arguments *args
and **kwargs
, in the context of the memory.
This method works similarly to the builtin apply
, except that the function is called only if the cache is not up to date.
format(obj, indent=0)
[source]
Return the formatted representation of the object.
reduce_size()
[source]
Remove cache elements to make cache size fit in bytes_limit
.
sklearn.utils.Memory
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.utils.Memory.html