Ejemplo n.º 1
0
    def test_retrieve_nonexistent_file(self):
        fake_file = 'nonexistentfile.data'

        r = Retriever(fake_file)

        with self.assertRaises(errors.RetrieverError):
            r.load()
Ejemplo n.º 2
0
    def test_retrieve_brainwave(self):
        retriever = Retriever('datasets/brainwave/plrx.txt', target_column=-1)

        data, target = retriever.load().split_target().retrieve()

        # Assert number of samples.
        self.assertEqual(182, len(data))

        # Assert number of features.
        self.assertEqual(12, len(data[1]))

        # Assert number of samples in target array.
        self.assertEqual(182, len(target))