public abstract class MissingCellHandler extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CUSTOM_HANDLER_EXTENSION_NAME
Name of the pmml extension that holds the name of a custom missing value handler.
|
Constructor and Description |
---|
MissingCellHandler(DataColumnSpec col)
Constructor for the missing cell handler.
|
Modifier and Type | Method and Description |
---|---|
protected org.dmg.pmml.DerivedFieldDocument.DerivedField |
createExtensionDerivedField(org.dmg.pmml.DATATYPE.Enum dataType,
String factoryID)
Creates a derived field that contains an extension which
contains the name of the factory to use for the replacement.
|
protected org.dmg.pmml.DerivedFieldDocument.DerivedField |
createValueReplacingDerivedField(org.dmg.pmml.DATATYPE.Enum dataType,
String value)
Helper method for creating a derived field that replaces a field's value with a fixed value.
|
static MissingCellHandler |
fromPMMLExtension(DataColumnSpec column,
org.dmg.pmml.ExtensionDocument.Extension ext)
Creates a missing cell handler from an extension that is inside of a PMML derived field.
|
abstract DataCell |
getCell(RowKey key,
DataColumnWindow window)
Calculates the replacement value for a cell.
|
DataColumnSpec |
getColumnSpec() |
abstract int |
getNextCellsWindowSize() |
DataType |
getOutputDataType() |
protected org.dmg.pmml.DATATYPE.Enum |
getPMMLDataTypeForColumn()
Maps the columns data type to a PMML data type.
|
abstract org.dmg.pmml.DerivedFieldDocument.DerivedField |
getPMMLDerivedField()
Creates a derived field for the documentation of the operation in PMML.
|
abstract int |
getPreviousCellsWindowSize() |
abstract Statistic |
getStatistic()
Returns a Knime statistic to be evaluated before missing values are replaced.
|
String |
getWarningMessage() |
abstract void |
loadSettingsFrom(NodeSettingsRO settings)
Loads user settings.
|
void |
nonMissingValueSeen(RowKey key,
DataColumnWindow window)
Is called when the iterator over the table passes over a row that has a
non-missing cell in this handler's column.
|
void |
rowRemoved(RowKey key)
Is called when the current value is missing but the current row is skipped because a previous column had a
handler that requested to remove the row.
|
abstract void |
saveSettingsTo(NodeSettingsWO settings)
Saves user settings.
|
public static final String CUSTOM_HANDLER_EXTENSION_NAME
public MissingCellHandler(DataColumnSpec col)
col
- the column this handler is used forpublic DataColumnSpec getColumnSpec()
public String getWarningMessage()
public abstract void loadSettingsFrom(NodeSettingsRO settings) throws InvalidSettingsException
settings
- the settingsInvalidSettingsException
- when the settings cannot be loadedpublic abstract void saveSettingsTo(NodeSettingsWO settings)
settings
- the settingspublic abstract Statistic getStatistic()
public abstract DataCell getCell(RowKey key, DataColumnWindow window)
key
- the row key of the row where the cell should be replaced.window
- the window over the previous and next cells as defined by
getPreviousCellsWindowSize
and getNextCellsWindowSize
.public void nonMissingValueSeen(RowKey key, DataColumnWindow window)
key
- the key of the rowwindow
- the sliding window over the columnpublic void rowRemoved(RowKey key)
key
- the key of the row that is removedpublic abstract org.dmg.pmml.DerivedFieldDocument.DerivedField getPMMLDerivedField()
public abstract int getPreviousCellsWindowSize()
public abstract int getNextCellsWindowSize()
public DataType getOutputDataType()
protected org.dmg.pmml.DerivedFieldDocument.DerivedField createValueReplacingDerivedField(org.dmg.pmml.DATATYPE.Enum dataType, String value)
dataType
- the data type of the field.value
- the replacement value for the fieldprotected org.dmg.pmml.DerivedFieldDocument.DerivedField createExtensionDerivedField(org.dmg.pmml.DATATYPE.Enum dataType, String factoryID)
dataType
- the data type of the derived fieldfactoryID
- the id of the factoryprotected org.dmg.pmml.DATATYPE.Enum getPMMLDataTypeForColumn()
public static MissingCellHandler fromPMMLExtension(DataColumnSpec column, org.dmg.pmml.ExtensionDocument.Extension ext) throws InvalidSettingsException
column
- the column this handler is used forext
- the extension containing the necessary informationInvalidSettingsException
- if the the factory from the extension is not applicable for the column
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.