scicloj.metamorph.ml.cache
Caching infrastructure for metamorph.ml train/predict operations.
This namespace provides flexible caching backends to store and retrieve results of machine learning training and prediction operations. This is useful for avoiding redundant computations when working with the same models and data.
Supported cache backends:
- Atom cache: In-memory caching using a Clojure atom (fast, ephemeral)
- Disk cache: File-based caching using Nippy serialization (persistent)
- Redis cache: Distributed caching via Redis (requires carmine library)
Usage:
(enable-atom-cache! (atom {})) ; Enable in-memory caching
;; or
(enable-disk-cache! "/tmp/ml-cache") ; Enable disk-based caching
;; or
(enable-redis-cache! {...}) ; Enable Redis caching
To disable caching:
(disable-cache!)
See individual function docs for more details on each backend.
Categories
Other vars: disable-cache! enable-atom-cache! enable-disk-cache! enable-redis-cache! when-requiring-resolve-macro
disable-cache!
(disable-cache!)Disables caching of train/predict calls.
Resets the cache configuration to a disabled state. After calling this, train and predict operations will not use any caching mechanism.
See also: enable-atom-cache!, enable-disk-cache!, enable-redis-cache!
enable-atom-cache!
(enable-atom-cache! cache-atom)Enables the caching of train/predict calls in an atom.
cache-atom: Clojure atom used for caching.
enable-disk-cache!
(enable-disk-cache! cache-dir)Enables the caching of train/predict calls in an directory on disk.
cacche-dir: Directory used for caching.
enable-redis-cache!
(enable-redis-cache! wcar-opts)Enables the caching of train/predict calls in an redis server using carmine library
wcar-opts: Clojure atom used for caching.
‘com.taoensso/carmine’ needed to be added as depenency