Ignore:
Timestamp:
03/29/12 15:16:14 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Changed tests for LinearSVMLearner.

File:
1 edited

Legend:

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

    r10655 r10687  
    22from Orange.testing import testing 
    33from Orange.testing.testing import datasets_driven 
    4 from Orange.classification.svm import LinearLearner 
     4from Orange.classification.svm import LinearSVMLearner 
    55try: 
    66    import unittest2 as unittest 
     
    1818        self.assertEquals(len(self.classifier.weights), 1) 
    1919 
    20     n_features = len(dataset.domain.attributes) 
    21     self.assert_(all(len(w) == n_features for w in self.classifier.weights)) 
    22  
    2320@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS) 
    24 class TestLinearLearnerL2R_L2LOSS_DUAL(testing.LearnerTestCase): 
    25     LEARNER = LinearLearner(sover_type=LinearLearner.L2R_L2LOSS_DUAL) 
     21class TestLinearSVMLearnerL2R_L2LOSS_DUAL(testing.LearnerTestCase): 
     22    LEARNER = LinearSVMLearner(sover_type=LinearSVMLearner.L2R_L2LOSS_DUAL) 
    2623 
    2724    test_learner_on = test_learner_on 
    2825 
    2926@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS) 
    30 class TestLinearLearnerL2R_L2LOSS(testing.LearnerTestCase): 
    31     LEARNER = LinearLearner(sover_type=LinearLearner.L2R_L2LOSS) 
     27class TestLinearSVMLearnerL2R_L2LOSS(testing.LearnerTestCase): 
     28    LEARNER = LinearSVMLearner(sover_type=LinearSVMLearner.L2R_L2LOSS) 
    3229    test_learner_on = test_learner_on 
    3330 
    3431@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS) 
    35 class TestLinearLearnerL2R_L1LOSS_DUAL(testing.LearnerTestCase): 
    36     LEARNER = LinearLearner(sover_type=LinearLearner.L2R_L1LOSS_DUAL) 
     32class TestLinearSVMLearnerL2R_L1LOSS_DUAL(testing.LearnerTestCase): 
     33    LEARNER = LinearSVMLearner(sover_type=LinearSVMLearner.L2R_L1LOSS_DUAL) 
    3734    test_learner_on = test_learner_on 
    3835 
    3936@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS) 
    40 class TestLinearLearnerL2R_L1LOSS(testing.LearnerTestCase): 
    41     LEARNER = LinearLearner(sover_type=LinearLearner.L2R_L2LOSS) 
     37class TestLinearSVMLearnerL2R_L1LOSS(testing.LearnerTestCase): 
     38    LEARNER = LinearSVMLearner(sover_type=LinearSVMLearner.L2R_L2LOSS) 
    4239    test_learner_on = test_learner_on 
    4340 
    4441@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS) 
    45 class TestLinearLearnerL1R_L2LOSS(testing.LearnerTestCase): 
    46     LEARNER = LinearLearner(sover_type=LinearLearner.L1R_L2LOSS) 
     42class TestLinearSVMLearnerL1R_L2LOSS(testing.LearnerTestCase): 
     43    LEARNER = LinearSVMLearner(sover_type=LinearSVMLearner.L1R_L2LOSS) 
    4744    test_learner_on = test_learner_on 
    4845 
    4946@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS) 
    50 class TestLinearLearnerL1R_L2LOSS(testing.LearnerTestCase): 
    51     LEARNER = LinearLearner(sover_type=LinearLearner.MCSVM_CS) 
     47class TestLinearSVMLearnerL1R_L2LOSS(testing.LearnerTestCase): 
     48    LEARNER = LinearSVMLearner(sover_type=LinearSVMLearner.MCSVM_CS) 
    5249    test_learner_on = test_learner_on 
    5350 
Note: See TracChangeset for help on using the changeset viewer.