Ejemplo n.º 1
0
Archivo: glm.py Proyecto: B-Rich/PyMVPA
    def __init__(self, design, voi='pe', **kwargs):
        """
        Parameters
        ----------
        design : array (nsamples x nregressors)
          GLM design matrix.
        voi : {'pe', 'zstat'}
          Variable of interest that should be reported as feature-wise
          measure. 'beta' are the parameter estimates and 'zstat' returns
          standardized parameter estimates.
        """
        FeaturewiseMeasure.__init__(self, **kwargs)
        # store the design matrix as a such (no copying if already array)
        self._design = np.asmatrix(design)

        # what should be computed ('variable of interest')
        if not voi in ['pe', 'zstat']:
            raise ValueError, \
                  "Unknown variable of interest '%s'" % str(voi)
        self._voi = voi

        # will store the precomputed Moore-Penrose pseudo-inverse of the
        # design matrix (lazy calculation)
        self._inv_design = None
        # also store the inverse of the inner product for beta variance
        # estimation
        self._inv_ip = None
Ejemplo n.º 2
0
 def __init__(self, space="targets", **kwargs):
     """
     Parameters
     ----------
     space : str
       What samples attribute to use as targets (labels).
     """
     # set auto-train flag since we have nothing special to be done
     FeaturewiseMeasure.__init__(self, auto_train=True, space=space, **kwargs)
Ejemplo n.º 3
0
Archivo: pls.py Proyecto: B-Rich/PyMVPA
    def __init__(self, num_permutations=200, num_bootstraps=100, **kwargs):
        raise NotImplemented, 'PLS was not yet implemented fully'

        # init base classes first
        FeaturewiseMeasure.__init__(self, **kwargs)

        # save the args for the analysis
        self.num_permutations = num_permutations
        self.num_bootstraps = num_bootstraps
Ejemplo n.º 4
0
Archivo: anova.py Proyecto: esc/PyMVPA
 def __init__(self, space='targets', **kwargs):
     """
     Parameters
     ----------
     space : str
       What samples attribute to use as targets (labels).
     """
     # set auto-train flag since we have nothing special to be done
     # so by default auto train
     kwargs['auto_train'] = kwargs.get('auto_train', True)
     FeaturewiseMeasure.__init__(self, space=space, **kwargs)
Ejemplo n.º 5
0
    def __init__(self, attr='targets', **kwargs):
        """Initialize

        Parameters
        ----------
        attr : str
          Attribute to correlate across chunks.
        """
        # init base classes first
        FeaturewiseMeasure.__init__(self, **kwargs)

        self.__attr = attr
Ejemplo n.º 6
0
    def __init__(self, threshold=1.0e-2, kernel_width=1.0,
                 w_guess=None, **kwargs):
        """Constructor of the IRELIEF class.

        """
        # init base classes first
        FeaturewiseMeasure.__init__(self, **kwargs)

        # Threshold in W changes (stopping criterion for irelief).
        self.threshold = threshold
        self.w_guess = w_guess
        self.w = None
        self.kernel_width = kernel_width
Ejemplo n.º 7
0
    def __init__(self, pvalue=False, attr='targets', **kwargs):
        """Initialize

        Parameters
        ----------
        pvalue : bool
          Either to report p-value of pearsons correlation coefficient
          instead of pure correlation coefficient
        attr : str
          What attribut to correlate with
        """
        # init base classes first
        FeaturewiseMeasure.__init__(self, **kwargs)

        self.__pvalue = int(pvalue)
        self.__attr = attr
Ejemplo n.º 8
0
    def __init__(self, datameasure,
                 noise=np.random.normal):
        """
        Parameters
        ----------
        datameasure : `Measure`
          Used to quantify the effect of noise perturbation.
        noise: Callable
          Used to generate noise. The noise generator has to return an 1d array
          of n values when called the `size=n` keyword argument. This is the
          default interface of the random number generators in NumPy's
          `random` module.
        """
        # init base classes first
        FeaturewiseMeasure.__init__(self)

        self.__datameasure = datameasure
        self.__noise = noise
Ejemplo n.º 9
0
 def __init__(self, mult=1, **kwargs):
     FeaturewiseMeasure.__init__(self, **kwargs)
     self.__mult = mult