iamDecode / sklearn-pmml-model

A library to parse and convert PMML models into Scikit-learn estimators.
BSD 2-Clause "Simplified" License
76 stars 15 forks source link

PMMLForestClassifier not generating a pmml attribute #48

Open cornejom opened 1 year ago

cornejom commented 1 year ago

Description

The Random Forest example in the main README.md file fails. More specifically, the last two commands fail:

clf.predict(Xte)
clf.score(Xte, yte)

Steps/Code to Reproduce

I simply ran the example. The error messages for the last two commands both end in:

File "\lib\site-packages\sklearn_pmml_model\base.py", line 159, in _prepare_data raise Exception('The features in the input data do not match features expected by the PMML model.') Exception: The features in the input data do not match features expected by the PMML model.

I then checked the value of the classifier with print(clf). It seemed to have a missing attribute, giving error message ending in:

File "\lib\site-packages\sklearn\base.py", line 170, in get_params value = getattr(self, key) AttributeError: 'PMMLForestClassifier' object has no attribute 'pmml'

I also noticed the following, but not sure if it's related to the problem. clf.base_estimator

'deprecated'

Versions

Windows-10-10.0.14393-SP0 Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] NumPy 1.23.0 SciPy 1.8.1 Scikit-Learn 1.2.1 sklearn-pmml-model 1.0.1