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


Java Segmentation.getSegments方法代码示例

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


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

示例1: createNestedOutputFields

import org.dmg.pmml.mining.Segmentation; //导入方法依赖的package包/类
private List<OutputField> createNestedOutputFields(){
	MiningModel miningModel = getModel();

	Segmentation segmentation = miningModel.getSegmentation();

	List<Segment> segments = segmentation.getSegments();

	Segmentation.MultipleModelMethod multipleModelMethod = segmentation.getMultipleModelMethod();
	switch(multipleModelMethod){
		case SELECT_ALL:
			// Ignored
			break;
		case SELECT_FIRST:
			return createNestedOutputFields(getActiveHead(segments));
		case MODEL_CHAIN:
			return createNestedOutputFields(getActiveTail(segments));
		default:
			break;
	}

	return Collections.emptyList();
}
 
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:23,代码来源:MiningModelEvaluator.java

示例2: getLastModel

import org.dmg.pmml.mining.Segmentation; //导入方法依赖的package包/类
protected org.dmg.pmml.Model getLastModel(org.dmg.pmml.Model model){

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

			Segmentation segmentation = miningModel.getSegmentation();

			MultipleModelMethod multipleModelMethod = segmentation.getMultipleModelMethod();
			switch(multipleModelMethod){
				case MODEL_CHAIN:
					List<Segment> segments = segmentation.getSegments();

					if(segments.size() > 0){
						Segment lastSegment = segments.get(segments.size() - 1);

						return lastSegment.getModel();
					}
					break;
				default:
					break;
			}
		}

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

示例3: getEarlierOutputs

import org.dmg.pmml.mining.Segmentation; //导入方法依赖的package包/类
static
private List<Output> getEarlierOutputs(Segmentation segmentation, Segment targetSegment){
	List<Output> result = new ArrayList<>();

	Segmentation.MultipleModelMethod multipleModelMethod = segmentation.getMultipleModelMethod();
	switch(multipleModelMethod){
		case MODEL_CHAIN:
			break;
		default:
			return Collections.emptyList();
	}

	List<Segment> segments = segmentation.getSegments();
	for(Segment segment : segments){
		Model model = segment.getModel();

		if(targetSegment != null && (targetSegment).equals(segment)){
			break;
		}

		Output output = model.getOutput();
		if(output != null){
			result.add(output);
		}
	}

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

示例4: processMiningModel

import org.dmg.pmml.mining.Segmentation; //导入方法依赖的package包/类
private Set<FieldName> processMiningModel(MiningModel miningModel){
	Set<Field> activeFields = DeepFieldResolverUtil.getActiveFields(this, miningModel);

	Set<FieldName> activeFieldNames = new HashSet<>();

	Segmentation segmentation = miningModel.getSegmentation();

	List<Segment> segments = segmentation.getSegments();
	for(Segment segment : segments){
		Model model = segment.getModel();

		if(model == null){
			continue;
		}

		MiningSchema miningSchema = model.getMiningSchema();

		List<MiningField> miningFields = miningSchema.getMiningFields();
		for(MiningField miningField : miningFields){
			FieldName name = miningField.getName();

			MiningField.UsageType usageType = miningField.getUsageType();
			switch(usageType){
				case ACTIVE:
					activeFieldNames.add(name);
					break;
				default:
					break;
			}
		}
	}

	Set<Field> modelFields = getFields(miningModel);

	Set<Field> activeModelFields = FieldUtil.selectAll(modelFields, activeFieldNames, true);
	activeFields.addAll(activeModelFields);

	expandDerivedFields(miningModel, activeFields);

	return FieldUtil.nameSet(activeFields);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:42,代码来源:MiningSchemaCleaner.java


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