Ejemplo n.º 1
0
    def __init__(self, sd=0, distribution='rdist', fpp=None, nbins=400, **kwargs):
        """L2-Norm the values, convert them to p-values of a given distribution.

        Parameters
        ----------
        sd : int
          Samples dimension (if len(x.shape)>1) on which to operate
        distribution : string
          Which distribution to use. Known are: 'rdist' (later normal should
          be there as well)
        fpp : float
          At what p-value (both tails) if not None, to control for false
          positives. It would iteratively prune the tails (tentative real positives)
          until empirical p-value becomes less or equal to numerical.
        nbins : int
          Number of bins for the iterative pruning of positives

        WARNING: Highly experimental/slow/etc: no theoretical grounds have been
        presented in any paper, nor proven
        """
        externals.exists('scipy', raise_=True)
        ClassWithCollections.__init__(self, **kwargs)

        self.sd = sd
        if not (distribution in ['rdist']):
            raise ValueError, "Actually only rdist supported at the moment" \
                  " got %s" % distribution
        self.distribution = distribution
        self.fpp = fpp
        self.nbins = nbins
Ejemplo n.º 2
0
    def __init__(self, mode='discard', **kwargs):
        """
        Parameters
        ----------
         mode : {'discard', 'select'}
            Decides whether to `select` or to `discard` features.
        """
        ClassWithCollections.__init__(self, **kwargs)

        self._set_mode(mode)
        """Flag whether to select or to discard elements."""
Ejemplo n.º 3
0
Archivo: stats.py Proyecto: esc/PyMVPA
    def __init__(self, tail='both', **kwargs):
        """
        Parameters
        ----------
        tail : {'left', 'right', 'any', 'both'}
          Which tail of the distribution to report. For 'any' and 'both'
          it chooses the tail it belongs to based on the comparison to
          p=0.5. In the case of 'any' significance is taken like in a
          one-tailed test.
        """
        ClassWithCollections.__init__(self, **kwargs)

        self._set_tail(tail)
Ejemplo n.º 4
0
Archivo: node.py Proyecto: esc/PyMVPA
 def __init__(self, space=None, postproc=None, **kwargs):
     """
     Parameters
     ----------
     space: str, optional
       Name of the 'processing space'. The actual meaning of this argument
       heavily depends on the sub-class implementation. In general, this is
       a trigger that tells the node to compute and store information about
       the input data that is "interesting" in the context of the
       corresponding processing in the output dataset.
     postproc : Node instance, optional
       Node to perform post-processing of results. This node is applied
       in `__call__()` to perform a final processing step on the to be
       result dataset. If None, nothing is done.
     """
     ClassWithCollections.__init__(self, **kwargs)
     self.set_space(space)
     self.set_postproc(postproc)
Ejemplo n.º 5
0
    def __init__(self, clf, labels=None, train=True, **kwargs):
        """Initialization.

        Parameters
        ----------
        clf : Classifier
          Either trained or untrained classifier
        labels : list
          if provided, should be a set of labels to add on top of the
          ones present in testdata
        train : bool
          unless train=False, classifier gets trained if
          trainingdata provided to __call__
        """
        ClassWithCollections.__init__(self, **kwargs)
        self.__clf = clf

        self._labels = labels
        """Labels to add on top to existing in testing data"""

        self.__train = train
        """Either to train classifier if trainingdata is provided"""
Ejemplo n.º 6
0
 def __init__(self, **kwargs):
     ClassWithCollections.__init__(self, **kwargs)
Ejemplo n.º 7
0
 def __init__(self, **kwargs):
     # XXX make such example when we actually need to invoke
     # constructor
     # TestClassProper.__init__(self, **kwargs)
     ClassWithCollections.__init__(self, **kwargs)
Ejemplo n.º 8
0
 def __init__(self, *args, **kwargs):
     """Base Kernel class has no parameters
     """
     ClassWithCollections.__init__(self, *args, **kwargs)
     self._k = None
     """Implementation specific version of the kernel"""