use of org.knime.core.node.config.Config in project knime-core by knime.
the class AttributeModel method saveModel.
/**
* @param config the <code>Config</code> object to write to
*/
void saveModel(final Config config) {
config.addString(ATTRIBUTE_NAME, getAttributeName());
config.addString(MODEL_TYPE, getType());
config.addBoolean(SKIP_MISSING_VALUES, m_skipMissingVals);
config.addInt(NO_OF_MISSING_VALUES, m_noOfMissingVals);
config.addString(INVALID_CAUSE, getInvalidCause());
final Config internalConfig = config.addConfig(MODEL_DATA_SECTION);
saveModelInternal(internalConfig);
}
use of org.knime.core.node.config.Config in project knime-core by knime.
the class NominalAttributeModel method saveModelInternal.
/**
* {@inheritDoc}
*/
@Override
void saveModelInternal(final Config config) {
config.addInt(MAX_NO_OF_ATTRS, m_maxNoOfAttrVals);
config.addInt(CLASS_VALUE_COUNTER, m_classValues.size());
final String[] attrVals = m_attributeVals.toArray(new String[] {});
config.addStringArray(ATTRIBUTE_VALUES, attrVals);
int i = 0;
for (final NominalClassValue classVal : m_classValues.values()) {
final Config classConfig = config.addConfig(CLASS_VALUE_SECTION + i);
classVal.saveModel(classConfig);
i++;
}
}
use of org.knime.core.node.config.Config in project knime-core by knime.
the class NumericalAttributeModel method saveModelInternal.
/**
* {@inheritDoc}
*/
@Override
void saveModelInternal(final Config config) {
config.addInt(CLASS_VALUE_COUNTER, m_classValues.size());
int i = 0;
for (final NumericalClassValue classVal : m_classValues.values()) {
final Config classConfig = config.addConfig(CLASS_VALUE_SECTION + i);
classVal.saveModel(classConfig);
i++;
}
}
use of org.knime.core.node.config.Config in project knime-core by knime.
the class NaiveBayesPortObjectSpec method save.
/**
* {@inheritDoc}
*/
@Override
protected void save(final ModelContentWO model) {
final Config specModel = model.addConfig(CNFG_SPEC);
m_tableSpec.save(specModel);
final ModelContentWO classColModel = model.addModelContent(CNFG_CLASS_COL);
m_classColumn.save(classColModel);
}
use of org.knime.core.node.config.Config in project knime-core by knime.
the class NaiveBayesPortObject method save.
/**
* {@inheritDoc}
*/
@Override
protected void save(final ModelContentWO model, final ExecutionMonitor exec) {
final Config modelConfig = model.addConfig(CNFG_MODEL);
m_model.savePredictorParams(modelConfig);
}
Aggregations