Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMMLForestClassifier not generating a pmml attribute #48

Closed
cornejom opened this issue Feb 8, 2023 · 1 comment
Closed

PMMLForestClassifier not generating a pmml attribute #48

cornejom opened this issue Feb 8, 2023 · 1 comment

Comments

@cornejom
Copy link

cornejom commented Feb 8, 2023

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 "<my_path>\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 "<my_path>\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

@iamDecode
Copy link
Owner

Sorry for missing this issue. Quite a while back I addressed this issue, and all examples work fine atm. This was likely due to the project not being cythonized in a local environment. If this happens again, you can try python setup.py build_ext --inplace to ensure the cythonized files are build and placed in the right directory. Since this issue is stale and likely already fixed, im closing this issue. If this is somehow still an issue please open a new issue for it :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants