'How to create a scorecard in PMML while using decimal values or negative values as input?
following https://dmg.org/pmml/v4-1/Scorecard.html
and specifically https://www.smartdatacollective.com/25091/
I am building a scorecard model. When I use it with jpmml evaluator I get no result if the MiningSchema contains either negative or decimal input variables.
Below is a snapshot of the file:
?xml version='1.0' encoding='UTF-8'?>
<PMML version="4.4.1" xmlns="http://www.dmg.org/PMML-4_4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dmg.org/PMML-4_4 http://www.dmg.org/pmml/v4-4/pmml-4-4.xsd">
<DataDictionary numberOfFields="10">
<DataField name="LOAN_GRADE" optype="categorical" dataType="string"/>
<DataField name="LOAN_INTEREST_RATE" optype="continuous" dataType="double"/>
[...]
</DataDictionary>
<Scorecard modelName="scorecard_Model" functionName="regression" useReasonCodes="true" reasonCodeAlgorithm="pointsAbove" initialScore="0" baselineMethod="other">
<MiningSchema>
<MiningField name="LOAN_GRADE" usageType="active" missingValueReplacement="asMissing" invalidValueTreatment="asMissing"/>
<MiningField name="LOAN_INTEREST_RATE" usageType="active" missingValueReplacement="asMissing" invalidValueTreatment="asMissing"/>
[...]
</MiningSchema>
<Output>
<OutputField name="FinalScore" optype="continuous" dataType="double" feature="predictedValue"/>
<OutputField name="RC_001" optype="categorical" dataType="string" feature="reasonCode" rank="1"/>
<OutputField name="RC_002" optype="categorical" dataType="string" feature="reasonCode" rank="2"/>
[...]
</Output>
<Characteristics>
<Characteristic name="LOAN_GRADE" baselineScore="0">
<Attribute partialScore="0" reasonCode="0">
<SimplePredicate field="LOAN_GRADE" operator="isMissing"/>
</Attribute>
<Attribute partialScore="0" reasonCode="0">
<SimplePredicate field="LOAN_GRADE" operator="isNotMissing"/>
</Attribute>
<Attribute partialScore="1" reasonCode="1">
<SimplePredicate field="LOAN_GRADE" operator="equal" value="D"/>
</Attribute>
<Attribute partialScore="0.627740326307014" reasonCode="0.6">
[...]
<Characteristic name="LOAN_INTEREST_RATE" baselineScore="0">
<Attribute partialScore="0" reasonCode="0">
<SimplePredicate field="LOAN_INTEREST_RATE" operator="isMissing"/>
</Attribute>
<Attribute partialScore="0" reasonCode="0">
<SimplePredicate field="LOAN_INTEREST_RATE" operator="isNotMissing"/>
</Attribute>
<Attribute partialScore="1" reasonCode="1">
<CompoundPredicate booleanOperator="and">
<SimplePredicate field="LOAN_INTEREST_RATE" operator="greaterThan" value="14.09"/>
<SimplePredicate field="LOAN_INTEREST_RATE" operator="lessThan" value="23.22"/>
</CompoundPredicate>
</Attribute>
[...]
So my question is if this is an expected behavior? I did not find references in the documentation. Which alternative method can I use to implement scorecards in PMML?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
