Search in sources :

Example 1 with Segmentation

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());
        }
    }
}
Also used : MiningSegmentation(org.kie.pmml.pmml_4_2.model.mining.MiningSegmentation) Serializable(java.io.Serializable) MiningSegmentation(org.kie.pmml.pmml_4_2.model.mining.MiningSegmentation) Segmentation(org.kie.dmg.pmml.pmml_4_2.descr.Segmentation) MiningSegment(org.kie.pmml.pmml_4_2.model.mining.MiningSegment) DataDictionary(org.kie.dmg.pmml.pmml_4_2.descr.DataDictionary)

Example 2 with Segmentation

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;
}
Also used : TreeModel(org.kie.dmg.pmml.pmml_4_2.descr.TreeModel) MiningModel(org.kie.dmg.pmml.pmml_4_2.descr.MiningModel) PMML4Model(org.kie.pmml.pmml_4_2.PMML4Model) Scorecard(org.kie.dmg.pmml.pmml_4_2.descr.Scorecard) RegressionModel(org.kie.dmg.pmml.pmml_4_2.descr.RegressionModel)

Aggregations

Serializable (java.io.Serializable)1 DataDictionary (org.kie.dmg.pmml.pmml_4_2.descr.DataDictionary)1 MiningModel (org.kie.dmg.pmml.pmml_4_2.descr.MiningModel)1 RegressionModel (org.kie.dmg.pmml.pmml_4_2.descr.RegressionModel)1 Scorecard (org.kie.dmg.pmml.pmml_4_2.descr.Scorecard)1 Segmentation (org.kie.dmg.pmml.pmml_4_2.descr.Segmentation)1 TreeModel (org.kie.dmg.pmml.pmml_4_2.descr.TreeModel)1 PMML4Model (org.kie.pmml.pmml_4_2.PMML4Model)1 MiningSegment (org.kie.pmml.pmml_4_2.model.mining.MiningSegment)1 MiningSegmentation (org.kie.pmml.pmml_4_2.model.mining.MiningSegmentation)1