You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading a PMML model with the following structure:
Regression > RegressionTable > NumericPredictor
I get the following error, when trying to import the model with:
clf = PMMLLinearRegression(pmml="filename.pmml")
Traceback (most recent call last):
File "test.py", line 23, in <module>
clf = PMMLLinearRegression(pmml="filename.pmml")
File "C:\Users\<user>\AppData\Local\Programs\Python\Python36\sklearn_pmml_model\linear_model\implementations.py", line 27, in __init__
super().__init__(pmml)
File "C:\Users\<user>\AppData\Local\Programs\Python\Python36\sklearn_pmml_model\linear_model\base.py", line 32, in __init__
for field in fields
File "C:\Users\<user>\AppData\Local\Programs\Python\Python36\sklearn_pmml_model\linear_model\base.py", line 33, in <listcomp>
if field.tag == 'DataField'
File "C:\Users\<user>\AppData\Local\Programs\Python\Python36\sklearn_pmml_model\linear_model\base.py", line 25, in encoder_for
encoder.categories_ = np.array([self.field_mapping[field.get('name')][1].categories])
File "C:\Users\<user>\AppData\Local\Programs\Python\Python36\lib\site-packages\cached_property.py", line 35, in __get__
value = obj.__dict__[self.func.__name__] = self.func(obj)
File "C:\Users\<user>\AppData\Local\Programs\Python\Python36\sklearn_pmml_model\base.py", line 61, in field_mapping
for name, e in fields.items()
File "C:\Users\<user>\AppData\Local\Programs\Python\Python36\sklearn_pmml_model\base.py", line 62, in <dictcomp>
if e.tag == 'DerivedField'
AttributeError: 'NoneType' object has no attribute 'get'
The text was updated successfully, but these errors were encountered:
Thanks for the feedback. Data pipeline operations like applying functions on fields are not yet supported. DerivedField is currently assumed to have a FieldRef, which is not mandatory. This s where the code fails. Properly supporting alternative expressions for DerivedField should be investigated.
When loading a PMML model with the following structure:
Regression > RegressionTable > NumericPredictor
I get the following error, when trying to import the model with:
clf = PMMLLinearRegression(pmml="filename.pmml")
The text was updated successfully, but these errors were encountered: