コード例 #1
0
 def test_classify_no_array_throws_exception(self):
     wrapper = SklearnModelWrapper(self.compliant_object)
     self.assertRaises(TypeError, wrapper.classify, 12)
コード例 #2
0
 def test_classify_invalid_input_throws_exception(self):
     wrapper = SklearnModelWrapper(self.compliant_object)
     self.assertRaises(SklearnInternalError, wrapper.classify, np.zeros(100))
コード例 #3
0
 def test_regular_model_load_ok(self):
     wrapper = SklearnModelWrapper(self.compliant_object)
     wrapper.load(self.test_model_path)
     self.assertTrue(True)
コード例 #4
0
 def test_load_no_regular_file_passed_throws_not_exists_exception(self):
     wrapper = SklearnModelWrapper(self.compliant_object)
     self.assertRaises(FileNotFoundError, wrapper.load, "not exists")
コード例 #5
0
 def test_load_no_string_passed_throws_exception(self):
     wrapper = SklearnModelWrapper(self.compliant_object)
     self.assertRaises(TypeError, wrapper.load, 12)
コード例 #6
0
 def test_extract_features_ok(self):
     wrapper = SklearnModelWrapper(self.compliant_object)
     feat_vector = wrapper.extract_features(self.test_sample)
     self.assertTrue((feat_vector == self.test_sample).all())
コード例 #7
0
 def test_extract_features_no_array_throws_exception(self):
     wrapper = SklearnModelWrapper(self.test_sklearn_model)
     self.assertRaises(TypeError, wrapper.extract_features, 12)