Package mvpa :: Package measures :: Module pls

[hide private]
[frames] | no frames]

# Source Code for Module mvpa.measures.pls

     1  # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
     2  # vi: set ft=python sts=4 ts=4 sw=4 et:
     3  ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
     4  #
     5  #   See COPYING file distributed along with the PyMVPA package for the
     6  #   copyright and license terms.
     7  #
     8  ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
     9
    10  __docformat__ = 'restructuredtext'
    11
    12  import numpy as N
    13
    14  from mvpa.measures.base import FeaturewiseDatasetMeasure
    15
    16  if __debug__:
    17      from mvpa.base import debug
    18
    19
    20 -class PLS(FeaturewiseDatasetMeasure):
    21 -    def __init__(self, num_permutations=200, num_bootstraps=100, **kwargs):
    22          # init base classes first
    23          FeaturewiseDatasetMeasure.__init__(self, **kwargs)
    24
    25          # save the args for the analysis
    26          self.num_permutations = num_permutations
    27          self.num_bootstraps = num_bootstraps
    28
    29 -    def _calc_pls(self,mat,labels):
    30          # take mean within condition(label) and concat to make a
    31          # condition by features matrix
    32          X = []
    33          for ul in N.unique(labels):
    34              X.append(mat[labels==ul].mean(axis=0))
    35          X = N.asarray(X)
    36
    37          # center each condition by subtracting the grand mean
    38          X -= X.mean(axis=1)[:,N.newaxis].repeat(X.shape[1],axis=1)
    39
    40          # run SVD (checking to transpose if necessary)
    41          U,s,Vh = N.linalg.svd(X, full_matrices=0)
    42
    43          # run procrust to reorder if necessary
    44
    45 -    def _procrust():
    46          pass
    47
    48 -    def _call(self,dataset):
    49
    50          #
    51          pass
    52
    53 -class TaskPLS(PLS):
    54      pass
    55