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


Java LocalTransformations类代码示例

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


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

示例1: getActiveFields

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

示例2: visit

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

示例3: visit

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

	if(localTransformations.hasDerivedFields()){
		this.localDerivedFields.addAll(localTransformations.getDerivedFields());
	}

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

示例4: expandDerivedFields

import org.dmg.pmml.LocalTransformations; //导入依赖的package包/类
private void expandDerivedFields(Model model, Set<Field> fields){
	FieldDependencyResolver fieldDependencyResolver = getFieldDependencyResolver();

	fieldDependencyResolver.expand(fields, fieldDependencyResolver.getGlobalDerivedFields());

	LocalTransformations localTransformations = model.getLocalTransformations();
	if(localTransformations != null && localTransformations.hasDerivedFields()){
		fieldDependencyResolver.expand(fields, new HashSet<>(localTransformations.getDerivedFields()));
	}
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:11,代码来源:MiningSchemaCleaner.java

示例5: popParent

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

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

		LocalTransformations localTransformations = model.getLocalTransformations();
		if(localTransformations != null){
			processLocalTransformations(localTransformations);

			if(!localTransformations.hasDerivedFields()){
				model.setLocalTransformations(null);
			}
		}
	} else

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

		TransformationDictionary transformationDictionary = pmml.getTransformationDictionary();
		if(transformationDictionary != null){
			processTransformationDictionary(transformationDictionary);

			if(!transformationDictionary.hasDefineFunctions() && !transformationDictionary.hasDerivedFields()){
				pmml.setTransformationDictionary(null);
			}
		}
	}

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

示例6: isDictionary

import org.dmg.pmml.LocalTransformations; //导入依赖的package包/类
static
public boolean isDictionary(PMMLObject parent){

	if((parent instanceof TransformationDictionary) || (parent instanceof LocalTransformations)){
		return true;
	}

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

示例7: visit

import org.dmg.pmml.LocalTransformations; //导入依赖的package包/类
@Override
public VisitorAction visit(Segmentation segmentation){
	LocalTransformations localTransformations = segmentation.getLocalTransformations();

	if(localTransformations != null){
		report(new UnsupportedElementException(localTransformations));
	}

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

示例8: MiningModelEvaluator

import org.dmg.pmml.LocalTransformations; //导入依赖的package包/类
public MiningModelEvaluator(PMML pmml, MiningModel miningModel){
	super(pmml, miningModel);

	if(miningModel.hasEmbeddedModels()){
		List<EmbeddedModel> embeddedModels = miningModel.getEmbeddedModels();

		EmbeddedModel embeddedModel = Iterables.getFirst(embeddedModels, null);

		throw new UnsupportedElementException(embeddedModel);
	}

	Segmentation segmentation = miningModel.getSegmentation();
	if(segmentation == null){
		throw new MissingElementException(miningModel, PMMLElements.MININGMODEL_SEGMENTATION);
	}

	Segmentation.MultipleModelMethod multipleModelMethod = segmentation.getMultipleModelMethod();
	if(multipleModelMethod == null){
		throw new MissingAttributeException(segmentation, PMMLAttributes.SEGMENTATION_MULTIPLEMODELMETHOD);
	} // End if

	if(!segmentation.hasSegments()){
		throw new MissingElementException(segmentation, PMMLElements.SEGMENTATION_SEGMENTS);
	}

	LocalTransformations localTransformations = segmentation.getLocalTransformations();
	if(localTransformations != null){
		throw new UnsupportedElementException(localTransformations);
	}
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:31,代码来源:MiningModelEvaluator.java

示例9: ModelEvaluator

import org.dmg.pmml.LocalTransformations; //导入依赖的package包/类
protected ModelEvaluator(PMML pmml, M model){
	setPMML(Objects.requireNonNull(pmml));
	setModel(Objects.requireNonNull(model));

	DataDictionary dataDictionary = pmml.getDataDictionary();
	if(dataDictionary == null){
		throw new MissingElementException(pmml, PMMLElements.PMML_DATADICTIONARY);
	} // End if

	if(dataDictionary.hasDataFields()){
		this.dataFields = CacheUtil.getValue(dataDictionary, ModelEvaluator.dataFieldCache);
	}

	TransformationDictionary transformationDictionary = pmml.getTransformationDictionary();
	if(transformationDictionary != null && transformationDictionary.hasDerivedFields()){
		this.derivedFields = CacheUtil.getValue(transformationDictionary, ModelEvaluator.derivedFieldCache);
	} // End if

	if(transformationDictionary != null && transformationDictionary.hasDefineFunctions()){
		this.defineFunctions = CacheUtil.getValue(transformationDictionary, ModelEvaluator.defineFunctionCache);
	}

	MiningFunction miningFunction = model.getMiningFunction();
	if(miningFunction == null){
		throw new MissingAttributeException(MissingAttributeException.formatMessage(XPathUtil.formatElement(model.getClass()) + "@miningFunction"), model);
	}

	MiningSchema miningSchema = model.getMiningSchema();
	if(miningSchema == null){
		throw new MissingElementException(MissingElementException.formatMessage(XPathUtil.formatElement(model.getClass()) + "/" + XPathUtil.formatElement(MiningSchema.class)), model);
	} // End if

	if(miningSchema.hasMiningFields()){
		this.miningFields = CacheUtil.getValue(miningSchema, ModelEvaluator.miningFieldCache);
	}

	LocalTransformations localTransformations = model.getLocalTransformations();
	if(localTransformations != null && localTransformations.hasDerivedFields()){
		this.localDerivedFields = CacheUtil.getValue(localTransformations, ModelEvaluator.localDerivedFieldCache);
	}

	Targets targets = model.getTargets();
	if(targets != null && targets.hasTargets()){
		this.targets = CacheUtil.getValue(targets, ModelEvaluator.targetCache);
	}

	Output output = model.getOutput();
	if(output != null && output.hasOutputFields()){
		this.outputFields = CacheUtil.getValue(output, ModelEvaluator.outputFieldCache);
	}
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:52,代码来源:ModelEvaluator.java

示例10: load

import org.dmg.pmml.LocalTransformations; //导入依赖的package包/类
@Override
public Map<FieldName, DerivedField> load(LocalTransformations localTransformations){
	return IndexableUtil.buildMap(localTransformations.getDerivedFields());
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:5,代码来源:ModelEvaluator.java

示例11: getLocalTransformations

import org.dmg.pmml.LocalTransformations; //导入依赖的package包/类
@Override
public LocalTransformations getLocalTransformations(){
	return this.localTransformations;
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:5,代码来源:JavaModel.java

示例12: setLocalTransformations

import org.dmg.pmml.LocalTransformations; //导入依赖的package包/类
@Override
public JavaModel setLocalTransformations(@Property("localTransformations") LocalTransformations localTransformations){
	this.localTransformations = localTransformations;

	return this;
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:7,代码来源:JavaModel.java

示例13: processLocalTransformations

import org.dmg.pmml.LocalTransformations; //导入依赖的package包/类
private void processLocalTransformations(LocalTransformations localTransformations){

		if(localTransformations.hasDerivedFields()){
			List<DerivedField> derivedFields = localTransformations.getDerivedFields();

			Set<DerivedField> activeDerivedFields = getActiveDerivedFields(new HashSet<>(derivedFields));

			derivedFields.retainAll(activeDerivedFields);
		}
	}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:11,代码来源:TransformationDictionaryCleaner.java


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