ITMO_FS.filters.univariate
.VDM¶
-
class
ITMO_FS.filters.univariate.
VDM
(weighted=True)¶ Creates Value Difference Metric builder http://aura.abdn.ac.uk/bitstream/handle/2164/10951/payne_ecai_98.pdf?sequence=1 https://www.jair.org/index.php/jair/article/view/10182
Parameters: weighted (bool) – If weighted = False, modified version of metric which omits the weights is used Notes
For more details see papers about Improved Heterogeneous Distance Functions and Implicit Future Selection with the VDM.
Examples
>>> x = np.array([[0, 0, 0, 0], ... [1, 0, 1, 1], ... [1, 0, 0, 2]]) >>> y = np.array([0, ... 1, ... 1]) >>> vdm = VDM() >>> vdm.run(x, y) array([[0. 4.35355339 4. ] [4.5 0. 0.5 ] [4. 0.35355339 0. ]])
-
__init__
(weighted=True)¶ Initialize self. See help(type(self)) for accurate signature.
-
run
(x, y)¶ Generates metric for the data Complexity: O(n_features * n_samples^3) worst case, should be faster on a real data
- x: array-like, shape (n_features, n_samples)
- Input samples’ parameters. Parameters among every class must be sequential integers.
- y: array-like, shape (n_samples)
- Input samples’ class labels. Class labels must be sequential integers.
- result:
- numpy.ndarray, shape=(n_samples, n_samples), dtype=np.double with selected version of metrics
feature_scores = {} def run(self, x, y, weighted=True):
-