Search in sources :

Example 1 with DBAutoBinner

use of org.knime.base.node.io.database.binning.DBAutoBinner in project knime-core by knime.

the class DBAutoBinnerNodeModel method createPMMLPortObject.

private PMMLPortObject createPMMLPortObject(final DatabasePortObjectSpec inSpec, final DatabaseQueryConnectionSettings connectionSettings, final ExecutionMonitor exec) throws InvalidSettingsException {
    DataTableSpec dataTableSpec = inSpec.getDataTableSpec();
    DBAutoBinner autoBinner = new DBAutoBinner(m_settings, dataTableSpec);
    PMMLPreprocDiscretize pMMLPrepocDiscretize;
    try {
        pMMLPrepocDiscretize = autoBinner.createPMMLPrepocDiscretize(getCredentialsProvider(), connectionSettings, dataTableSpec);
        PMMLPortObject pmmlPortObject = DBAutoBinner.translate(pMMLPrepocDiscretize, dataTableSpec);
        return pmmlPortObject;
    } catch (SQLException e) {
        throw new InvalidSettingsException("Could not retrieve boundaries from database. Exception: " + e.getMessage(), e);
    }
}
Also used : DataTableSpec(org.knime.core.data.DataTableSpec) PMMLPortObject(org.knime.core.node.port.pmml.PMMLPortObject) SQLException(java.sql.SQLException) InvalidSettingsException(org.knime.core.node.InvalidSettingsException) DBAutoBinner(org.knime.base.node.io.database.binning.DBAutoBinner) PMMLPreprocDiscretize(org.knime.base.node.preproc.autobinner.pmml.PMMLPreprocDiscretize)

Aggregations

SQLException (java.sql.SQLException)1 DBAutoBinner (org.knime.base.node.io.database.binning.DBAutoBinner)1 PMMLPreprocDiscretize (org.knime.base.node.preproc.autobinner.pmml.PMMLPreprocDiscretize)1 DataTableSpec (org.knime.core.data.DataTableSpec)1 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)1 PMMLPortObject (org.knime.core.node.port.pmml.PMMLPortObject)1