-
Notifications
You must be signed in to change notification settings - Fork 117
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
Disambiguating the output fields of multi-output models (example: The value for field "probability(0)" has already been defined
)
#184
Comments
The value for field "probability(0)" has already been defined
)
This is a conversion-side issue, therefore moving it to the JPMML-SkLearn project (from the JPMML-Evaluator-Python project).
In brief, you're trying to train a multi-decision tree classifier. The default "schema" for decision tree classifiers has two components - the target field (eg. The problem with multi-decision tree classifiers is that the same field name gets declared many times. The correct would be to generate a new and unique field name for each classifier. For example, we could add some "model index" component to field names. For example, if your multi-classifier contains two elementary classifiers, then we could use identifiers such as "first" and "second" to make a distinction between them:
|
As a quick workaround, open the PMML file in text editor, and add the missing "identifiers" manually. |
Alternatively, if you're not interested in the predicted probability distribution, then you many manually delete Your target field names are already unique (ie. It would therefore make sense to disambiguate output field names using the following pattern |
Thank you very much. Your solution was effective and it solved my problem. May I ask if there are any other methods to achieve this goal by modifying parameters?
|
This is the relevant portion of JPMML-SkLearn source code: The problem is that the The solution would be to send some kind of "context hint", which would then activate a different output field naming pattern. Additionally, there could be another hint for disabling the generation of output fields in "multi output mode". So many potential solutions, will need to think a little which one is the easiest & most long-lasting one (before the actual implementation happens). Anyway, looks like an interesting/high priority issue, which should be addressed already in the next version. |
See also jpmml/sklearn2pmml#361
See also #180
Yep, we definitely have a cluster of related issues in this area. |
Ah, it's really an interesting question. I'm looking forward to your updates. Although I'm not very proficient yet, I will try your suggestions. Also, thank you very much for your patient explanations. You are really a kind person. |
My requirement is to load a multi-output classification model. I tried to understand the issue. It occurs because there are three categories of output, and each category has a probability value of 0. How can this be handled? I attempted to assign names to "y" (y1, y2, y3), but this seems to have no effect.
My code is as follows:
And I get the error message is as follows, :
How can I solve this issue? Do you have any good suggestions?Thank you very much!
The text was updated successfully, but these errors were encountered: