Changeset 9195:baf0d20ab750 in orange


Ignore:
Timestamp:
11/10/11 14:53:22 (2 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
512c9adc07d889e45a6ec4477baa7cccf8220a19
Message:

Fixed OneClass SVM learning.

File:
1 edited

Legend:

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

    r9189 r9195  
    260260                 cache_size=200, eps=0.001, normalization=True, 
    261261                 weight=[], **kwargs): 
    262         self.svm_type = SVMLearner.Nu_SVC 
     262        self.svm_type = svm_type 
    263263        self.kernel_type = kernel_type 
    264264        self.kernel_func = kernel_func 
     
    310310            raise ValueError("Custom kernel function not supplied") 
    311311         
     312        import warnings 
     313         
    312314        nu = self.nu 
    313315        if self.svm_type == SVMLearner.Nu_SVC: #is nu feasible 
     
    315317            if self.nu > max_nu: 
    316318                if getattr(self, "verbose", 0): 
    317                     import warnings 
    318319                    warnings.warn("Specified nu %.3f is infeasible. \ 
    319320                    Setting nu to %.3f" % (self.nu, max_nu)) 
     
    326327        self.learner.nu = nu 
    327328        self.learner.set_weights(self.weight) 
     329        if self.svm_type == SVMLearner.OneClass and self.probability: 
     330            self.learner.probability = False 
     331            warnings.warn("One-class SVM probability output not supported yet.") 
    328332        return self.learn_classifier(examples) 
    329333 
Note: See TracChangeset for help on using the changeset viewer.