use of org.knime.base.node.mine.regression.predict2.RegressionPredictorCellFactory in project knime-core by knime.
the class GeneralRegressionPredictorNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected PortObjectSpec[] configure(final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
PMMLPortObjectSpec regModelSpec = (PMMLPortObjectSpec) inSpecs[0];
DataTableSpec dataSpec = (DataTableSpec) inSpecs[1];
if (dataSpec == null || regModelSpec == null) {
throw new InvalidSettingsException("No input specification available");
}
RegressionPredictorSettings s = createRegressionPredictorSettings(regModelSpec, dataSpec);
if (null != RegressionPredictorCellFactory.createColumnSpec(regModelSpec, dataSpec, s)) {
ColumnRearranger c = new ColumnRearranger(dataSpec);
c.append(new RegressionPredictorCellFactory(regModelSpec, dataSpec, s) {
@Override
public DataCell[] getCells(final DataRow row) {
// not called during configure.
return null;
}
});
DataTableSpec outSpec = c.createSpec();
return new DataTableSpec[] { outSpec };
} else {
return null;
}
}
Aggregations