I'm trying to create a PMML from a model, using this way :
from sklearn.preprocessing import LabelEncoder
y_h_train = LabelEncoder().fit_transform(y_train.copy(deep=True))
modele_label_encoded = model.fit(X_train, y_h_train)
import sklearn2pmml as skpmml
from sklearn2pmml import PMMLPipeline, sklearn2pmml
cols_used = list(X_train.columns)
pmml_model = skpmml.make_pmml_pipeline(modele_label_encoded)
pmml_model.active_fields = cols_used
pmml_model.target_fields = ['Traget']
skpmml.sklearn2pmml(pmml_model, os.path.join('test.pmml'), debug=True)
And the PMML seems not to understand the classes_ :
Exception in thread "main" java.lang.IllegalArgumentException: The value of 'xgboost.sklearn.XGBClassifier.classes_' attribute (null) is not a supported array type
I don't understand the error since my classes_ has an array type, as requested :
modele_label_encoded.classes_
Output : array([0, 1])
I found no post about this error, does someone know how to solve it?