use of org.dmg.pmml.mining.Segmentation.MultipleModelMethod in project jpmml-sparkml by jpmml.
the class ModelConverter method getLastModel.
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;
}
Aggregations