API Reference for CumulativeGradientEstimator
Bases: object
Source code in spectral_metric/estimator.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
__init__(M_sample=250, k_nearest=3, distance='euclidean')
The Cumulative Gradient Estimator, estimates the complexity of a dataset. Args: M_sample (int): Number of sample per class to use k_nearest (int): Number of neighbours to look to compute \(P(C_c ert x)\). distance: name of the distance to use.
Source code in spectral_metric/estimator.py
16 17 18 19 20 21 22 23 24 25 26 |
|
compute(data, target, class_samples)
Compute the difference matrix and the eigenvalues Args: data: data samples, ndarray (n_samples, n_features) target: target samples, ndarray (n_samples) class_samples : class samples, Dict[class_idx, Array[M, n_features]]
Source code in spectral_metric/estimator.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
fit(data, target)
Estimate the CSG metric from the data Args: data: data samples, ndarray (n_samples, n_features) target: target samples, ndarray (n_samples)
Source code in spectral_metric/estimator.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|