PEATSA/Core/Classify.py
def runAnalysis(self, data, features):
    
        '''Runs the LARS algorithm on data and returns features strongly associated with the response variable
    
        Parameters
            data - A mvpa.datasets.Dataset instance.
            features - A list of features being used for the classification process.
                This is not necessary for the classification process since data already
                contains the information.
                However it is necessary to map back the result of the classification process to the features'''
    
        classifier = mvpa.clfs.lars.LARS(model_type='lar', trace=False)
        classifier.train(data)
    
        sen = classifier.getSensitivityAnalyzer(force_training=True)
        perturber = mvpa.measures.noiseperturbation.NoisePerturbationSensitivity(sen)
        self.perturberResults = perturber(data)
    
        result = []
        errorCutoff = 1
        setCutoff = 3
        found = []
        systematicGroups = []
        outliers = []
        for i in range(len(features)):
            vector = data.samples[:,i]
            sum = reduce(operator.add, vector)
            weight = classifier.weights[i]
            entry = [features[i], classifier.weights[i], sum]
            if weight != 0:
                print entry, " ", self.perturberResults[i]
                found.append(entry)
            if sum >= setCutoff and weight >= errorCutoff:
                systematicGroups.append(entry)
            elif sum <= setCutoff and weight >= errorCutoff:
                outliers.append(entry)
    
        systematicGroups.sort(self.compareResidues)
        outliers.sort(self.compareResidues)
    
        if len(systematicGroups) is not 0:
            print 'Features possible associated with systematic error'
            for res in systematicGroups:
                print res
        else:
            print 'No systematic groups identified'
    
        if len(outliers) is not 0:
            print 'Features associated with possible outliers'
            for res in outliers:
                print res
        else:
            print 'No outlier groups identified'
    
        return found, systematicGroups, outliers
Runs the LARS algorithm on data and returns features strongly associated with the response variable
    
        Parameters
            data - A mvpa.datasets.Dataset instance.
            features - A list of features being used for the classification process.
                This is not necessary for the classification process since data already
                contains the information.
                However it is necessary to map back the result of the classification process to the features
Runs the LARS algorithm on data and returns features strongly associated with the response variable
Parameters
data - A mvpa.datasets.Dataset instance.
features - A list of features being used for the classification process.
This is not necessary for the classification process since data already
contains the information.
However it is necessary to map back the result of the classification process to the features
Runs the LARS algorithm on data and returns features strongly associated with the response variable Parameters data - A mvpa . datasets . Dataset instance . features - A list of features being used for the classification process . This is not necessary for the classification process since data already contains the information . However it is necessary to map back the result of the classification process to the features
def runAnalysis(self, data, features):
        classifier = mvpa.clfs.lars.LARS(model_type='lar', trace=False)
        classifier.train(data)
        sen = classifier.getSensitivityAnalyzer(force_training=True)
        perturber = mvpa.measures.noiseperturbation.NoisePerturbationSensitivity(sen)
        self.perturberResults = perturber(data)
        result = []
        errorCutoff = 1
        setCutoff = 3
        found = []
        systematicGroups = []
        outliers = []
        for i in range(len(features)):
            vector = data.samples[:,i]
            sum = reduce(operator.add, vector)
            weight = classifier.weights[i]
            entry = [features[i], classifier.weights[i], sum]
            if weight != 0:
                print entry, " ", self.perturberResults[i]
                found.append(entry)
            if sum >= setCutoff and weight >= errorCutoff:
                systematicGroups.append(entry)
            elif sum <= setCutoff and weight >= errorCutoff:
                outliers.append(entry)
        systematicGroups.sort(self.compareResidues)
        outliers.sort(self.compareResidues)
        if len(systematicGroups) is not 0:
            print 'Features possible associated with systematic error'
            for res in systematicGroups:
                print res
        else:
            print 'No systematic groups identified'
        if len(outliers) is not 0:
            print 'Features associated with possible outliers'
            for res in outliers:
                print res
        else:
            print 'No outlier groups identified'
        return found, systematicGroups, outliers
def runAnalysis ( self , data , features ) : classifier = mvpa . clfs . lars . LARS ( model_type = 'lar' , trace = False ) classifier . train ( data ) sen = classifier . getSensitivityAnalyzer ( force_training = True ) perturber = mvpa . measures . noiseperturbation . NoisePerturbationSensitivity ( sen ) self . perturberResults = perturber ( data ) result = [ ] errorCutoff = 1 setCutoff = 3 found = [ ] systematicGroups = [ ] outliers = [ ] for i in range ( len ( features ) ) : vector = data . samples [ : , i ] sum = reduce ( operator . add , vector ) weight = classifier . weights [ i ] entry = [ features [ i ] , classifier . weights [ i ] , sum ] if weight != 0 : print entry , " " , self . perturberResults [ i ] found . append ( entry ) if sum >= setCutoff and weight >= errorCutoff : systematicGroups . append ( entry ) elif sum <= setCutoff and weight >= errorCutoff : outliers . append ( entry ) systematicGroups . sort ( self . compareResidues ) outliers . sort ( self . compareResidues ) if len ( systematicGroups ) is not 0 : print 'Features possible associated with systematic error' for res in systematicGroups : print res else : print 'No systematic groups identified' if len ( outliers ) is not 0 : print 'Features associated with possible outliers' for res in outliers : print res else : print 'No outlier groups identified' return found , systematicGroups , outliers
Runs the LARS algorithm on data and returns features strongly associated with the response variable
Parameters
data - A mvpa.datasets.Dataset instance.
Runs the LARS algorithm on data and returns features strongly associated with the response variable Parameters data - A mvpa . datasets . Dataset instance .
'''Runs the LARS algorithm on data and returns features strongly associated with the response variable
    
        Parameters
            data - A mvpa.datasets.Dataset instance.
            features - A list of features being used for the classification process.
                This is not necessary for the classification process since data already
                contains the information.
                However it is necessary to map back the result of the classification process to the features'''
self
data
features