/usr/share/pyshared/mvpa2/measures/pls.py is in python-mvpa2 2.1.0-1.
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 55 56 57 58 | # 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.
#
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""PLS is not yet implemented
"""
__docformat__ = 'restructuredtext'
import numpy as np
from mvpa2.measures.base import FeaturewiseMeasure
if __debug__:
from mvpa2.base import debug
class PLS(FeaturewiseMeasure):
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
def _calc_pls(self,mat,labels):
# take mean within condition(label) and concat to make a
# condition by features matrix
X = []
for ul in np.unique(labels):
X.append(mat[labels==ul].mean(axis=0))
X = np.asarray(X)
# center each condition by subtracting the grand mean
X -= X.mean(axis=1)[:,np.newaxis].repeat(X.shape[1],axis=1)
# run SVD (checking to transpose if necessary)
U,s,Vh = np.linalg.svd(X, full_matrices=0)
# run procrust to reorder if necessary
def _procrust():
pass
def _call(self,dataset):
#
pass
class TaskPLS(PLS):
pass
|