Comments (4)
Is that your interpretation of the spec?
max: consider the model(s) that have contributed the chosen probability for the winning category. Return their average probabilities;
The max
multiple model method is pertinent to the MiningModel
element, when the "member" model elements are returning probability distributions (ie. instances of HasProbabilityDistribution
):
https://github.com/jpmml/jpmml-evaluator/blob/master/pmml-evaluator/src/main/java/org/jpmml/evaluator/mining/MiningModelEvaluator.java#L702
And I think the following is a correct implementation of the spec:
https://github.com/jpmml/jpmml-evaluator/blob/master/pmml-evaluator/src/main/java/org/jpmml/evaluator/ProbabilityAggregator.java#L96
{a: 0.45, b: 0.1, c: 0.45}
. Will the implementation linked to above return that?
Here are my unit tests:
https://github.com/jpmml/jpmml-evaluator/blob/master/pmml-evaluator/src/test/java/org/jpmml/evaluator/ProbabilityAggregatorTest.java#L33
The important detail is that the tie resolution is a two step process. First, if there is more than one winner, then you compute the average of their probability distributions. Second, if there is still more than winner (eg. categories a
and c
still have a probability value of 0.45
), then the result is the first category (as determined by the ordering of /PMML/DataDictionary/DataField/Value
elements).
Feel free to implement your question as another unit test, and run it.
from jpmml-evaluator.
thanks for the quick response! is this tie resolution specific to your implementation, or do you think the spec outlines this?
from jpmml-evaluator.
Is this tie resolution specific to your implementation, or do you think the spec outlines this?
This comes from the PMML spec. I can't pinpoint the exact quote at the moment, but you can find this "theme" repeated over and over when the spec is detailing classification-type models.
The JPMML-Evaluator library is very careful about maintaining the insertion order of values when constructing result objects. For example, that's the reason why field org.jpmml.evaluator.Classification#map
is java.util.LinkedHashMap
(and not java.util.HashMap
):
https://github.com/jpmml/jpmml-evaluator/blob/master/pmml-evaluator/src/main/java/org/jpmml/evaluator/Classification.java#L60
from jpmml-evaluator.
ok thanks for the info, I will dig to find that! Really appreciate your quick responses 😄
from jpmml-evaluator.
Related Issues (20)
- How to work with an association rules model (`AssociationModel` element)? HOT 8
- JPMML is enforcing the definition of target fields while the spec says it is optional HOT 6
- jpmml-evaluator does not handle null values when used in java? HOT 1
- Ability to run multiple JPMML-Evaluator versions in parallel (inside the same JVM) HOT 1
- NumberFormatException for evaluate "Random Survival Forest Model" generated by "SoftwareAG PMML Generator" HOT 3
- Compatibility with GraalVM HOT 12
- Not happy with XGBoost evaluation performance HOT 3
- How to load pre-transpiled PMML service provider JAR files? HOT 2
- Model verification fails for XGBoost models HOT 1
- No class def found for jakarta/xml/bind/JAXBContext HOT 3
- java.lang.IllegalArgumentException: Name cannot be empty HOT 1
- java.lang.NoClassDefFoundError: Could not initialize class org.jpmml.evaluator.FieldUtil HOT 4
- If the version 1.6.4 could work on java 8? HOT 1
- Field pmml(pred) is not defined. HOT 5
- DuplicatedFieldValueException after loading PMML in Java generated by Nyoka HOT 8
- 1.6.4 cannot run on java 8
- Exception: Required attribute `Segmentation@multipleModelMethod` is not defined HOT 3
- Updating Guava dependency to latest HOT 4
- why create jar file create error HOT 1
- LoadingModelEvaluatorBuilder not usable on Android due to "java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/Image" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpmml-evaluator.