File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed
frouros/detectors/data_drift/batch/distance_based Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change 66
77import numpy as np # type: ignore
88import tqdm # type: ignore
9- from scipy .spatial .distance import cdist # type: ignore
109
1110from frouros .callbacks .batch .base import BaseCallbackBatch
1211from frouros .detectors .data_drift .base import MultivariateData
1312from frouros .detectors .data_drift .batch .distance_based .base import (
1413 BaseDistanceBased ,
1514 DistanceResult ,
1615)
17-
18-
19- def rbf_kernel (
20- X : np .ndarray , Y : np .ndarray , std : float = 1.0 # noqa: N803
21- ) -> np .ndarray :
22- """Radial basis function kernel between X and Y matrices.
23-
24- :param X: X matrix
25- :type X: numpy.ndarray
26- :param Y: Y matrix
27- :type Y: numpy.ndarray
28- :param std: standard deviation value
29- :type std: float
30- :return: Radial basis kernel matrix
31- :rtype: numpy.ndarray
32- """
33- return np .exp (- cdist (X , Y , "sqeuclidean" ) / 2 * std ** 2 )
16+ from frouros .utils .kernels import rbf_kernel
3417
3518
3619class MMD (BaseDistanceBased ):
You can’t perform that action at this time.
0 commit comments