Kernel which caches all data to avoid duplicate computation
This kernel is very useful for any analysis which will retrain or repredict the same data multiple times, as this kernel will avoid recalculating the kernel function. Examples of such analyses include cross validation, bootstrapping, and model selection (assuming the kernel function itself does not change, e.g. when selecting for C in an SVM).
The kernel will automatically cache any new data sent through compute, and will be able to use this cache whenever a subset of this data is sent through compute again. If new (uncached) data is sent through compute, then the cache is recreated from scratch. Therefore, you should compute the kernel on the entire superset of your data before using this kernel normally (computing a new cache invalidates any previous cached data).
The cache is asymmetric for lhs and rhs, so compute(d1, d2) does not create a cache usable for compute(d2, d1).
Initialize CachedKernel
Parameters : | kernel : Kernel
enable_ca : None or list of str
disable_ca : None or list of str
|
---|
Automatically computes and caches the kernel or extracts the relevant part of a precached kernel into self._k
Parameters : | force : bool
|
---|