コード例 #1
0
    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'
コード例 #2
0
ファイル: procrustean.py プロジェクト: Arthurkorn/PyMVPA
    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'
コード例 #3
0
    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
コード例 #4
0
    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
コード例 #5
0
ファイル: svd.py プロジェクト: lydiawawa/Machine-Learning
    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."""
コード例 #6
0
ファイル: svd.py プロジェクト: Anhmike/PyMVPA
    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."""
コード例 #7
0
ファイル: prototype.py プロジェクト: robbisg/PyMVPA
    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
コード例 #8
0
    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
コード例 #9
0
ファイル: procrustean.py プロジェクト: schoeke/PyMVPA
 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
コード例 #10
0
ファイル: staticprojection.py プロジェクト: Guenx/PyMVPA
    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
コード例 #11
0
ファイル: staticprojection.py プロジェクト: neurosbh/PyMVPA
    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
コード例 #12
0
ファイル: svd.py プロジェクト: psederberg/PyMVPA
    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."""
コード例 #13
0
ファイル: procrustean.py プロジェクト: schoeke/PyMVPA
    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