當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。