• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VisitorAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: visit

import org.dmg.pmml.VisitorAction; //导入依赖的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.DEFAULT_CHILD).equals(missingValueStrategy) || !(TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION).equals(noTrueChildStrategy) || !(TreeModel.SplitCharacteristic.BINARY_SPLIT).equals(splitCharacteristic)){
		throw new IllegalArgumentException();
	}

	treeModel
		.setMissingValueStrategy(TreeModel.MissingValueStrategy.NONE)
		.setNoTrueChildStrategy(TreeModel.NoTrueChildStrategy.RETURN_LAST_PREDICTION)
		.setSplitCharacteristic(TreeModel.SplitCharacteristic.MULTI_SPLIT);

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


示例2: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(Apply apply){
	String function = apply.getFunction();

	switch(function){
		case "and":
		case "or":
			inlineLogicalExpressions(apply);
			break;
		case "not":
			negateExpression(apply);
			break;
		default:
			break;
	}

	return VisitorAction.CONTINUE;
}
 
开发者ID:jpmml,项目名称:jpmml-r,代码行数:19,代码来源:ExpressionCompactor.java


示例3: accept

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction accept(Visitor visitor){
	VisitorAction status = VisitorAction.CONTINUE;

	if((status == VisitorAction.CONTINUE) && hasArguments()){
		List<Argument> arguments = getArguments();

		for(Argument argument : arguments){
			status = PMMLObject.traverse(visitor, argument.getExpression());

			if(status != VisitorAction.CONTINUE){
				break;
			}
		}
	} // End if

	if(status == VisitorAction.TERMINATE){
		return VisitorAction.TERMINATE;
	}

	return VisitorAction.CONTINUE;
}
 
开发者ID:jpmml,项目名称:jpmml-r,代码行数:23,代码来源:FunctionExpression.java


示例4: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(PMMLObject object){
	List<Field> fields = ReflectionUtil.getInstanceFields(object.getClass());

	for(Field field : fields){
		Object value = ReflectionUtil.getFieldValue(field, object);

		if(value instanceof ArrayList){
			ArrayList<?> list = (ArrayList<?>)value;

			List<?> transformedList = transform(list);
			if(list != transformedList){
				ReflectionUtil.setFieldValue(field, object, transformedList);
			}
		}
	}

	return VisitorAction.CONTINUE;
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:20,代码来源:ArrayListTransformer.java


示例5: getActiveFields

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
static
public Set<Field> getActiveFields(DeepFieldResolver resolver, Model model){
	Set<Field> modelFields = getModelFields(resolver, model);

	FieldReferenceFinder fieldReferenceFinder = new FieldReferenceFinder(){

		@Override
		public VisitorAction visit(LocalTransformations localTransformations){
			return VisitorAction.SKIP;
		}
	};
	fieldReferenceFinder.applyTo(model);

	Set<Field> activeFields = FieldUtil.selectAll(modelFields, fieldReferenceFinder.getFieldNames());

	Output output = model.getOutput();
	if(output != null){
		activeFields.removeAll(output.getOutputFields());
	}

	return activeFields;
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:23,代码来源:DeepFieldResolverUtil.java


示例6: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(final NeuralInputs neuralInputs){
	check(new CollectionSize(neuralInputs){

		@Override
		public Integer getSize(){
			return neuralInputs.getNumberOfInputs();
		}

		@Override
		public Collection<?> getCollection(){
			return neuralInputs.getNeuralInputs();
		}
	});

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


示例7: visit

import org.dmg.pmml.VisitorAction; //导入依赖的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


示例8: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(TextIndex textIndex){
	boolean tokenize = textIndex.isTokenize();
	if(!tokenize){
		report(new UnsupportedAttributeException(textIndex, PMMLAttributes.TEXTINDEX_TOKENIZE, false));
	}

	TextIndex.LocalTermWeights localTermWeights = textIndex.getLocalTermWeights();
	switch(localTermWeights){
		case AUGMENTED_NORMALIZED_TERM_FREQUENCY:
			report(new UnsupportedAttributeException(textIndex, localTermWeights));
			break;
		default:
			break;
	}

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


示例9: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(PMMLObject object){
	List<Field> fields = ReflectionUtil.getInstanceFields(object.getClass());

	for(Field field : fields){

		if((FieldName.class).equals(field.getType())){
			FieldName name = (FieldName)ReflectionUtil.getFieldValue(field, object);

			name = filter(name);

			ReflectionUtil.setFieldValue(field, object, name);
		}
	}

	return VisitorAction.CONTINUE;
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:18,代码来源:FieldNameFilterer.java


示例10: visit

import org.dmg.pmml.VisitorAction; //导入依赖的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


示例11: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(Node node){

	if(node.hasNodes()){
		List<Node> children = node.getNodes();

		children:
		while(true){
			ListIterator<Node> childIt = children.listIterator();

			grandChildren:
			while(childIt.hasNext()){
				Node child = childIt.next();

				Iterator<Node> grandChildIt = getChildren(child);
				if(grandChildIt == null){
					continue grandChildren;
				}

				childIt.remove();

				while(grandChildIt.hasNext()){
					Node grandChild = grandChildIt.next();

					grandChildIt.remove();

					childIt.add(grandChild);
				}

				childIt.add(child);

				continue children;
			}

			break;
		}
	}

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


示例12: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(Model model){
	LocalTransformations localTransformations = model.getLocalTransformations();
	if(localTransformations != null && localTransformations.hasDerivedFields()){
		declare(model, localTransformations.getDerivedFields());
	}

	return VisitorAction.CONTINUE;
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:10,代码来源:FieldResolver.java


示例13: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(PMMLObject object){

	for(Class<?> clazz = object.getClass(); clazz != null; clazz = clazz.getSuperclass()){
		inspect(clazz);
	}

	List<Field> fields = ReflectionUtil.getInstanceFields(object.getClass());
	for(Field field : fields){
		Object value = ReflectionUtil.getFieldValue(field, object);

		inspect(field, value);

		// The field is set to an enum constant
		if(value instanceof Enum){
			Enum<?> enumValue = (Enum<?>)value;

			Field enumField;

			try {
				Class<?> enumClazz = enumValue.getClass();

				enumField = enumClazz.getField(enumValue.name());
			} catch(NoSuchFieldException nsfe){
				throw new RuntimeException(nsfe);
			}

			inspect(enumField);
		}
	}

	return VisitorAction.CONTINUE;
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:34,代码来源:VersionInspector.java


示例14: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(CompoundPredicate compoundPredicate){

	if(compoundPredicate.hasPredicates()){
		filterAll(compoundPredicate.getPredicates());
	}

	return super.visit(compoundPredicate);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:10,代码来源:PredicateFilterer.java


示例15: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(IntSparseArray intSparseArray){

	if(intSparseArray.hasEntries()){
		internAll(intSparseArray.getEntries());
	} // End if

	if(intSparseArray.hasIndices()){
		internAll(intSparseArray.getIndices());
	}

	return super.visit(intSparseArray);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:14,代码来源:IntegerInterner.java


示例16: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(PMMLObject object){

	if(object instanceof HasExpression){
		HasExpression hasExpression = (HasExpression)object;

		hasExpression.setExpression(filter(hasExpression.getExpression()));
	}

	return VisitorAction.CONTINUE;
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:12,代码来源:ExpressionFilterer.java


示例17: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(RealSparseArray realSparseArray){

	if(realSparseArray.hasEntries()){
		internAll(realSparseArray.getEntries());
	}

	return super.visit(realSparseArray);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:10,代码来源:DoubleInterner.java


示例18: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(Node node){

	if(!node.hasNodes()){
		process(node);
	}

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


示例19: visit

import org.dmg.pmml.VisitorAction; //导入依赖的package包/类
@Override
public VisitorAction visit(DerivedField derivedField){
	PMMLObject parent = VisitorUtil.getParent(this);

	if(VisitorUtil.isDictionary(parent)){
		process(derivedField);
	}

	return super.visit(derivedField);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:11,代码来源:FieldDependencyResolver.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NullValue类代码示例发布时间:2022-05-23
下一篇:
Java PartitionPersistProcessor类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap