Browse Source

fix unit-test, TODO: prediction_score

master
lhenry15 4 years ago
parent
commit
47cfe1fac7
2 changed files with 7 additions and 7 deletions
  1. +5
    -5
      tods/tests/detection_algorithm/test_AutoRegODetect.py
  2. +2
    -2
      tods/tests/detection_algorithm/test_LSTMODetector.py

+ 5
- 5
tods/tests/detection_algorithm/test_AutoRegODetect.py View File

@@ -31,7 +31,7 @@ class AutoRegODetectTestCase(unittest.TestCase):
self.y_train = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) self.y_train = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
self.X_test = d3m_dataframe({'data': [3., 4., 8.6, 13.4, 22.5, 17, 19.2, 36.1, 127, -23, 59.2]}, self.X_test = d3m_dataframe({'data': [3., 4., 8.6, 13.4, 22.5, 17, 19.2, 36.1, 127, -23, 59.2]},
columns=['data'], generate_metadata=True) columns=['data'], generate_metadata=True)
self.y_test = np.array([0, 0, 0, 0, 0, 0, 0, 0, 1])
self.y_test = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0])






@@ -70,7 +70,7 @@ class AutoRegODetectTestCase(unittest.TestCase):
'dimension': { 'dimension': {
'name': 'rows', 'name': 'rows',
'semantic_types': ['https://metadata.datadrivendiscovery.org/types/TabularRow'], 'semantic_types': ['https://metadata.datadrivendiscovery.org/types/TabularRow'],
'length': 9,
'length': 11,
}, },
}, },
}, { }, {
@@ -87,21 +87,21 @@ class AutoRegODetectTestCase(unittest.TestCase):
'metadata': { 'metadata': {
'name': 'AutoRegODetector0_0', 'name': 'AutoRegODetector0_0',
'semantic_types': ['https://metadata.datadrivendiscovery.org/types/Attribute'], 'semantic_types': ['https://metadata.datadrivendiscovery.org/types/Attribute'],
'structural_type': 'numpy.int64',
'structural_type': 'numpy.float64',
}, },
}, { }, {
'selector': ['__ALL_ELEMENTS__', 1], 'selector': ['__ALL_ELEMENTS__', 1],
'metadata': { 'metadata': {
'name': 'AutoRegODetector0_1', 'name': 'AutoRegODetector0_1',
'semantic_types': ['https://metadata.datadrivendiscovery.org/types/Attribute'], 'semantic_types': ['https://metadata.datadrivendiscovery.org/types/Attribute'],
'structural_type': 'numpy.int64',
'structural_type': 'numpy.float64',
}, },
}, { }, {
'selector': ['__ALL_ELEMENTS__', 2], 'selector': ['__ALL_ELEMENTS__', 2],
'metadata': { 'metadata': {
'name': 'AutoRegODetector0_2', 'name': 'AutoRegODetector0_2',
'semantic_types': ['https://metadata.datadrivendiscovery.org/types/Attribute'], 'semantic_types': ['https://metadata.datadrivendiscovery.org/types/Attribute'],
'structural_type': 'numpy.int64',
'structural_type': 'numpy.float64',
}, },
}]) }])




+ 2
- 2
tods/tests/detection_algorithm/test_LSTMODetector.py View File

@@ -30,7 +30,7 @@ class LSTMODTestCase(unittest.TestCase):
self.y_train = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) self.y_train = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
self.X_test = d3m_dataframe({'data': [3., 4., 8.6, 13.4, 22.5, 17, 19.2, 36.1, 127, -23, 59.2]}, self.X_test = d3m_dataframe({'data': [3., 4., 8.6, 13.4, 22.5, 17, 19.2, 36.1, 127, -23, 59.2]},
columns=['data'], generate_metadata=True) columns=['data'], generate_metadata=True)
self.y_test = np.array([0, 0, 0, 0, 0, 0, 0, 0, 1, 0])
self.y_test = np.array([0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0])






@@ -66,7 +66,7 @@ class LSTMODTestCase(unittest.TestCase):
'dimension': { 'dimension': {
'name': 'rows', 'name': 'rows',
'semantic_types': ['https://metadata.datadrivendiscovery.org/types/TabularRow'], 'semantic_types': ['https://metadata.datadrivendiscovery.org/types/TabularRow'],
'length': 10,
'length': 11,
}, },
}, },
}, { }, {


Loading…
Cancel
Save