Beispiel #1
0
    def test_results(self):
        iris = Table("iris")
        state = Mock()
        state.is_interruption_requested = Mock(return_value=False)
        res = run(iris, LocalOutlierFactorLearner(), state)
        self.assertIsInstance(res.inliers, Table)
        self.assertIsInstance(res.outliers, Table)
        self.assertIsInstance(res.annotated_data, Table)

        self.assertEqual(iris.domain, res.inliers.domain)
        self.assertEqual(iris.domain, res.outliers.domain)
        self.assertIn("Outlier", res.annotated_data.domain)

        self.assertEqual(len(res.inliers), 145)
        self.assertEqual(len(res.outliers), 5)
        self.assertEqual(len(res.annotated_data), 150)
Beispiel #2
0
 def test_no_data(self):
     res = run(None, LocalOutlierFactorLearner(), Mock())
     self.assertIsNone(res.inliers)
     self.assertIsNone(res.outliers)
     self.assertIsNone(res.annotated_data)