Changeset 7253:e2ff2a62dfb9 in orange


Ignore:
Timestamp:
02/02/11 22:10:09 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
3e377bd0e3be0e4a2aaa61a99baeb49449e11ecc
Message:
 
Location:
orange/Orange
Files:
1 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/classification/svm/__init__.py

    r7241 r7253  
    235235            raise ValueError("Example table is without any defined classes") 
    236236        if self.svm_type in [0,1] and \ 
    237         examples.domain.classVar.varType!=Orange.core.VarTypes.Discrete: 
     237        examples.domain.classVar.varType!=Orange.data.Type.Discrete: 
    238238            self.svm_type+=3 
    239239            #raise AttributeError, "Cannot learn a discrete classifier from non descrete class data. Use EPSILON_SVR or NU_SVR for regression" 
    240240        if self.svm_type in [3,4] and \ 
    241         examples.domain.classVar.varType==Orange.core.VarTypes.Discrete: 
     241        examples.domain.classVar.varType==Orange.data.Type.Discrete: 
    242242            self.svm_type-=3 
    243243            #raise AttributeError, "Cannot do regression on descrete class data. Use C_SVC or NU_SVC for classification" 
     
    493493                SVs[svInd].getmetas(False, Orange.data.feature.Feature).keys() 
    494494                for attr in attributes: 
    495                     if attr.varType==Orange.core.VarTypes.Continuous: 
     495                    if attr.varType==Orange.data.Type.Continuous: 
    496496                        updateWeights(w, attr, to_float(SVs[svInd][attr]), \ 
    497497                                      classifier.coef[coefInd][svInd]) 
     
    501501                SVs[svInd].getmetas(False, Orange.data.feature.Feature).keys() 
    502502                for attr in attributes: 
    503                     if attr.varType==Orange.core.VarTypes.Continuous: 
     503                    if attr.varType==Orange.data.Type.Continuous: 
    504504                        updateWeights(w, attr, to_float(SVs[svInd][attr]), \ 
    505505                                      classifier.coef[coefInd][svInd]) 
     
    646646    attrs = examples.domain.attributes + examples.domain.getmetas().values() 
    647647    attrs = [attr for attr in attrs if attr.varType  
    648              in [Orange.core.VarTypes.Continuous,  
    649                  Orange.core.VarTypes.Discrete]] 
     648             in [Orange.data.Type.Continuous,  
     649                 Orange.data.Type.Discrete]] 
    650650    cv = examples.domain.classVar 
    651651     
    652652    for ex in examples: 
    653         if cv.varType == Orange.core.VarTypes.Discrete: 
     653        if cv.varType == Orange.data.Type.Discrete: 
    654654            file.write(str(int(ex[cv])))   
    655655        else: 
Note: See TracChangeset for help on using the changeset viewer.