Search code examples
restpmml

What should be the input to the pmml file while using jpmml openscoring REST api


I am currently using jpmml openscoring REST API...https://github.com/jpmml/openscoring

I have successfully installed the openscoring REST api and hosted my rules.pmml file in a local Tomcat server.

my pmml file is very similar to the example pmml file given here: http://www.dmg.org/v4-1/AssociationRules.html

Now to get the output, I have to give a .json object or a .csv file as an input. But how should the .json object look like. Can anyone provide me an example input json object for the pmml model given in the above link. I tried giving .csv file as input but, I am getting a 500 error and a warning which says Evaluation request xxx does not specify a group field transaction.


Solution

  • The Openscoring service comes with two examples:

    • Decision tree model for the Iris dataset: openscoring-service/src/test/resources/pmml/DecisionTreeIris.pmml
    • Association rules model for the Shopping dataset: openscoring-service/src/test/resources/pmml/AssociationRulesShopping.pmml

    If you want to use the CSV evaluation endpoint then your CSV file should contain exactly two columns:

    • Group-by column (aka "Transaction Id" column aka "Basket Id" column)
    • Active column (aka "Product Id" column)

    For a real-life example, see openscoring-service/src/test/resources/csv/Shopping.csv