Search in sources :

Example 6 with TargetValue

use of org.dmg.pmml.TargetValue in project shifu by ShifuML.

the class NNPmmlModelCreator method createMultiClassTargets.

private List<Target> createMultiClassTargets() {
    List<Target> targets = new ArrayList<Target>();
    for (int i = 0; i < modelConfig.getTags().size(); i++) {
        String tag = modelConfig.getTags().get(i);
        Target target = new Target();
        target.setOpType(OpType.CONTINUOUS);
        target.setField(new FieldName(modelConfig.getTargetColumnName() + "_" + i));
        TargetValue targetValue = new TargetValue();
        targetValue.setValue(Integer.toString(i));
        targetValue.setDisplayValue(tag);
        target.addTargetValues(targetValue);
        targets.add(target);
    }
    return targets;
}
Also used : Target(org.dmg.pmml.Target) TargetValue(org.dmg.pmml.TargetValue) ArrayList(java.util.ArrayList) FieldName(org.dmg.pmml.FieldName)

Aggregations

TargetValue (org.dmg.pmml.TargetValue)6 ArrayList (java.util.ArrayList)4 FieldName (org.dmg.pmml.FieldName)4 Target (org.dmg.pmml.Target)4 Targets (org.dmg.pmml.Targets)3 Random (java.util.Random)1 Test (org.junit.Test)1 KiePMMLTargetValue (org.kie.pmml.commons.model.KiePMMLTargetValue)1 PMMLModelTestUtils.getRandomTargetValue (org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getRandomTargetValue)1 InstanceFactoriesTestCommon.commonVerifyKiePMMLTargetValue (org.kie.pmml.compiler.commons.factories.InstanceFactoriesTestCommon.commonVerifyKiePMMLTargetValue)1