| Home | Trees | Indices | Help |
|
|---|
|
|
Mapper which uses a binary mask to select "Features"
Constructor information for `MaskMapper` class
______________________________________________
Initialize MaskMapper
:Parameters:
mask : array
an array in the original dataspace and its nonzero elements are
used to define the features included in the dataset
metric : Metric
Corresponding metric for the space. No attempt is made to
determine whether a certain metric is reasonable for this
mapper. If `metric` is None -- `DescreteMetric`
is constructed that assumes an equal (1) spacing of all mask
elements with a `distance_function` given as a parameter listed
below.
distance_function : functor
Distance function to use as the parameter to
`DescreteMetric` if `metric` is not specified,
elementsize : list or scalar
Determines spacing within `DescreteMetric`. If it is given as a
scalar, corresponding value is assigned to all dimensions, which
are found within `mask`
:Note: parameters `elementsize` and `distance_function` are relevant
only if `metric` is None
Documentation for base classes of `MaskMapper`
===============================================
Documentation for class `MetricMapper`
--------------------------------------
Mapper which has information about the metrics of the dataspace it is
mapping.
Constructor information for `MetricMapper` class
________________________________________________
Cheap initialisation.
'metric' is a subclass of Metric.
Documentation for base classes of `MetricMapper`
=================================================
Documentation for class `Mapper`
--------------------------------
Interface to provide mapping between two spaces: in and out.
Methods are prefixed correspondingly. forward/reverse operate
on the entire dataset. get(In|Out)Id[s] operate per element::
forward
in ---------> out
<--------/
reverse
Subclasses should define 'dsshape' and 'nfeatures' properties that point to
`getInShape` and `getOutSize` respectively. This cannot be
done in the baseclass as standard Python properties would still point to
the baseclass methods.
Constructor information for `Mapper` class
__________________________________________
Does nothing.
Documentation for class `Metric`
--------------------------------
Abstract class for any finder.
Classes subclasses from this class show know about structure of
the data and thus be able to provide information about the
neighbors.
At least one of the methods (getNeighbors, getNeighbor) has to be
overriden in the derived class.
NOTE: derived #2 from derived class #1 has to override all methods
which were overrident in class #1
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
__doc__ = enhancedDocString('MaskMapper', locals(), MetricMapper)
|
|||
|
Inherited from |
|||
|
|||
|
dsshape InShape is a shape of original mask |
|||
| mask | |||
|
Inherited from Inherited from |
|||
|
|||
Note:
parameters |
|
Initialize internal state with mask-derived information It is needed to initialize structures for the fast and reverse lookup to don't impose performance hit on any future operation |
|
|
|
|
|
|
By default returns a copy of the current mask. If 'copy' is set to False a reference to the mask is returned instead. This shared mask must not be modified! |
Returns a features coordinate in the original data space for a given feature id. If this method is called with a list of feature ids it returns a 2d-array where the first axis corresponds the dimensions in 'In' dataspace and along the second axis are the coordinates of the features on this dimension (like the output of NumPy.array.nonzero()). XXX it might become __get_item__ access method |
Only listed outIds would remain. The function used to accept a matrix-mask as the input but now it really has to be a list of IDs Function assumes that outIds are sorted. If not - please set sort to True. While in __debug__ mode selectOut would check if obtained IDs are sorted and would warn the user if they are not. If you feel strongly that you need to remap features internally (ie to allow Ids with mixed order) please contact developers of mvpa to discuss your use case. See
Older comments on 'order' - might be useful in future if reordering gets ressurrected Order will be taken into account -- ie items will be remapped if order was changed... need to check if neighboring still works... no -- it doesn't. For the data without samples .forward can be easily adjusted by using masknonzero instead of plain mask, but for data with samplesI don't see a clean way... see forward() above... there is no testcase for order preservation for DIM+1 case
|
|
Return the list of Ids for the neighbors. Returns a list of outIds
|
outIds selected.
|
Returns a boolean mask with all features in This method works exactly like Mapper.convertOutIds2OutMask(), but the feature mask is finally (reverse) mapped into in-space.
|
|
|||
dsshapeInShape is a shape of original mask
|
mask
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Jul 3 13:06:13 2008 | http://epydoc.sourceforge.net |