当前位置: 首页>>代码示例>>Java>>正文


Java Scorecard类代码示例

本文整理汇总了Java中org.dmg.pmml.scorecard.Scorecard的典型用法代码示例。如果您正苦于以下问题:Java Scorecard类的具体用法?Java Scorecard怎么用?Java Scorecard使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Scorecard类属于org.dmg.pmml.scorecard包,在下文中一共展示了Scorecard类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: inspectTypeAnnotations

import org.dmg.pmml.scorecard.Scorecard; //导入依赖的package包/类
@Test
public void inspectTypeAnnotations(){
	PMML pmml = createPMML();

	assertVersionRange(pmml, Version.PMML_3_0, Version.PMML_4_3);

	pmml.addModels(new AssociationModel(),
		//new ClusteringModel(),
		//new GeneralRegressionModel(),
		//new MiningModel(),
		new NaiveBayesModel(),
		new NeuralNetwork(),
		new RegressionModel(),
		new RuleSetModel(),
		new SequenceModel(),
		//new SupportVectorMachineModel(),
		new TextModel(),
		new TreeModel());

	assertVersionRange(pmml, Version.PMML_3_0, Version.PMML_4_3);

	pmml.addModels(new TimeSeriesModel());

	assertVersionRange(pmml, Version.PMML_4_0, Version.PMML_4_3);

	pmml.addModels(new BaselineModel(),
		new Scorecard(),
		new NearestNeighborModel());

	assertVersionRange(pmml, Version.PMML_4_1, Version.PMML_4_3);

	pmml.addModels(new BayesianNetworkModel(),
		new GaussianProcessModel());

	assertVersionRange(pmml, Version.PMML_4_3, Version.PMML_4_3);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:37,代码来源:VersionInspectorTest.java

示例2: ScorecardEvaluator

import org.dmg.pmml.scorecard.Scorecard; //导入依赖的package包/类
public ScorecardEvaluator(PMML pmml, Scorecard scorecard){
	super(pmml, scorecard);

	Characteristics characteristics = scorecard.getCharacteristics();
	if(characteristics == null){
		throw new MissingElementException(scorecard, PMMLElements.SCORECARD_CHARACTERISTICS);
	} // End if

	if(!characteristics.hasCharacteristics()){
		throw new MissingElementException(characteristics, PMMLElements.CHARACTERISTICS_CHARACTERISTICS);
	}
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:13,代码来源:ScorecardEvaluator.java

示例3: evaluate

import org.dmg.pmml.scorecard.Scorecard; //导入依赖的package包/类
@Override
public Map<FieldName, ?> evaluate(ModelEvaluationContext context){
	Scorecard scorecard = ensureScorableModel();

	ValueFactory<?> valueFactory;

	MathContext mathContext = scorecard.getMathContext();
	switch(mathContext){
		case FLOAT:
		case DOUBLE:
			valueFactory = getValueFactory();
			break;
		default:
			throw new UnsupportedAttributeException(scorecard, mathContext);
	}

	Map<FieldName, ?> predictions;

	MiningFunction miningFunction = scorecard.getMiningFunction();
	switch(miningFunction){
		case REGRESSION:
			predictions = evaluateRegression(valueFactory, context);
			break;
		case ASSOCIATION_RULES:
		case SEQUENCES:
		case CLASSIFICATION:
		case CLUSTERING:
		case TIME_SERIES:
		case MIXED:
			throw new InvalidAttributeException(scorecard, miningFunction);
		default:
			throw new UnsupportedAttributeException(scorecard, miningFunction);
	}

	return OutputUtil.evaluate(predictions, context);
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:37,代码来源:ScorecardEvaluator.java

示例4: visit

import org.dmg.pmml.scorecard.Scorecard; //导入依赖的package包/类
@Override
public VisitorAction visit(Scorecard scorecard){
	return visit((Model)scorecard);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:5,代码来源:AbstractModelVisitor.java

示例5: createModelEvaluator

import org.dmg.pmml.scorecard.Scorecard; //导入依赖的package包/类
private ModelEvaluator<? extends Model> createModelEvaluator(PMML pmml, Model model){

		if(model instanceof AssociationModel){
			return new AssociationModelEvaluator(pmml, (AssociationModel)model);
		} else

		if(model instanceof ClusteringModel){
			 return new ClusteringModelEvaluator(pmml, (ClusteringModel)model);
		} else

		if(model instanceof GeneralRegressionModel){
			return new GeneralRegressionModelEvaluator(pmml, (GeneralRegressionModel)model);
		} else

		if(model instanceof MiningModel){
			return new MiningModelEvaluator(pmml, (MiningModel)model);
		} else

		if(model instanceof NaiveBayesModel){
			return new NaiveBayesModelEvaluator(pmml, (NaiveBayesModel)model);
		} else

		if(model instanceof NearestNeighborModel){
			return new NearestNeighborModelEvaluator(pmml, (NearestNeighborModel)model);
		} else

		if(model instanceof NeuralNetwork){
			return new NeuralNetworkEvaluator(pmml, (NeuralNetwork)model);
		} else

		if(model instanceof RegressionModel){
			return new RegressionModelEvaluator(pmml, (RegressionModel)model);
		} else

		if(model instanceof RuleSetModel){
			return new RuleSetModelEvaluator(pmml, (RuleSetModel)model);
		} else

		if(model instanceof Scorecard){
			return new ScorecardEvaluator(pmml, (Scorecard)model);
		} else

		if(model instanceof SupportVectorMachineModel){
			return new SupportVectorMachineModelEvaluator(pmml, (SupportVectorMachineModel)model);
		} else

		if(model instanceof TreeModel){
			return new TreeModelEvaluator(pmml, (TreeModel)model);
		} // End if

		if(model instanceof JavaModel){
			return new JavaModelEvaluator(pmml, (JavaModel)model);
		}

		throw new UnsupportedElementException(model);
	}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:57,代码来源:ModelEvaluatorFactory.java


注:本文中的org.dmg.pmml.scorecard.Scorecard类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。