Ignore:
Timestamp:
03/19/12 18:01:40 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
rebase_source:
c778ff6dea4cf273365795e0c003e3cbbaff72c6
Message:

Added support for custom kernels in get_binary_classifier.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/testing/unit/tests/test_svm.py

    r10573 r10574  
    9696        """ Test custom kernel wrapper 
    9797        """ 
    98         # Need the data for ExamplesDistanceConstructor_Euclidean   
     98        if data.domain.has_continuous_attributes(): 
     99            dist = orange.ExamplesDistanceConstructor_Euclidean(data) 
     100        else: 
     101            dist = orange.ExamplesDistanceConstructor_Hamming(data) 
    99102        self.learner = self.LEARNER(kernel_type=SVMLearner.Custom, 
    100                                     kernel_func=RBFKernelWrapper(orange.ExamplesDistanceConstructor_Euclidean(data), gamma=0.5)) 
     103                                    kernel_func=RBFKernelWrapper(dist, gamma=0.5)) 
    101104 
    102105        testing.LearnerTestCase.test_learner_on(self, data) 
     106        svm_test_binary_classifier(self, data) 
    103107 
    104108 
Note: See TracChangeset for help on using the changeset viewer.