jpmml / jpmml-evaluator-python

PMML evaluator library for Python
GNU Affero General Public License v3.0
20 stars 9 forks source link

Reporting of PMML #12

Closed axemixer closed 3 years ago

axemixer commented 3 years ago

When I try to extract report of pmml with below link and follow all instraction , It gives me the results final probability values only. Is there something I miss?

https://openscoring.io/blog/2019/02/26/jpmml_evaluator_api_tracing_reporting_predictions/

My result: {'Adjusted': 0, 'probability(0)': 0.8911293745040894, 'probability(1)': 0.10887060314416885}

vruusmann commented 3 years ago

https://openscoring.io/blog/2019/02/26/jpmml_evaluator_api_tracing_reporting_predictions/

Go to the resources section and download report.py and XGBoostAudit-reporting.pmml files.

Then run report.py using Python interpreter:

$ python3.7 report.py

What do you see?

I see the following (which is the intended result):

{'Age': 38, 'Employment': 'Private', 'Education': 'College', 'Marital': 'Unmarried', 'Occupation': 'Service', 'Income': 81838, 'Gender': 'Female', 'Deductions': False, 'Hours': 72}
{'Adjusted': 0, 'ref(report(xgbValue))': '<math xmlns="http://www.w3.org/1998/Math/MathML"><apply><plus/><cn>-0.17968129</cn><cn>-0.16313718</cn><cn>-0.15570186</cn><cn>-0.14460582</cn><cn>-0.13957009</cn><cn>-0.12399502</cn><cn>-0.12931323</cn><cn>-0.12063908</cn><cn>-0.11913132</cn><cn>-0.11191886</cn><cn>-0.11103699</cn><cn>-0.110534586</cn><cn>-0.101101674</cn><cn>-0.104573585</cn><cn>-0.09484299</cn><cn>-0.095708475</cn><cn>-0.09683787</cn></apply></math>', 'probability(0)': 0.8911293745040894, 'probability(1)': 0.10887060314416885, 'report(probability(0))': '<math xmlns="http://www.w3.org/1998/Math/MathML"><apply><minus/><cn>1</cn><cn>0.1088706</cn></apply></math>', 'report(probability(1))': '<math xmlns="http://www.w3.org/1998/Math/MathML"><apply><apply><inverse/><ci>logit</ci></apply><apply><times/><cn>1.0</cn><cn>-2.1023297</cn></apply></apply></math>'}
axemixer commented 3 years ago

Yes you are right. I just forget about editting and insterting new lines to pmml in order to extract editional output.

Thanks