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