Ignore:
Timestamp:
03/02/12 16:56:57 (2 years ago)
Author:
anzeh <anze.staric@…>
Branch:
default
Message:

Fixed some backward compatibility issues.

File:
1 edited

Legend:

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

    r10426 r10429  
    186186        self.assertIsInstance(scores, list) 
    187187 
     188    def test_with_confusion_matrices_on_biclass(self): 
     189        learner = random_learner 
     190        ds = data.Table("monks-1") 
     191        pt = testing.proportion_test([learner], ds, times=1) 
     192        cm = scoring.confusion_matrices(pt, class_index=1) 
     193        scores = self.score(cm) 
     194        self.assertIsInstance(scores, list) 
     195 
     196    def test_with_confusion_matrices_on_multiclass(self): 
     197        learner = random_learner 
     198        ds = data.Table("iris") 
     199        pt = testing.proportion_test([learner], ds, times=1) 
     200        cm = scoring.confusion_matrices(pt, class_index=1) 
     201        scores = self.score(cm) 
     202        self.assertIsInstance(scores, list) 
     203 
    188204    def test_with_confusion_matrix_on_biclass(self): 
    189205        learner = random_learner 
     
    191207        pt = testing.proportion_test([learner], ds, times=1) 
    192208        cm = scoring.confusion_matrices(pt, class_index=1) 
    193         scores = self.score(cm) 
    194         self.assertIsInstance(scores, list) 
     209        scores = self.score(cm[0]) 
     210        self.assertIsInstance(scores, float) 
    195211 
    196212    def test_with_confusion_matrix_on_multiclass(self): 
     
    199215        pt = testing.proportion_test([learner], ds, times=1) 
    200216        cm = scoring.confusion_matrices(pt, class_index=1) 
    201         scores = self.score(cm) 
    202         self.assertIsInstance(scores, list) 
     217        scores = self.score(cm[0]) 
     218        self.assertIsInstance(scores, float) 
     219 
    203220 
    204221class TestSensitivity(CMScoreTest, unittest.TestCase): 
Note: See TracChangeset for help on using the changeset viewer.