Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.utils.validation`.check_memory

sklearn.utils.validation.check_memory(memory)

  Check that `memory` is joblib.Memory-like.

  joblib.Memory-like means that `memory` can be converted into a joblib.Memory instance (typically a str denoting the `location`) or has the same interface (has a `cache` method).

  Parameters:
    memory None, str or object with the joblib.Memory interface

      - If string, the location where to create the `joblib.Memory` interface.

      - If None, no caching is done and the Memory object is completely transparent.

  Returns:
    memory object with the joblib.Memory interface

      A correct joblib.Memory object.

  Raises:
    ValueError

      If `memory` is not joblib.Memory-like.