use of org.dmg.pmml.TargetDocument.Target 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.TargetDocument.Target in project knime-core by knime.
the class PMMLSVMTranslator method addTargets.
/**
* Writes the PMML target attributes.
*
* @param svmModel the SVM model to add the targets to
* @param classColName name of the class column.
*/
private void addTargets(final SupportVectorMachineModel svmModel, final String classColName) {
Target target = svmModel.addNewTargets().addNewTarget();
target.setField(classColName);
target.setOptype(OPTYPE.CATEGORICAL);
// add target values
for (String tv : m_targetValues) {
TargetValue targetValue = target.addNewTargetValue();
targetValue.setValue(tv);
}
}
use of org.dmg.pmml.TargetDocument.Target 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