use of org.dmg.pmml.MiningModelDocument.MiningModel in project knime-core by knime.
the class ClassificationGBTModelExporter method addSegmentation.
private void addSegmentation(final MiningModel miningModel, final int c) {
Segmentation seg = miningModel.addNewSegmentation();
MultiClassGradientBoostedTreesModel gbt = getGBTModel();
Collection<TreeModelRegression> trees = IntStream.range(0, gbt.getNrLevels()).mapToObj(i -> gbt.getModel(i, c)).collect(Collectors.toList());
Collection<Map<TreeNodeSignature, Double>> coefficientMaps = IntStream.range(0, gbt.getNrLevels()).mapToObj(i -> gbt.getCoefficientMap(i, c)).collect(Collectors.toList());
writeSumSegmentation(seg, trees, coefficientMaps);
}
Aggregations