def test_classify_no_array_throws_exception(self): wrapper = SklearnModelWrapper(self.compliant_object) self.assertRaises(TypeError, wrapper.classify, 12)
def test_classify_invalid_input_throws_exception(self): wrapper = SklearnModelWrapper(self.compliant_object) self.assertRaises(SklearnInternalError, wrapper.classify, np.zeros(100))
def test_regular_model_load_ok(self): wrapper = SklearnModelWrapper(self.compliant_object) wrapper.load(self.test_model_path) self.assertTrue(True)
def test_load_no_regular_file_passed_throws_not_exists_exception(self): wrapper = SklearnModelWrapper(self.compliant_object) self.assertRaises(FileNotFoundError, wrapper.load, "not exists")
def test_load_no_string_passed_throws_exception(self): wrapper = SklearnModelWrapper(self.compliant_object) self.assertRaises(TypeError, wrapper.load, 12)
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())
def test_extract_features_no_array_throws_exception(self): wrapper = SklearnModelWrapper(self.test_sklearn_model) self.assertRaises(TypeError, wrapper.extract_features, 12)