hypertools.tools.procrustes¶
- hypertools.tools.procrustes(source, target, scaling=True, reflection=True, reduction=False, oblique=False, oblique_rcond=-1, format_data=True)[source]¶
Function to project from one space to another using Procrustean transformation (shift + scaling + rotation + reflection).
The implementation of this function was based on the ProcrusteanMapper in pyMVPA: https://github.com/PyMVPA/PyMVPA
See also: http://en.wikipedia.org/wiki/Procrustes_transformation
- Parameters:
- sourceNumpy array
Array to be aligned to target’s coordinate system.
- target: Numpy array
Source is aligned to this target space
- scalingbool
Estimate a global scaling factor for the transformation (no longer rigid body)
- reflectionbool
Allow for the data to be reflected (so it might not be a rotation. Effective only for non-oblique transformations.
- reductionbool
If true, it is allowed to map into lower-dimensional space. Forward transformation might be suboptimal then and reverse transformation might not recover all original variance.
- obliquebool
Either to allow non-orthogonal transformation – might heavily overfit the data if there is less samples than dimensions. Use oblique_rcond.
- oblique_rcondfloat
Cutoff for ‘small’ singular values to regularize the inverse. See
lstsqfor more information.
- Returns:
- aligned_sourceNumpy array
The array source is aligned to target and returned