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


Java TreeModel.getMiningFunction方法代码示例

本文整理汇总了Java中org.dmg.pmml.tree.TreeModel.getMiningFunction方法的典型用法代码示例。如果您正苦于以下问题:Java TreeModel.getMiningFunction方法的具体用法?Java TreeModel.getMiningFunction怎么用?Java TreeModel.getMiningFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.dmg.pmml.tree.TreeModel的用法示例。


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

示例1: visit

import org.dmg.pmml.tree.TreeModel; //导入方法依赖的package包/类
@Override
public VisitorAction visit(Node node){
	TreeModel treeModel = getTreeModel();

	MiningFunction miningFunction = treeModel.getMiningFunction();
	switch(miningFunction){
		case REGRESSION:
			if(node.hasScoreDistributions()){
				List<ScoreDistribution> scoreDistributions = node.getScoreDistributions();

				scoreDistributions.clear();
			}
			break;
		default:
			break;
	}

	return super.visit(node);
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:20,代码来源:ScoreDistributionCleaner.java

示例2: visit

import org.dmg.pmml.tree.TreeModel; //导入方法依赖的package包/类
@Override
public VisitorAction visit(TreeModel treeModel){
	TreeModel.MissingValueStrategy missingValueStrategy = treeModel.getMissingValueStrategy();
	TreeModel.NoTrueChildStrategy noTrueChildStrategy = treeModel.getNoTrueChildStrategy();
	TreeModel.SplitCharacteristic splitCharacteristic = treeModel.getSplitCharacteristic();

	if(!(TreeModel.MissingValueStrategy.NONE).equals(missingValueStrategy) || !(TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION).equals(noTrueChildStrategy) || !(TreeModel.SplitCharacteristic.BINARY_SPLIT).equals(splitCharacteristic)){
		throw new IllegalArgumentException();
	}

	treeModel
		.setMissingValueStrategy(TreeModel.MissingValueStrategy.NULL_PREDICTION)
		.setSplitCharacteristic(TreeModel.SplitCharacteristic.MULTI_SPLIT);

	MiningFunction miningFunction = treeModel.getMiningFunction();
	switch(miningFunction){
		case REGRESSION:
			treeModel.setNoTrueChildStrategy(TreeModel.NoTrueChildStrategy.RETURN_LAST_PREDICTION);
			break;
		case CLASSIFICATION:
			break;
		default:
			throw new IllegalArgumentException();
	}

	return super.visit(treeModel);
}
 
开发者ID:jpmml,项目名称:jpmml-sparkml,代码行数:28,代码来源:TreeModelCompactor.java

示例3: evaluate

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

	ValueFactory<?> valueFactory;

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

	Map<FieldName, ?> predictions;

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

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

示例4: handleTreeModelPush

import org.dmg.pmml.tree.TreeModel; //导入方法依赖的package包/类
private void handleTreeModelPush(TreeModel treeModel){
	this.miningFunction = treeModel.getMiningFunction();

	this.categoricalFields.clear();
}
 
开发者ID:jpmml,项目名称:jpmml-sparkml,代码行数:6,代码来源:TreeModelCompactor.java

示例5: handleTreeModelPush

import org.dmg.pmml.tree.TreeModel; //导入方法依赖的package包/类
private void handleTreeModelPush(TreeModel treeModel){
	this.miningFunction = treeModel.getMiningFunction();
}
 
开发者ID:jpmml,项目名称:jpmml-sklearn,代码行数:4,代码来源:TreeModelCompactor.java


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