![]() |
Multivariate Pattern Analysis in Python |
Distance functions to be used in kernels and elsewhere
The comprehensive API documentation for this module, including all technical details, is available in the Epydoc-generated API reference for mvpa.clfs.distance (for developers).
Returns dinstance max(|a-b|) XXX There must be better name! XXX Actually, why is it absmin not absmax?
Useful to select a whole cube of a given “radius”
See also
Full API documentation of absminDistance() in module mvpa.clfs.distance.
See also
Full API documentation of cartesianDistance() in module mvpa.clfs.distance.
Calculate Mahalanobis distance of the pairs of points.
| Parameters: |
|
|---|
Inverse covariance matrix can be calculated with the following
w = N.linalg.solve(N.cov(x.T), N.identity(x.shape[1]))
or
w = N.linalg.inv(N.cov(x.T))
See also
Full API documentation of mahalanobisDistance() in module mvpa.clfs.distance.
See also
Full API documentation of manhattenDistance() in module mvpa.clfs.distance.
Return one minus the correlation matrix between the rows of two matrices.
This functions computes a matrix of correlations between all pairs of rows of two matrices. Unlike NumPy’s corrcoef() this function will only considers pairs across matrices and not within, e.g. both elements of a pair never have the same source matrix as origin.
Both arrays need to have the same number of columns.
| Parameters: |
|
|---|
Example:
>>> X = N.random.rand(20,80)
>>> Y = N.random.rand(5,80)
>>> C = oneMinusCorrelation(X, Y)
>>> print C.shape
(20, 5)
See also
Full API documentation of oneMinusCorrelation() in module mvpa.clfs.distance.
Weighted p-norm between two datasets (pure Python implementation)
||x - x’||_w = (sum_{i=1...N} (w_i*|x_i - x’_i|)**p)**(1/p)
| Parameters: |
|
|---|
See also
Full API documentation of pnorm_w_python() in module mvpa.clfs.distance.
Compute weighted euclidean distance matrix between two datasets.
| Parameters: |
|
|---|
See also
Full API documentation of squared_euclidean_distance() in module mvpa.clfs.distance.