本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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);
}