All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jpmml.evaluator.RuleClassificationMap Maven / Gradle / Ivy

There is a newer version: 1.6.11
Show newest version
/*
 * Copyright (c) 2013 University of Tartu
 */
package org.jpmml.evaluator;

import org.dmg.pmml.*;

class RuleClassificationMap extends EntityClassificationMap implements HasConfidence {

	RuleClassificationMap(){
		super(Type.CONFIDENCE);
	}

	RuleClassificationMap(SimpleRule rule){
		super(Type.CONFIDENCE, rule);
	}

	@Override
	public String getResult(){
		SimpleRule rule = getEntity();

		if(rule != null){
			return rule.getScore();
		}

		return super.getResult();
	}

	@Override
	public Double getConfidence(String value){
		Type type = getType();

		if(!(Type.CONFIDENCE).equals(type)){
			throw new EvaluationException();
		}

		return getFeature(value);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy