def __init__(self, space='targets', **kwargs): ProjectionMapper.__init__(self, space=space, **kwargs) self._scale = None """Estimated scale""" if self.params.svd == 'dgesvd' and not externals.exists('liblapack.so'): warning("Reverting choice of svd for ProcrusteanMapper to be default " "'numpy' since liblapack.so seems not to be available for " "'dgesvd'") self.params.svd = 'numpy'
def __init__(self, proj, **kwargs): """Initialize the StaticProjectionMapper Parameters ---------- **kwargs: All keyword arguments are passed to the ProjectionMapper constructor. """ ProjectionMapper.__init__(self, auto_train=True, **kwargs) self._proj = proj
def __init__(self, **kwargs): """Initialize the SVDMapper Parameters ---------- **kwargs: All keyword arguments are passed to the ProjectionMapper constructor. """ ProjectionMapper.__init__(self, **kwargs) self._sv = None """Singular values of the training matrix."""
def __init__(self, similarities, prototypes=None, **kwargs): """ Parameters ---------- similarities : list A list of similarity functions. prototypes : Dataset or list A dataset or a list of instances (e.g., streamlines)? **kwargs: All keyword arguments are passed to the ProjectionMapper constructor """ ProjectionMapper.__init__(self, **kwargs) self.similarities = similarities self.prototypes = prototypes
def __repr__(self): s = ProjectionMapper.__repr__(self).rstrip(' )') if not s[-1] == '(': s += ', ' s += "scaling=%r, reflection=%r, reduction=%r, " \ "oblique=%r, oblique_rcond=%r)" % \ (self._scaling, self._reflection, self._reduction, self._oblique, self._oblique_rcond) return s
def __init__(self, proj, recon=None, **kwargs): """Initialize the StaticProjectionMapper Parameters ---------- proj : 2-D array Projection matrix to be used for forward projection. recon: 2-D array Projection matrix to be used for reverse projection. If this is not given, `numpy.linalg.pinv` of proj will be used by default. **kwargs: All keyword arguments are passed to the ProjectionMapper constructor. """ ProjectionMapper.__init__(self, auto_train=True, **kwargs) self._proj = proj self._recon = recon
def __init__(self, **kwargs): """Initialize the SVDMapper Parameters ---------- **kwargs: All keyword arguments are passed to the ProjectionMapper constructor. Notes ----- For the 'selector' argument this class also supports passing a `ElementSelector` instance, which will be used to determine the to be selected features, based on the singular values of each component. """ ProjectionMapper.__init__(self, **kwargs) self._sv = None """Singular values of the training matrix."""
def __init__(self, scaling=True, reflection=True, reduction=True, oblique=False, oblique_rcond=-1, svd='numpy', **kwargs): """Initialize the ProcrusteanMapper Parameters ---------- scaling : bool Scale data for the transformation (no longer rigid body transformation) reflection : bool Allow for the data to be reflected (so it might not be a rotation). Effective only for non-oblique transformations reduction : bool 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 oblique : bool Either to allow non-orthogonal transformation -- might heavily overfit the data if there is less samples than dimensions. Use `oblique_rcond`. oblique_rcond : float Cutoff for 'small' singular values to regularize the inverse. See :class:`~numpy.linalg.lstsq` for more information. svd : string (numpy, scipy, dgesvd), optional Implementation of SVD to use. dgesvd requires ctypes to be available. **kwargs To be passed to ProjectionMapper """ ProjectionMapper.__init__(self, **kwargs) self._scaling = scaling """Either to determine the scaling factor""" self._reduction = reduction self._reflection = reflection self._oblique = oblique self._oblique_rcond = oblique_rcond self._scale = None """Estimated scale""" self._svd = svd