Changeset 3699:547d8c6d04f6 in orange
 Timestamp:
 05/27/07 18:51:59 (7 years ago)
 Branch:
 default
 Convert:
 b2ab204c1baa35d41b4fc4019453c0ec80fa5277
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

orange/orngVizRank.py
r3537 r3699 120 120 self.attrDisc = DISC_MEAS_RELIEFF 121 121 self.attrSubsetSelection = GAMMA_ALL # how do we find attribute subsets to evaluate  deterministic according to attribute ranking score or using gamma distribution  if using gamma, do we want to evaluate all possible permutations of attributes or only one 122 self. useSupervisedPCA = 0 # use the supervisedPCA122 self.projOptimizationMethod = 0 # None, supervisedPCA, partial least square 123 123 self.useExampleWeighting = 0 # weight examples, so that the class that has a low number of examples will have higher weights 124 124 … … 601 601 for i in range(minLength, maxLength+1): 602 602 if i > len(attributes): continue # if we don't have enough attributes 603 if self. useSupervisedPCA:603 if self.projOptimizationMethod != 0: 604 604 permutationIndices[i] = [range(i)] 605 605 else: … … 704 704 705 705 # create only one permutation, because its all we need 706 elif self. useSupervisedPCA:706 elif self.projOptimizationMethod != 0: 707 707 permutations.append(reduce(operator.add, combination)) 708 708 else: … … 729 729 return permutations 730 730 731 731 732 # ########################################################################## 732 733 # MAIN FUNCTION FOR EVALUATING PROJECTIONS … … 784 785 # #################### RADVIZ, LINEAR_PROJECTION ################################ 785 786 elif self.visualizationMethod in (RADVIZ, LINEAR_PROJECTION, POLYVIZ): 786 if self. useSupervisedPCA:787 if self.projOptimizationMethod != 0: 787 788 self.freeviz.useGeneralizedEigenvectors = 1 788 789 self.graph.normalizeExamples = 0 … … 810 811 attrIndices = permutations[0] 811 812 812 if self. useSupervisedPCA:813 xanchors, yanchors, (attrNames, newIndices) = self.freeviz.find SPCAProjection(attrIndices, setGraphAnchors = 0, percentDataUsed = self.percentDataUsed)813 if self.projOptimizationMethod != 0: 814 xanchors, yanchors, (attrNames, newIndices) = self.freeviz.findProjection(self.projOptimizationMethod, attrIndices, setAnchors = 0, percentDataUsed = self.percentDataUsed) 814 815 table = self.graph.createProjectionAsExampleTable(newIndices, domain = domain, XAnchors = xanchors, YAnchors = yanchors) 815 816 if len(table) < self.minNumOfExamples: continue … … 958 959 959 960 # first try to use the attributes in the projection and evaluate only different permutations of these attributes 960 if self.locOptOptimizeProjectionByPermutingAttributes == 1 and self. useSupervisedPCA== 0:961 if self.locOptOptimizeProjectionByPermutingAttributes == 1 and self.projOptimizationMethod == 0: 961 962 bestProjection = projection; tempProjection = projection 962 963 bestAccuracy = accuracy; tempAccuracy = accuracy … … 1010 1011 tempList = [] 1011 1012 1012 # supervised PCA1013 if self. useSupervisedPCA:1013 # SPCA, PLS 1014 if self.projOptimizationMethod != 0: 1014 1015 if iteration == 0: # replace one attribute in each projection with attribute attr 1015 1016 testProjections = [copy(projection) for i in range(len(projection))] … … 1021 1022 if newProjDict.has_key(str(proj)): continue 1022 1023 newProjDict[str(proj)] = 1 1023 xanchors, yanchors, (attrNames, newIndices) = self.freeviz.find SPCAProjection(proj, setGraphAnchors = 0)1024 xanchors, yanchors, (attrNames, newIndices) = self.freeviz.findProjection(self.projOptimizationMethod, attrIndices, setAnchors = 0, percentDataUsed = self.percentDataUsed) 1024 1025 table = self.graph.createProjectionAsExampleTable(newIndices, domain = domain, XAnchors = xanchors, YAnchors = yanchors) 1025 1026 if len(table) < self.minNumOfExamples: continue … … 1098 1099 file = open(name, "wt") 1099 1100 1100 attrs = ["kValue", "percentDataUsed", "qualityMeasure", "testingMethod", "parentName", "evaluationAlgorithm", "useExampleWeighting", " useSupervisedPCA", "attrSubsetSelection", "optimizationType", "attributeCount", "attrDisc", "attrCont", "timeLimit", "projectionLimit"]1101 attrs = ["kValue", "percentDataUsed", "qualityMeasure", "testingMethod", "parentName", "evaluationAlgorithm", "useExampleWeighting", "projOptimizationMethod", "attrSubsetSelection", "optimizationType", "attributeCount", "attrDisc", "attrCont", "timeLimit", "projectionLimit"] 1101 1102 dict = {} 1102 1103 for attr in attrs: dict[attr] = self.__dict__.get(attr) … … 1265 1266 vizrank.attributeCount = 10 1266 1267 vizrank.attrCont = CONT_MEAS_S2NMIX 1267 vizrank. useSupervisedPCA= 01268 vizrank.projOptimizationMethod = 0 1268 1269 vizrank.useExampleWeighting = 0 1269 1270 vizrank.attrSubsetSelection = GAMMA_SINGLE
Note: See TracChangeset
for help on using the changeset viewer.