use of org.dmg.pmml.TargetsDocument.Targets in project knime-core by knime.
the class ClassificationGBTModelExporter method addTarget.
private void addTarget(final MiningModel miningModel) {
Targets targets = miningModel.addNewTargets();
Target target = targets.addNewTarget();
target.setRescaleConstant(getGBTModel().getInitialValue());
target.setField(getGBTModel().getMetaData().getTargetMetaData().getAttributeName());
}
use of org.dmg.pmml.TargetsDocument.Targets in project knime-core by knime.
the class RegressionGBTModelExporter method doWrite.
/**
* {@inheritDoc}
*/
@Override
protected void doWrite(final MiningModel model) {
// write the initial value
Targets targets = model.addNewTargets();
Target target = targets.addNewTarget();
GradientBoostedTreesModel gbtModel = getGBTModel();
target.setField(gbtModel.getMetaData().getTargetMetaData().getAttributeName());
target.setRescaleConstant(gbtModel.getInitialValue());
// write the model
Segmentation segmentation = model.addNewSegmentation();
List<TreeModelRegression> trees = IntStream.range(0, gbtModel.getNrModels()).mapToObj(gbtModel::getTreeModelRegression).collect(Collectors.toList());
writeSumSegmentation(segmentation, trees, gbtModel.getCoeffientMaps());
}
Aggregations