Skip to content

Support for multi-output tree models and their ensembles #470

@fritshermans

Description

@fritshermans

Hi Villu,

I'm a very happy user of your package. This time I wanted to convert a trained multilabel RandomForestClassifier instance to PMML. Let me show you a minimal example to reproduce the error (sklearn2pmml 0.129.2, sklearn 1.7.2):

from sklearn.datasets import make_multilabel_classification
from sklearn.ensemble import RandomForestClassifier

X, y = make_multilabel_classification()

clf = RandomForestClassifier().fit(X,y)

sklearn2pmml(clf, "clf.pmml")

I get the following error:

Exception in thread "main" java.lang.ClassCastException: class org.jpmml.converter.MultiLabel cannot be cast to class org.jpmml.converter.CategoricalLabel (org.jpmml.converter.MultiLabel and org.jpmml.converter.CategoricalLabel are in unnamed module of loader 'app')

Is there something that I do wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions