Changeset 7908:2f306affd2d9 in orange


Ignore:
Timestamp:
05/17/11 14:26:42 (3 years ago)
Author:
matija <matija.polajnar@…>
Branch:
default
Convert:
b5ff2da195564a2d6ff51617b02c18f6eb519374
Message:

Orange.projection.linear: bugfixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/projection/linear.py

    r7907 r7908  
    676676 
    677677        if percent_data_used != 100: 
    678             indices = Orange.core.MakeRandomIndices2(self.graph.rawData, 
     678            indices = Orange.data.sample.SubsetIndices2(self.graph.rawData, 
    679679                                                1.0-(float(percent_data_used)/100.0)) 
    680680            try: 
     
    869869# ############################################################################# 
    870870# class that represents freeviz classifier 
    871 class FreeVizClassifier(Orange.core.Classifier): 
     871class FreeVizClassifier(Orange.classification.Classifier): 
    872872    """ 
    873873    A kNN classifier on the 2D projection of the data, optimized by FreeViz. 
     
    910910 
    911911        valid_data = graph.getValidList(indices) 
    912         domain = Orange.core.Domain([graph.dataDomain[i].name for i in indices]+ 
     912        domain = Orange.data.Domain([graph.dataDomain[i].name for i in indices]+ 
    913913                               [graph.dataDomain.classVar.name], 
    914914                               graph.dataDomain) 
     
    926926                                             valid_data = valid_data, 
    927927                                             jitterSize = -1) 
    928         self.classifier = Orange.core.P2NN(domain, 
     928        self.classifier = Orange.classification.knn.P2NN(domain, 
    929929                                      numpy.transpose(numpy.array([numpy.compress(valid_data, 
    930930                                                                                  graph.unscaled_x_positions), 
     
    937937    # for a given instance run argumentation and find out to which class it most often fall 
    938938    @deprecated_keywords({"example": "instance", "returnType": "return_type"}) 
    939     def __call__(self, instance, return_type=Orange.core.Classifier.GetValue): 
     939    def __call__(self, instance, return_type=Orange.classification.Classifier.GetValue): 
    940940        #instance.setclass(0) 
    941941        return self.classifier(instance, returntype) 
     
    953953     
    954954    """ 
    955     def __new__(cls, instances = None, weight_id = 0, **argkw): 
     955    def __new__(cls, freeviz = None, instances = None, weight_id = 0, **argkw): 
    956956        self = Orange.classification.Learner.__new__(cls, **argkw) 
    957957        if instances: 
    958             self.__init__(**argkw) 
     958            self.__init__(freeviz, **argkw) 
    959959            return self.__call__(instances, weight_id) 
    960960        else: 
     
    979979     
    980980    """ 
    981     def __new__(cls, instances = None, weight_id = 0, **argkw): 
     981    def __new__(cls, freeviz = None, instances = None, weight_id = 0, **argkw): 
    982982        self = Orange.classification.Learner.__new__(cls, **argkw) 
    983983        if instances: 
    984             self.__init__(**argkw) 
     984            self.__init__(freeviz, **argkw) 
    985985            return self.__call__(instances, weight_id) 
    986986        else: 
Note: See TracChangeset for help on using the changeset viewer.