use of org.knime.core.node.NodeSettingsRO in project knime-core by knime.
the class RandomForestClassificationLearnerNodeModel method loadInternals.
/**
* {@inheritDoc}
*/
@Override
protected void loadInternals(final File nodeInternDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
File file = new File(nodeInternDir, INTERNAL_TREES_FILE);
if (file.exists()) {
getLogger().info("Node was executed with KNIME version <2.10 - keep using old model type, re-execute node to update");
// workflow is older than 2.10
InputStream in = new GZIPInputStream(new FileInputStream(file));
m_oldStyleEnsembleModel_deprecated = TreeEnsembleModel.load(in, exec);
in.close();
}
file = new File(nodeInternDir, INTERNAL_DATASAMPLE_FILE);
if (file.exists()) {
m_hiliteRowSample = DataContainer.readFromZip(file);
}
file = new File(nodeInternDir, INTERNAL_INFO_FILE);
if (file.exists()) {
NodeSettingsRO sets = NodeSettings.loadFromXML(new FileInputStream(file));
m_viewMessage = sets.getString("view_warning", null);
}
}
use of org.knime.core.node.NodeSettingsRO in project knime-core by knime.
the class RandomForestRegressionLearnerNodeModel method loadInternals.
/**
* {@inheritDoc}
*/
@Override
protected void loadInternals(final File nodeInternDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
File file = new File(nodeInternDir, INTERNAL_TREES_FILE);
if (file.exists()) {
getLogger().info("Node was executed with KNIME version <2.10 - keep using old model type, re-execute node to update");
InputStream in = new GZIPInputStream(new FileInputStream(file));
m_oldStyleEnsembleModel_deprecated = TreeEnsembleModel.load(in, exec);
in.close();
}
file = new File(nodeInternDir, INTERNAL_DATASAMPLE_FILE);
if (file.exists()) {
m_hiliteRowSample = DataContainer.readFromZip(file);
}
file = new File(nodeInternDir, INTERNAL_INFO_FILE);
if (file.exists()) {
NodeSettingsRO sets = NodeSettings.loadFromXML(new FileInputStream(file));
m_viewMessage = sets.getString("view_warning", null);
}
}
use of org.knime.core.node.NodeSettingsRO in project knime-core by knime.
the class RegressionTreeLearnerNodeModel method loadInternals.
/**
* {@inheritDoc}
*/
@Override
protected void loadInternals(final File nodeInternDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
File file = new File(nodeInternDir, INTERNAL_DATASAMPLE_FILE);
if (file.exists()) {
m_hiliteRowSample = DataContainer.readFromZip(file);
}
file = new File(nodeInternDir, INTERNAL_INFO_FILE);
if (file.exists()) {
NodeSettingsRO sets = NodeSettings.loadFromXML(new FileInputStream(file));
m_viewMessage = sets.getString("view_warning", null);
}
}
use of org.knime.core.node.NodeSettingsRO in project knime-core by knime.
the class TreeEnsembleClassificationLearnerNodeModel method loadInternals.
/**
* {@inheritDoc}
*/
@Override
protected void loadInternals(final File nodeInternDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
File file = new File(nodeInternDir, INTERNAL_TREES_FILE);
if (file.exists()) {
getLogger().info("Node was executed with KNIME version <2.10 - keep using old model type, re-execute node to update");
// workflow is older than 2.10
InputStream in = new GZIPInputStream(new FileInputStream(file));
m_oldStyleEnsembleModel_deprecated = TreeEnsembleModel.load(in, exec);
in.close();
}
file = new File(nodeInternDir, INTERNAL_DATASAMPLE_FILE);
if (file.exists()) {
m_hiliteRowSample = DataContainer.readFromZip(file);
}
file = new File(nodeInternDir, INTERNAL_INFO_FILE);
if (file.exists()) {
NodeSettingsRO sets = NodeSettings.loadFromXML(new FileInputStream(file));
m_viewMessage = sets.getString("view_warning", null);
}
}
use of org.knime.core.node.NodeSettingsRO in project knime-core by knime.
the class MissingValueHandling2ColSetting method loadIndividualColSettings.
/**
* Helper that load individual settings from a config object, used in
* NodeModel.
*
* @param settings to load from
* @return individual settings
* @throws InvalidSettingsException if errors occur
*/
protected static MissingValueHandling2ColSetting[] loadIndividualColSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
NodeSettingsRO subConfig = settings.getNodeSettings(CFG_INDIVIDUAL);
Map<String, MissingValueHandling2ColSetting> map = loadSubConfigs(subConfig);
return map.values().toArray(new MissingValueHandling2ColSetting[0]);
}
Aggregations