Giter VIP home page Giter VIP logo

Comments (4)

vruusmann avatar vruusmann commented on August 18, 2024 1

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.

infiton avatar infiton commented on August 18, 2024

thanks for the quick response! is this tie resolution specific to your implementation, or do you think the spec outlines this?

from jpmml-evaluator.

vruusmann avatar vruusmann commented on August 18, 2024

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.

infiton avatar infiton commented on August 18, 2024

ok thanks for the info, I will dig to find that! Really appreciate your quick responses 😄

from jpmml-evaluator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.