Skip to content
Snippets Groups Projects
Commit bd4bed84 authored by Marco Biasini's avatar Marco Biasini
Browse files

fix table unit tests when numpy is not installed on system

parent 1f1365d3
Branches
Tags
No related merge requests found
...@@ -1147,6 +1147,8 @@ class TestTable(unittest.TestCase): ...@@ -1147,6 +1147,8 @@ class TestTable(unittest.TestCase):
self.assertEquals(auc, None) self.assertEquals(auc, None)
def testCalcROCFromFile(self): def testCalcROCFromFile(self):
if not HAS_NUMPY:
return
tab = Table.Load(os.path.join('testfiles','roc_table.dat')) tab = Table.Load(os.path.join('testfiles','roc_table.dat'))
auc = tab.ComputeROCAUC(score_col='prediction', class_col='reference', class_cutoff=0.4) auc = tab.ComputeROCAUC(score_col='prediction', class_col='reference', class_cutoff=0.4)
self.assertEquals(auc, 1.0) self.assertEquals(auc, 1.0)
...@@ -1195,6 +1197,8 @@ class TestTable(unittest.TestCase): ...@@ -1195,6 +1197,8 @@ class TestTable(unittest.TestCase):
self.assertAlmostEquals(mcc, 0.882089673321) self.assertAlmostEquals(mcc, 0.882089673321)
def testTableAsNumpyMatrix(self): def testTableAsNumpyMatrix(self):
if not HAS_NUMPY:
return
''' '''
checks numpy matrix checks numpy matrix
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment