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


Java PMMLObject类代码示例

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


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

示例1: accept

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

示例2: visit

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

示例3: visit

import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public VisitorAction visit(PMMLObject object){
	Class<? extends V> type = getType();

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

		if(type.isInstance(value)){
			V internedValue = intern(type.cast(value));

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

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

示例4: popParent

import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public PMMLObject popParent(){
	PMMLObject parent = super.popParent();

	if(parent instanceof MiningModel){
		MiningModel miningModel = (MiningModel)parent;

		processMiningModel(miningModel);
	} else

	if(parent instanceof Model){
		Model model = (Model)parent;

		processModel(model);
	}

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

示例5: process

import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
private void process(Node node){
	List<Node> path = new ArrayList<>();
	path.add(node);

	Deque<PMMLObject> parents = getParents();
	for(PMMLObject parent : parents){

		if(!(parent instanceof Node)){
			break;
		}

		path.add((Node)parent);
	}

	Collections.reverse(path);

	this.paths.put(node, path);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:19,代码来源:TreePathFinder.java

示例6: visit

import org.dmg.pmml.PMMLObject; //导入依赖的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.trimToSize();
		}
	}

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

示例7: visit

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

示例8: popParent

import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public PMMLObject popParent(){
	PMMLObject parent = super.popParent();

	if(parent instanceof Model){
		Model model = (Model)parent;

		processModel(model);
	} else

	if(parent instanceof PMML){
		PMML pmml = (PMML)parent;

		DataDictionary dataDictionary = pmml.getDataDictionary();
		if(dataDictionary != null){
			processDataDictionary(dataDictionary);
		}
	}

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

示例9: getParent

import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
static
public PMMLObject getParent(Visitor visitor, int index){
	Deque<PMMLObject> parents = visitor.getParents();

	if(index < 0){
		throw new IllegalArgumentException();
	} else

	if(index == 0){
		return parents.getFirst();
	}

	Iterator<PMMLObject> it = parents.iterator();
	for(int i = 0; i < index; i++){
		it.next();
	}

	return it.next();
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:20,代码来源:VisitorUtil.java

示例10: copyState

import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
static
public <E extends PMMLObject> void copyState(E from, E to){
	Class<?> fromClazz = from.getClass();
	Class<?> toClazz = to.getClass();

	// Allow copying to the same class or to a subclass, but not to a superclass
	if(!(fromClazz).isAssignableFrom(toClazz)){
		throw new IllegalArgumentException();
	}

	List<Field> fields = getInstanceFields(fromClazz);
	for(Field field : fields){
		Object value = getFieldValue(field, from);

		setFieldValue(field, to, value);
	}
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:18,代码来源:ReflectionUtil.java

示例11: getValue

import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
static
public <K extends PMMLObject, V> V getValue(K key, LoadingCache<K, V> cache){

	try {
		return cache.get(key);
	} catch(ExecutionException | UncheckedExecutionException e){
		Throwable cause = e.getCause();

		if(cause instanceof PMMLException){
			throw (PMMLException)cause;
		}

		throw new InvalidElementException(key)
			.initCause(cause);
	}
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:17,代码来源:CacheUtil.java

示例12: isIn

import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
/**
 * <p>
 * Checks if this value is contained in the set of reference values.
 * </p>
 */
public boolean isIn(HasValueSet<?> hasValueSet){

	if(hasValueSet instanceof HasParsedValueSet){
		HasParsedValueSet<?> hasParsedValueSet = (HasParsedValueSet<?>)hasValueSet;

		return isIn(hasParsedValueSet);
	}

	Array array = hasValueSet.getArray();
	if(array == null){
		throw new MissingElementException(MissingElementException.formatMessage(XPathUtil.formatElement((Class)hasValueSet.getClass()) + "/" + XPathUtil.formatElement(Array.class)), (PMMLObject)hasValueSet);
	}

	List<String> content = ArrayUtil.getContent(array);

	return indexInStrings(content) > -1;
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:23,代码来源:FieldValue.java

示例13: buildMap

import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
static
public <K, E extends PMMLObject & Indexable<K>> Map<K, E> buildMap(List<E> elements, boolean nullable){
	Map<K, E> result = new LinkedHashMap<>();

	for(E element : elements){
		K key = ensureKey(element, nullable);

		if(result.containsKey(key)){
			throw new InvalidElementException(element);
		}

		result.put(key, element);
	}

	// Cannot use Guava's ImmutableMap, because it is null-hostile
	return Collections.unmodifiableMap(result);
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:18,代码来源:IndexableUtil.java

示例14: pushParent

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

	if(object instanceof Node){
		handleNodePush((Node)object);
	}
}
 
开发者ID:jpmml,项目名称:jpmml-lightgbm,代码行数:9,代码来源:TreeModelCompactor.java

示例15: popParent

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

	if(object instanceof Node){
		handleNodePop((Node)object);
	}

	return object;
}
 
开发者ID:jpmml,项目名称:jpmml-lightgbm,代码行数:11,代码来源:TreeModelCompactor.java


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