use of org.knime.core.node.ModelContent in project knime-core by knime.
the class SizeHandlerPortObject method getViews.
/**
* {@inheritDoc}
*/
@Override
public JComponent[] getViews() {
ModelContent model = new ModelContent("Size");
getSpec().getColumnSpec(0).getSizeHandler().save(model);
return new JComponent[] { new ModelContentOutPortView(model) };
}
use of org.knime.core.node.ModelContent in project knime-core by knime.
the class ShapeHandlerPortObject method getViews.
/**
* {@inheritDoc}
*/
@Override
public JComponent[] getViews() {
ModelContent model = new ModelContent("Shape");
getSpec().getColumnSpec(0).getShapeHandler().save(model);
return new JComponent[] { new ModelContentOutPortView(model) };
}
use of org.knime.core.node.ModelContent in project knime-core by knime.
the class TreeEnsembleModelPortObject method save.
private void save(final PortObjectZipOutputStream out, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
ModelContent mc = new ModelContent(CFG_MODELCONTENT);
mc.addInt(CFG_NRATTRIBUTES, m_nrAttributes);
mc.addInt(CFG_NRMODELS, m_nrModels);
mc.saveToXML(out);
}
use of org.knime.core.node.ModelContent in project knime-core by knime.
the class RandomForestDistanceConfig method saveInternals.
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final String prefix, final PortObjectZipOutputStream outputStream, final ExecutionMonitor exec) throws CanceledExecutionException, IOException {
outputStream.putNextEntry(new ZipEntry("model.zip"));
m_ensembleModel.save(outputStream, exec);
outputStream.closeEntry();
outputStream.putNextEntry(new ZipEntry("spec.zip"));
ModelContent mc = new ModelContent(CFG_MODELCONTENT);
m_learnTableSpec.save(mc.addModelContent(CFG_TABLESPEC));
mc.saveToXML(outputStream);
}
use of org.knime.core.node.ModelContent in project knime-core by knime.
the class LogRegLearnerNodeModel method saveInternals.
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File internDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
ModelContent content = new ModelContent(CFG_SETTINGS);
ModelContentWO specContent = content.addModelContent(CFG_SPEC);
m_content.getSpec().getDataTableSpec().save(specContent);
ModelContentWO parContent = content.addModelContent(CFG_LOGREG_CONTENT);
m_content.save(parContent);
File outFile = new File(internDir, FILE_SAVE);
content.saveToXML(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(outFile))));
}
Aggregations