Multivariate Pattern Analysis in Python |
Inheritance diagram for mvpa.mappers.metric:
Classes and functions to provide sense of distances between sample points
Bases: mvpa.mappers.metric.Metric
Find neighboring points in descretized space
If input space is descretized and all points fill in N-dimensional cube, this finder returns list of neighboring points for a given distance.
For all origin coordinates this class exclusively operates on discretized values, not absolute coordinates (which are e.g. in mm).
Additionally, this metric has the notion of compatible and incompatible dataspace metrics, i.e. the descrete space might contain dimensions for which computing an overall distance is not meaningful. This could, for example, be a combined spatio-temporal space (three spatial dimension, plus the temporal one). This metric allows to define a boolean mask (compatmask) which dimensions share the same dataspace metrics and for which the distance function should be evaluated. If a compatmask is provided, all cordinates are projected into the subspace of the non-zero dimensions and distances are computed within that space.
However, by using a per dimension radius argument for the getNeighbor methods, it is nevertheless possible to define a neighborhood along all dimension. For all non-compatible axes the respective radius is treated as a one-dimensional distance along the respective axis.
Parameters: |
|
---|
Return compatmask
Note
Don’t modify in place since it would need to require to reset __filter_radius whenever changed
Lets allow to specify some custom filter to use
Returns coordinates of the neighbors which are within distance from coord.
Parameters: |
|
---|
Bases: object
Abstract class for any metric.
Subclasses abstract a metric of a dataspace with certain properties and can be queried for structural information. Currently, this is limited to neighborhood information, i.e. identifying the surround a some coordinate in the respective dataspace.
At least one of the methods (getNeighbors, getNeighbor) has to be overriden in every derived class. NOTE: derived #2 from derived class #1 has to override all methods which were overrident in class #1
Generator to return coordinate of the neighbor.
Base class contains the simplest implementation, assuming that getNeighbors returns iterative structure to spit out neighbors 1-by-1
Return the list of coordinates for the neighbors.
By default it simply constracts the list based on the generator getNeighbor