Код: Выделить всё
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)
Код: Выделить всё
Exception in thread "main" java.lang.IllegalArgumentException: The value of 'xgboost.sklearn.XGBClassifier.classes_' attribute (null) is not a supported array type
Код: Выделить всё
modele_label_encoded.classes_
Output : array([0, 1])
Подробнее здесь: https://stackoverflow.com/questions/798 ... -parameter
Мобильная версия