use of org.kie.dmg.pmml.pmml_4_2.descr.Segmentation in project drools by kiegroup.
the class Miningmodel method initChildModels.
protected void initChildModels() {
childModels = new HashMap<>();
Iterator<Serializable> extenIter = rawModel.getExtensionsAndMiningSchemasAndOutputs().iterator();
segmentation = null;
while (extenIter.hasNext() && segmentation == null) {
Object obj = extenIter.next();
if (obj instanceof Segmentation) {
segmentation = new MiningSegmentation(this, (Segmentation) obj);
}
}
if (segmentation != null) {
List<MiningSegment> segments = segmentation.getMiningSegments();
DataDictionary dd = this.getDataDictionary();
for (MiningSegment seg : segmentation.getMiningSegments()) {
childModels.put(seg.getModel().getModelId(), seg.getModel());
}
}
}
use of org.kie.dmg.pmml.pmml_4_2.descr.Segmentation in project drools by kiegroup.
the class PMML4ModelFactory method getModel.
public PMML4Model getModel(Segment segment, MiningSegmentation segmentation) {
PMML4Model model = null;
if (segment.getMiningModel() != null) {
MiningModel mm = segment.getMiningModel();
model = new Miningmodel(mm.getModelName(), mm, segmentation.getOwner(), null);
} else if (segment.getRegressionModel() != null) {
RegressionModel rm = segment.getRegressionModel();
model = new Regression(rm.getModelName(), rm, segmentation.getOwner(), null);
} else if (segment.getScorecard() != null) {
Scorecard sc = segment.getScorecard();
model = new ScorecardModel(sc.getModelName(), sc, segmentation.getOwner(), null);
} else if (segment.getTreeModel() != null) {
TreeModel tm = segment.getTreeModel();
model = new Treemodel(tm.getModelName(), tm, segmentation.getOwner(), null);
}
return model;
}
Aggregations