|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.node.NodeModel
org.knime.base.node.mine.bfn.BasisFunctionLearnerNodeModel
public abstract class BasisFunctionLearnerNodeModel
Abstract basisfunction model holding the trained rule table.
Field Summary | |
---|---|
static String |
DISTANCE
Key for choice of distance measure. |
static Distance[] |
DISTANCES
An array of possible distance measures. |
static String |
HILITE_MAPPING_FILE_NAME
File name for hilite mapping. |
static String |
MAX_CLASS_COVERAGE
NodeSettings key for max_class_coverage. |
static String |
MAX_EPOCHS
Config key for maximum number of epochs. |
static String |
MODEL_INFO
Model info identifier. |
static String |
MODEL_INFO_FILE_NAME
Model info file extension. |
static String |
SHRINK_AFTER_COMMIT
NodeSettings key for shrink_after_commit. |
static String |
TARGET_COLUMNS
Key of the target column. |
Constructor Summary | |
---|---|
protected |
BasisFunctionLearnerNodeModel(PortType model)
Creates a new model with one data in and out port, and model out-port. |
Method Summary | |
---|---|
PortObjectSpec[] |
configure(PortObjectSpec[] ins)
Configure method for general port types. |
abstract BasisFunctionPortObject |
createPortObject(BasisFunctionModelContent content)
Creates a new basisfunction port object given the model content. |
PortObject[] |
execute(PortObject[] inData,
ExecutionContext exec)
Starts the learning algorithm in the learner. |
int |
getDistance()
|
abstract BasisFunctionFactory |
getFactory(DataTableSpec spec)
Create factory to generate BasisFunctions. |
int |
getMaxNrEpochs()
|
BasisFunctionLearnerTable.MissingValueReplacementFunction |
getMissingFct()
|
ModelContentRO |
getModelInfo()
|
abstract DataType |
getModelType()
|
HiLiteHandler |
getOutHiLiteHandler(int outPortID)
Returns the HiLiteHandler for the given output index. |
String[] |
getTargetColumns()
|
boolean |
isMaxClassCoverage()
|
boolean |
isShrinkAfterCommit()
|
protected void |
loadInternals(File internDir,
ExecutionMonitor exec)
Load internals into the derived NodeModel . |
void |
loadValidatedSettingsFrom(NodeSettingsRO settings)
Sets new settings from the passed object in the model. |
protected void |
reset()
Reset the trained model. |
protected void |
saveInternals(File internDir,
ExecutionMonitor exec)
Save internals of the derived NodeModel . |
void |
saveSettingsTo(NodeSettingsWO settings)
Adds to the given NodeSettings the model specific
settings. |
protected void |
setInHiLiteHandler(int inIndex,
HiLiteHandler hiLiteHdl)
This implementation is empty. |
void |
validateSettings(NodeSettingsRO settings)
Validates the settings in the passed NodeSettings object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DISTANCE
public static final Distance[] DISTANCES
public static final String SHRINK_AFTER_COMMIT
public static final String MAX_CLASS_COVERAGE
public static final String TARGET_COLUMNS
public static final String MAX_EPOCHS
public static final String MODEL_INFO
public static final String MODEL_INFO_FILE_NAME
public static final String HILITE_MAPPING_FILE_NAME
Constructor Detail |
---|
protected BasisFunctionLearnerNodeModel(PortType model)
model
- the port type of the generated basisfunction modelMethod Detail |
---|
protected void reset()
NodeModel
. All components should unregister themselves
from any observables (at least from the hilite handler right now). All
internally stored data structures should be released. User settings
should not be deleted/reset though.
reset
in class NodeModel
protected void setInHiLiteHandler(int inIndex, HiLiteHandler hiLiteHdl)
setInHiLiteHandler
in class NodeModel
inIndex
- The index of the input.hiLiteHdl
- The HiLiteHandler
at input index.
May be null
when not available, i.e. not properly
connected.public HiLiteHandler getOutHiLiteHandler(int outPortID)
HiLiteHandler
for the given output index. This
default implementation simply passes on the handler of input port 0 or
generates a new one if this node has no inputs.
getOutHiLiteHandler
in class NodeModel
outPortID
- The output index.
HiLiteHandler
for the given output port.public PortObjectSpec[] configure(PortObjectSpec[] ins) throws InvalidSettingsException
PortObjectSpecs
that are defined through the
PortTypes
given in the
constructor
.
Similarly, the returned output specs need to comply with their port types
spec class (otherwise an error is reported by the framework). They may
also be null.
For a general description of the configure method refer to the
description of the specialized NodeModel.configure(DataTableSpec[])
methods as it addresses more use cases.
configure
in class NodeModel
ins
- The input object specs.
InvalidSettingsException
- If this node can't be configured.public abstract DataType getModelType()
public abstract BasisFunctionPortObject createPortObject(BasisFunctionModelContent content)
content
- basisfunction rules and spec
public PortObject[] execute(PortObject[] inData, ExecutionContext exec) throws CanceledExecutionException
execute
in class NodeModel
inData
- the input training data at index 0exec
- the execution monitor
CanceledExecutionException
- if the training was canceledpublic abstract BasisFunctionFactory getFactory(DataTableSpec spec)
spec
- the cleaned data for training
public ModelContentRO getModelInfo()
null
public void validateSettings(NodeSettingsRO settings) throws InvalidSettingsException
NodeSettings
object.
The specified settings should be checked for completeness and
consistency. It must be possible to load a settings object validated
here without any exception in the
#loadValidatedSettings(NodeSettings)
method. The method
must not change the current settings in the model - it is supposed to
just check them. If some settings are missing, invalid, inconsistent, or
just not right throw an exception with a message useful to the user.
validateSettings
in class NodeModel
settings
- The settings to validate.
InvalidSettingsException
- If the validation of the settings
failed.NodeModel.saveSettingsTo(NodeSettingsWO)
,
NodeModel.loadValidatedSettingsFrom(NodeSettingsRO)
public void loadValidatedSettingsFrom(NodeSettingsRO settings) throws InvalidSettingsException
#validateSettings(NodeSettings)
method. The model must set
its internal configuration according to the settings object passed.
loadValidatedSettingsFrom
in class NodeModel
settings
- The settings to read.
InvalidSettingsException
- If a property is not available.NodeModel.saveSettingsTo(NodeSettingsWO)
,
NodeModel.validateSettings(NodeSettingsRO)
public void saveSettingsTo(NodeSettingsWO settings)
NodeSettings
the model specific
settings. The settings don't need to be complete or consistent. If, right
after startup, no valid settings are available this method can write
either nothing or invalid settings.
Method is called by the Node
if the current settings need
to be saved or transfered to the node's dialog.
saveSettingsTo
in class NodeModel
settings
- The object to write settings into.NodeModel.loadValidatedSettingsFrom(NodeSettingsRO)
,
NodeModel.validateSettings(NodeSettingsRO)
protected void loadInternals(File internDir, ExecutionMonitor exec) throws IOException, CanceledExecutionException
NodeModel
. This method is
only called if the Node
was executed. Read all your
internal structures from the given file directory to create your internal
data structure which is necessary to provide all node functionalities
after the workflow is loaded, e.g. view content and/or hilite mapping.
loadInternals
in class NodeModel
internDir
- The directory to read from.exec
- Used to report progress and to cancel the load process.
IOException
- If an error occurs during reading from this dir.
CanceledExecutionException
- If the loading has been canceled.NodeModel.saveInternals(File,ExecutionMonitor)
protected void saveInternals(File internDir, ExecutionMonitor exec) throws IOException, CanceledExecutionException
NodeModel
. This method is
only called if the Node
is executed. Write all your
internal structures into the given file directory which are necessary to
recreate this model when the workflow is loaded, e.g. view content and/or
hilite mapping.
saveInternals
in class NodeModel
internDir
- The directory to write into.exec
- Used to report progress and to cancel the save process.
IOException
- If an error occurs during writing to this dir.
CanceledExecutionException
- If the saving has been canceled.NodeModel.loadInternals(File,ExecutionMonitor)
public final BasisFunctionLearnerTable.MissingValueReplacementFunction getMissingFct()
public final String[] getTargetColumns()
public final boolean isShrinkAfterCommit()
true
if shrink after commitpublic final boolean isMaxClassCoverage()
true
if max class coveragepublic final int getDistance()
public final int getMaxNrEpochs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |