Changeset 3492:87d3a516c1c6 in orange


Ignore:
Timestamp:
04/04/07 13:37:53 (7 years ago)
Author:
Gregor <Gregor@…>
Branch:
default
Convert:
918afbf622bc8f1dcbc8dc3a34d5c5177a4006a1
Message:
  • bugfix
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/orngVizRank.py

    r3413 r3492  
    2222 
    2323# results in the list 
    24 ACCURACY = 0  
     24ACCURACY = 0 
    2525OTHER_RESULTS = 1 
    2626LEN_TABLE = 2 
     
    106106        self.data = None 
    107107        self.subsetData = None 
    108          
     108 
    109109        self.results = [] 
    110110        self.arguments = []                                 # a list of arguments 
    111                  
     111 
    112112        self.kValue = 10 
    113113        self.percentDataUsed = 100 
     
    122122        self.useSupervisedPCA = 0                           # use the supervisedPCA 
    123123        self.useExampleWeighting = 0                        # weight examples, so that the class that has a low number of examples will have higher weights 
    124          
     124 
    125125        self.externalLearner = None                         # do we use knn or some external learner 
    126126        self.selectedClasses = []                           # which classes are we trying to separate 
     
    140140        self.optimizeProjectionLimit = 0 
    141141        self.optimizedProjectionsCount = 0 
    142          
     142 
    143143        if visualizationMethod == SCATTERPLOT: self.parentName = "Scatterplot" 
    144144        elif visualizationMethod == RADVIZ:    self.parentName = "Radviz" 
    145145        elif visualizationMethod == LINEAR_PROJECTION:  self.parentName = "Linear Projection" 
    146146        elif visualizationMethod == POLYVIZ:            self.parentName = "Polyviz" 
    147          
    148         self.argumentCount = 1              # number of arguments used when classifying  
     147 
     148        self.argumentCount = 1              # number of arguments used when classifying 
    149149        #self.argumentValueFormula = 1       # how to compute argument value 
    150150 
     
    152152        self.locOptAllowAddingAttributes = 0                        # do we allow increasing the number of visualized attributes 
    153153        self.locOptMaxAttrsInProj = 20                              # if self.locOptAllowAddingAttributes == 1 then what is the maximum number of attributes in a projection 
    154         self.locOptAttrsToTry = 50                                 # number of best ranked attributes to try  
     154        self.locOptAttrsToTry = 50                                 # number of best ranked attributes to try 
    155155        self.locOptProjCount = 20                                   # try to locally optimize this number of best ranked projections 
    156156        self.attributeNameIndex = {}                                # dict with indices to attributes 
     
    158158        self.rankArgumentsByStrength = 0  # how do you want to compute arguments. if 0 then we go through the top ranked projection and classify. If 1 we rerank projections to projections with strong class prediction and use them for classification 
    159159        self.storeEachPermutation = 0       # do we want to save information for each fold when evaluating projection - used to compute VizRank's accuracy 
    160                  
     160 
    161161        self.datasetName = "" 
    162          
     162 
    163163        # 0 - set to sqrt(N) 
    164164        # 1 - set to N / c 
     
    206206            else: 
    207207                kValue = self.getkValue(kValueFormula) 
    208              
     208 
    209209            if self.percentDataUsed != 100: 
    210210                kValue = int(kValue * self.percentDataUsed / 100.0) 
    211211        else: 
    212212            kValue = k 
    213              
     213 
    214214        return orange.kNNLearner(k = kValue, rankWeight = 0, distanceConstructor = orange.ExamplesDistanceConstructor_Euclidean(normalize=0)) 
    215          
     215 
    216216 
    217217    def setData(self, data): 
     
    225225        if not hasDiscreteClass: 
    226226            return 
    227          
     227 
    228228        self.selectedClasses = range(len(self.data.domain.classVar.values)) 
    229          
     229 
    230230        if self.autoSetTheKValue: 
    231231            if self.kValueFormula == 0 or not data.domain.classVar or data.domain.classVar.varType == orange.VarTypes.Continuous: 
     
    242242        self.graph.setSubsetData(subData) 
    243243        self.clearArguments() 
    244          
     244 
    245245    def getEvaluatedAttributes(self): 
    246246        return orngVisFuncts.evaluateAttributes(self.data, contMeasures[self.attrCont][1], discMeasures[self.attrDisc][1]) 
     
    267267        if funct(accuracy, self.results[top][ACCURACY]) == accuracy: 
    268268            return top 
    269         else:  
     269        else: 
    270270            return bottom 
    271271 
     
    319319            folds[fold].sort(); folds[fold].reverse() 
    320320            self.results = [self.results[index] for (val, index) in folds[fold][:self.argumentCount+100]] 
    321                          
     321 
    322322            for i in range(len(data)): 
    323323                if indices[i] != fold: continue 
     
    367367            if testTable.domain.classVar.varType == orange.VarTypes.Discrete: 
    368368                return self.computeAccuracyFromResults(testTable, results) 
    369                  
     369 
    370370            # for continuous class we can't compute brier score and classification accuracy 
    371371            else: 
     
    393393            nattr.getValueFrom = orange.ClassifierByLookupTable2(nattr, testTable.domain[0], testTable.domain[1]) 
    394394            for i in range(NUMBER_OF_INTERVALS*NUMBER_OF_INTERVALS): nattr.getValueFrom.lookupTable[i] = i 
    395              
     395 
    396396            for dist in orange.ContingencyAttrClass(nattr, testTable): 
    397397                dist = list(dist) 
     
    431431                prediction[res.actualClass] += val 
    432432                countsByFold[res.iterationNumber] += 1 
    433              
     433 
    434434        elif self.qualityMeasure == CLASS_ACCURACY: 
    435435            #return 100*orngStat.CA(results)[0], results 
     
    440440        elif self.qualityMeasure == AUC: 
    441441            return orngStat.AUC(results)[0], None 
    442              
     442 
    443443        # compute accuracy only for classes that are selected as interesting. other class values do not participate in projection evaluation 
    444444        acc = sum(prediction) / float(max(1, len(results.results)))                 # accuracy over all class values 
     
    451451 
    452452        return val/max(1, float(s)), (acc, prediction, list(currentClassDistribution)) 
    453          
     453 
    454454 
    455455    # Argumentation functions 
     
    503503 
    504504        if 1 in [example[attr].isSpecial() for attr in attrList]: return None, None 
    505          
     505 
    506506        attrIndices = [self.attributeNameIndex[attr] for attr in attrList] 
    507507        attrVals = [self.graph.scaleExampleValue(example, ind) for ind in attrIndices] 
     
    509509        table = self.graph.createProjectionAsExampleTable(attrIndices, settingsDict = generalDict) 
    510510        [xTest, yTest] = self.graph.getProjectedPointPosition(attrIndices, attrVals, settingsDict = generalDict) 
    511          
     511 
    512512        learner = self.externalLearner or self.createkNNLearner(k = kValue) 
    513513        if self.useExampleWeighting: table, weightID = orange.Preprocessor_addClassWeight(table, equalize=1) 
    514514        else: weightID = 0 
    515          
     515 
    516516        classifier = learner(table, weightID) 
    517517        classVal, dist = classifier(orange.Example(table.domain, [xTest, yTest, "?"]), orange.GetBoth) 
    518518        return classVal, dist 
    519          
     519 
    520520 
    521521    def getArgumentIndex(self, value, classValue): 
     
    592592                self.evaluationData["attrs"] = attributes 
    593593                self.totalPossibilities = 0 
    594                  
     594 
    595595                # build list of indices for permutations of different number of attributes 
    596596                permutationIndices = {} 
     
    630630        if self.attrSubsetSelection == DETERMINISTIC_ALL: 
    631631            self.evaluationData["z"] = (u >= maxLength and z+1) or z 
    632              
     632 
    633633        self.evaluationData["combinations"] = combinations 
    634634        return combinations 
     
    641641        triedDict = self.evaluationData.get("triedCombinations", {}) 
    642642        projCountWidth = len(triedDict.keys()) / 1000 
    643          
     643 
    644644        if self.attrCont == CONT_MEAS_S2NMIX or self.attrSubsetSelection == GAMMA_SINGLE: 
    645645            numClasses = len(self.data.domain.classVar.values) 
    646646            attributes, attrsByClass = self.evaluationData["attrs"] 
    647              
     647 
    648648            for i in range(maxTries): 
    649649                attrList = [[] for c in range(numClasses)]; attrs = [] 
     
    677677        return None 
    678678 
    679     # generate possible permutations of the current attribute subset. use evaluationData dict to find which attribute subset to use.  
     679    # generate possible permutations of the current attribute subset. use evaluationData dict to find which attribute subset to use. 
    680680    def getNextPermutations(self): 
    681681        combinations = self.evaluationData["combinations"] 
     
    698698                        usedPerms[tuple(comb)] = 1 
    699699                        permutations.append(comb) 
    700                  
     700 
    701701            # create only one permutation, because its all we need 
    702702            elif self.useSupervisedPCA: 
     
    730730    def evaluateProjections(self): 
    731731        random.seed(0)      # always use the same seed to make results repeatable 
    732         if not self.data: return 
     732        if not self.data: return 0 
    733733        self.correctSettingsIfNecessary() 
    734734        if self.timeLimit == self.projectionLimit == 0 and self.__class__.__name__ == "VizRank": 
    735735            print "Evaluation of projections was started without any time or projection restrictions. To prevent an indefinite projection evaluation a time limit of 2 hours was set." 
    736736            self.timeLimit = 2 * 60 
    737              
     737 
    738738        self.evaluatedProjectionsCount = 0 
    739739        self.optimizedProjectionsCount = 0 
     
    747747 
    748748        if self.__class__.__name__ == "OWVizRank": 
    749             from qt import qApp, QMessageBox 
    750             if self.attributeCount >= 10 and not (self.useSupervisedPCA) and self.visualizationMethod != SCATTERPLOT and self.attrSubsetSelection != GAMMA_SINGLE and QMessageBox.critical(self, 'VizRank', 'You chose to evaluate projections with a high number of attributes. Since VizRank has to evaluate different placements\nof these attributes there will be a high number of projections to evaluate. Do you still want to proceed?','Continue','Cancel', '', 0,1): 
    751                 return 
    752             self.disableControls() 
    753             self.parentWidget.progressBarInit() 
    754         elif not self.data.domain.classVar or not self.data.domain.classVar.varType == orange.VarTypes.Discrete: 
     749            from qt import qApp 
     750 
     751        if not self.data.domain.classVar or not self.data.domain.classVar.varType == orange.VarTypes.Discrete: 
    755752            print "Projections can be evaluated only for data with a discrete class." 
    756             return 
    757          
     753            return 0 
     754 
    758755        if self.visualizationMethod == SCATTERPLOT: 
    759756            evaluatedAttributes = orngVisFuncts.evaluateAttributes(self.data, contMeasures[self.attrCont][1], discMeasures[self.attrDisc][1]) 
     
    764761            count = len(evaluatedAttributes)*(len(evaluatedAttributes)-1)/2 
    765762            strCount = orngVisFuncts.createStringFromNumber(count) 
    766              
     763 
    767764            for i in range(len(evaluatedAttributes)): 
    768765                for j in range(i): 
     
    770767                    self.evaluatedProjectionsCount += 1 
    771768                    if self.isEvaluationCanceled(): 
    772                         self.finishEvaluation(self.evaluatedProjectionsCount) 
    773                         return 
    774                      
     769                        return self.evaluatedProjectionsCount 
     770 
    775771                    table = self.graph.createProjectionAsExampleTable([attr1, attr2]) 
    776772                    if len(table) < self.minNumOfExamples: continue 
    777773                    accuracy, other_results = self.kNNComputeAccuracy(table) 
    778774                    self.addResult(accuracy, other_results, len(table), [self.data.domain[attr1].name, self.data.domain[attr2].name], self.evaluatedProjectionsCount, {}) 
    779                      
     775 
    780776                    if self.__class__.__name__ == "OWVizRank": 
    781777                        self.setStatusBarText("Evaluated %s/%s projections..." % (orngVisFuncts.createStringFromNumber(self.evaluatedProjectionsCount), strCount)) 
     
    787783                self.freeviz.useGeneralizedEigenvectors = 1 
    788784                self.graph.normalizeExamples = 0 
    789                  
     785 
    790786            # replace attribute names with indices in domain - faster searching 
    791             classIndex = self.attributeNameIndex[self.data.domain.classVar.name]             
     787            classIndex = self.attributeNameIndex[self.data.domain.classVar.name] 
    792788 
    793789            # variables and domain for the table 
     
    803799            newProjectionsExist = 1 
    804800            while newProjectionsExist: 
    805                 for experiment in range(maxLength-minLength+1):      
    806                     if self.selectNextAttributeSubset(minLength, maxLength) != None: break 
    807                     newProjectionsExist = 0          
     801                for experiment in range(maxLength-minLength+1): 
     802                    if self.selectNextAttributeSubset(minLength, maxLength): break 
     803                    newProjectionsExist = 0 
    808804                permutations = self.getNextPermutations() 
    809805                while permutations: 
    810806                    attrIndices = permutations[0] 
    811                         
     807 
    812808                    if self.useSupervisedPCA: 
    813809                        xanchors, yanchors, (attrNames, newIndices) = self.freeviz.findSPCAProjection(attrIndices, setGraphAnchors = 0, percentDataUsed = self.percentDataUsed) 
     
    817813                        accuracy, other_results = self.kNNComputeAccuracy(table) 
    818814                        self.addResult(accuracy, other_results, len(table), attrNames, self.evaluatedProjectionsCount, generalDict = {"XAnchors": list(xanchors), "YAnchors": list(yanchors)}) 
    819                         if self.isEvaluationCanceled(): self.finishEvaluation(self.evaluatedProjectionsCount); return 
     815                        if self.isEvaluationCanceled(): return self.evaluatedProjectionsCount 
    820816                        if self.__class__.__name__ == "OWVizRank": self.setStatusBarText("Evaluated %s projections..." % (orngVisFuncts.createStringFromNumber(self.evaluatedProjectionsCount))) 
    821817                    else: 
     
    823819                        YAnchors = self.graph.createYAnchors(len(attrIndices)) 
    824820                        validData = self.graph.getValidList(attrIndices) 
    825                         if numpy.sum(validData) >= self.minNumOfExamples:  
     821                        if numpy.sum(validData) >= self.minNumOfExamples: 
    826822                            classList = numpy.compress(validData, classListFull) 
    827823                            selectedData = numpy.compress(validData, numpy.take(self.graph.noJitteringScaledData, attrIndices, axis = 0), axis = 1) 
     
    837833                                table = self.graph.createProjectionAsExampleTable(permutation, validData = validData, classList = classList, sum_i = sum_i, XAnchors = XAnchors, YAnchors = YAnchors, domain = domain) 
    838834                                accuracy, other_results = self.kNNComputeAccuracy(table) 
    839                                  
     835 
    840836                                # save the permutation 
    841837                                if self.storeEachPermutation: 
     
    854850 
    855851                        if self.isEvaluationCanceled(): 
    856                             self.finishEvaluation(self.evaluatedProjectionsCount) 
    857                             return 
    858  
    859                     permutations = self.getNextPermutations()   
     852                            return self.evaluatedProjectionsCount 
     853 
     854                    permutations = self.getNextPermutations() 
    860855        else: 
    861856            print "unknown visualization method" 
    862857 
    863         self.finishEvaluation(self.evaluatedProjectionsCount) 
    864      
    865  
    866     def finishEvaluation(self, evaluatedProjections): 
    867         if self.__class__.__name__ == "OWVizRank": 
    868             secs = time.time() - self.startTime 
    869             self.setStatusBarText("Finished evaluation (evaluated %s projections in %d min, %d sec)" % (orngVisFuncts.createStringFromNumber(evaluatedProjections), secs/60, secs%60)) 
    870             self.parentWidget.progressBarFinished() 
    871             self.enableControls() 
    872             self.finishedAddingResults() 
    873             from qt import qApp;  qApp.processEvents() 
    874             if self.parentWidget: self.parentWidget.showSelectedAttributes() 
    875              
     858        return self.evaluatedProjectionsCount 
    876859 
    877860    def getProjectionQuality(self, attrList, useAnchorData = 0): 
     
    883866    def insertTempProjection(self, projections, acc, attrList): 
    884867        if len(projections) == 0: return [(acc, attrList)] 
    885          
     868 
    886869        top = 0; bottom = len(projections) 
    887870        while (bottom-top) > 1: 
     
    907890            self.optimizeProjectionLimit = 2 * 60 
    908891        """ 
    909          
    910         if self.__class__.__name__ == "OWVizRank":  
    911             self.disableControls() 
     892 
     893        if self.__class__.__name__ == "OWVizRank": 
    912894            from qt import qApp 
    913          
     895 
    914896        attrs = [self.results[i][ATTR_LIST] for i in range(count)]                                   # create a list of attributes that are in the top projections 
    915897        attrs = [[self.attributeNameIndex[name] for name in projection] for projection in attrs]    # find indices from the attribute names 
     
    940922                    if not tempDict.has_key((projection[0], attr)) and not tempDict.has_key((attr, projection[0])): testProjections.append([projection[0], attr]) 
    941923                    if not tempDict.has_key((projection[1], attr)) and not tempDict.has_key((attr, projection[1])): testProjections.append([attr, projection[1]]) 
    942                                          
     924 
    943925                    for testProj in testProjections: 
    944926                        table = self.graph.createProjectionAsExampleTable(testProj, domain = domain) 
     
    949931                        if acc > accuracy: 
    950932                            self.addResult(acc, other_results, len(table), [self.graph.attributeNames[i] for i in testProj], projIndex) 
    951                             self.insertTempProjection(projections, acc, proj) 
    952                             tempDict[tuple(proj)] = 1 
     933                            self.insertTempProjection(projections, acc, testProj) 
     934                            tempDict[tuple(testProj)] = 1 
    953935                            if max(acc, accuracy)/min(acc, accuracy) > 1.005:  significantImprovement = 1 
    954                          
     936 
    955937                        self.optimizedProjectionsCount += 1 
    956938                        if self.__class__ != VizRank: qApp.processEvents()        # allow processing of other events 
    957939                        if self.optimizedProjectionsCount % 10 == 0 and self.isOptimizationCanceled(): 
    958                             self.finishEvaluation(self.optimizedProjectionsCount) 
    959                             return 
     940                            return self.optimizedProjectionsCount 
    960941                    if significantImprovement: break 
    961942 
     
    992973                            failedConsecutiveTries = 0 
    993974                            triedPermutationsDict[str(newProj)] = 1 
    994                              
     975 
    995976                            table = self.graph.createProjectionAsExampleTable(newProj, validData = validData, classList = classList, XAnchors = XAnchors, YAnchors = YAnchors, domain = domain) 
    996977                            if len(table) < self.minNumOfExamples: continue 
     
    998979                            self.optimizedProjectionsCount += 1 
    999980                            if self.__class__ != VizRank: qApp.processEvents()        # allow processing of other events 
    1000                             if self.isOptimizationCanceled(): self.finishEvaluation(self.optimizedProjectionsCount); return 
     981                            if self.isOptimizationCanceled(): return self.optimizedProjectionsCount 
    1001982                            if hasattr(self, "setStatusBarText") and self.optimizedProjectionsCount % 10 == 0: 
    1002983                                self.setStatusBarText("Evaluated %s projections. Last accuracy was: %2.2f%%" % (orngVisFuncts.createStringFromNumber(self.optimizedProjectionsCount), acc)) 
     
    1018999                for iteration in range(2): 
    10191000                    if iteration == 1 and not self.locOptAllowAddingAttributes: continue    # if we are not allowed to increase the number of visualized attributes 
    1020                     if (len(projection) + iteration > self.locOptMaxAttrsInProj): continue     
     1001                    if (len(projection) + iteration > self.locOptMaxAttrsInProj): continue 
    10211002                    strTotalAtts = orngVisFuncts.createStringFromNumber(lenOfAttributes) 
    10221003                    for (attrIndex, attr) in enumerate(attributes): 
     
    10411022                                self.optimizedProjectionsCount += 1 
    10421023                                acc, other_results = self.kNNComputeAccuracy(table) 
    1043                                  
     1024 
    10441025                                tempList.append((acc, other_results, len(table), newIndices, {"XAnchors": xanchors, "YAnchors": yanchors})) 
    10451026                                if self.storeEachPermutation: 
     
    10471028 
    10481029                                if self.__class__ != VizRank: qApp.processEvents()        # allow processing of other events 
    1049                                 if self.isOptimizationCanceled(): self.finishEvaluation(self.optimizedProjectionsCount); return 
     1030                                if self.isOptimizationCanceled(): return self.optimizedProjectionsCount 
    10501031 
    10511032                        # ordinary radviz projections 
     
    10631044                            validData = self.graph.getValidList(testProjections[0]) 
    10641045                            classList = numpy.compress(validData, classListFull) 
    1065                              
     1046 
    10661047                            for testProj in testProjections: 
    10671048                                if newProjDict.has_key(str(testProj)): continue 
    10681049                                newProjDict[str(testProj)] = 1 
    1069                                  
     1050 
    10701051                                table = self.graph.createProjectionAsExampleTable(testProj, validData = validData, classList = classList, XAnchors = XAnchors, YAnchors = YAnchors, domain = domain) 
    10711052                                if len(table) < self.minNumOfExamples: continue 
     
    10791060                                self.optimizedProjectionsCount += 1 
    10801061                                if self.__class__ != VizRank: qApp.processEvents()        # allow processing of other events 
    1081                                 if self.isOptimizationCanceled(): self.finishEvaluation(self.optimizedProjectionsCount); return 
     1062                                if self.isOptimizationCanceled(): return self.optimizedProjectionsCount 
    10821063 
    10831064                        # return only the best attribute placements 
     
    10931074            print "unknown visualization method" 
    10941075 
    1095         self.finishEvaluation(self.optimizedProjectionsCount) 
     1076        return self.optimizedProjectionsCount 
    10961077 
    10971078    # ############################################################## 
     
    11121093        # open, write and save file 
    11131094        file = open(name, "wt") 
    1114          
     1095 
    11151096        attrs = ["kValue", "percentDataUsed", "qualityMeasure", "testingMethod", "parentName", "evaluationAlgorithm", "useExampleWeighting", "useSupervisedPCA", "attrSubsetSelection", "optimizationType", "attributeCount", "attrDisc", "attrCont", "timeLimit", "projectionLimit"] 
    11161097        dict = {} 
     
    11181099        dict["dataCheckSum"] = self.data.checksum() 
    11191100        dict["totalProjectionsEvaluated"] = self.evaluatedProjectionsCount + self.optimizedProjectionsCount  # let's also save the total number of projections that we evaluated in order to get this list 
    1120          
     1101 
    11211102        file.write("%s\n%s\n" % (str(dict), str(self.selectedClasses))) 
    11221103 
     
    11261107 
    11271108            (acc, other_results, lenTable, attrList, tryIndex, generalDict) = results[i] 
    1128              
     1109 
    11291110            s = "(%.3f, (" % (acc) 
    11301111            for val in other_results: 
     
    11591140        if self.__class__.__name__ == "OWVizRank": 
    11601141            import qt 
    1161          
     1142 
    11621143        file = open(name, "rt") 
    11631144        settings = eval(file.readline()[:-1]) 
     
    11761157            else: 
    11771158                print "The data set has a different checksum than the data set that was used in projection evaluation. Projection might be invalid but the file will be loaded anyway..." 
    1178                  
     1159 
    11791160        for key in settings.keys(): 
    11801161            setattr(self, key, settings[key]) 
    1181              
    1182         # find if it was computed for specific class values         
     1162 
     1163        # find if it was computed for specific class values 
    11831164        selectedClasses = eval(file.readline()[:-1]) 
    1184          
     1165 
    11851166        count = 0 
    11861167        for line in file.xreadlines(): 
     
    12211202 
    12221203        if self.VizRank.__class__.__name__ == "OWVizRank": 
    1223             self.VizRank.parentWidget.cdata(data) 
     1204            self.VizRank.parentWidget.setData(data) 
    12241205            #self.VizRank.useTimeLimit = 1 
    12251206            self.VizRank.timeLimit = self.VizRank.evaluationTime 
     
    12321213 
    12331214        self.VizRank.evaluateProjections() 
    1234          
    1235         # do we want to optimize current projection. if yes then spend the same amount of time to optimize it             
     1215 
     1216        # do we want to optimize current projection. if yes then spend the same amount of time to optimize it 
    12361217        if self.VizRank.optimizeTimeLimit > 0 or self.VizRank.optimizeProjectionLimit: 
    12371218            self.VizRank.optimizeBestProjections() 
     
    12411222 
    12421223 
    1243     # for a given example run argumentation and find out to which class it most often fall         
     1224    # for a given example run argumentation and find out to which class it most often fall 
    12441225    def __call__(self, example, returnType = orange.GetBoth): 
    12451226        if self.VizRank.__class__.__name__ == "OWVizRank": 
     
    12501231        else: 
    12511232            classVal, dist = self.VizRank.findArguments(example) 
    1252          
     1233 
    12531234        if returnType == orange.GetBoth: return classVal, dist 
    12541235        else:                            return classVal 
    1255          
     1236 
    12561237 
    12571238# ############################################################################# 
     
    12631244        self.VizRank = vizrank 
    12641245        self.name = self.VizRank.learnerName 
    1265          
    1266          
     1246 
     1247 
    12671248    def __call__(self, examples, weightID = 0): 
    12681249        return VizRankClassifier(self.VizRank, examples) 
     
    12931274    #vizrank.attrSubsetSelection = GAMMA_SINGLE 
    12941275    vizrank.attrSubsetSelection = DETERMINISTIC_ALL 
    1295      
     1276 
    12961277    #vizrank.attrCont = CONT_MEAS_S2N 
    12971278    vizrank.attrCont = CONT_MEAS_S2NMIX 
    1298      
     1279 
    12991280    #vizrank.storeEachPermutation = 1 
    13001281    #vizrank.load(r"E:\Development\Python23\Lib\site-packages\Orange\Datasets\microarray\cancer\leukemia - Radviz - test.proj") 
     
    13031284    vizrank.evaluateProjections() 
    13041285    #vizrank.findArguments(data[0]) 
    1305      
     1286 
Note: See TracChangeset for help on using the changeset viewer.