@KFStep(name="SerializedModelSaver", category="DataSinks", toolTipText="A step that saves models to the file system", iconPath="weka/gui/knowledgeflow/icons/SerializedModelSaver.gif") public class SerializedModelSaver extends BaseStep
Data objects to
the filesystem.| Modifier and Type | Field and Description |
|---|---|
protected int |
m_counter
Counter for use when processing incremental classifier connections
|
protected boolean |
m_includeRelationName
Whether to include the relation name of the data in the file name for the
model
|
protected Instances |
m_incrementalHeader
Stores the header of data used to build an incremental model
|
protected int |
m_incrementalSaveSchedule
How often to save an incremental classifier (<= 0 means only at the end of
the stream)
|
m_stepIsResourceIntensive, m_stepManager, m_stepName| Constructor and Description |
|---|
SerializedModelSaver() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFilenamePrefix()
Get the text to prepend to the filename
|
boolean |
getIncludeRelationNameInFilename()
Get whether to include the relation name as part of the filename
|
java.util.List<java.lang.String> |
getIncomingConnectionTypes()
Get a list of incoming connection types that this step can accept.
|
int |
getIncrementalSaveSchedule()
Get how frequently to save an incremental model
|
java.util.List<java.lang.String> |
getOutgoingConnectionTypes()
Get a list of outgoing connection types that this step can produce.
|
java.io.File |
getOutputDirectory()
Get the directory to save to
|
void |
processIncoming(Data data)
Process an incoming data payload (if the step accepts incoming connections)
|
protected static java.lang.String |
sanitizeFilename(java.lang.String filename)
makes sure that the filename is valid, i.e., replaces slashes, backslashes
and colons with underscores ("_").
|
void |
setFilenamePrefix(java.lang.String filenamePrefix)
Set the text to prepend to the filename
|
void |
setIncludeRelationNameInFilename(boolean includeRelationName)
Set whether to include the relation name as part of the filename
|
void |
setIncrementalSaveSchedule(int schedule)
Set how frequently to save an incremental model
|
void |
setOutputDirectory(java.io.File directory)
Set the directory to save to
|
void |
stepInit()
Initialize the step
|
environmentSubstitute, getCustomEditorForStep, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreaded, stopprotected Instances m_incrementalHeader
protected int m_incrementalSaveSchedule
protected boolean m_includeRelationName
protected int m_counter
@FilePropertyMetadata(fileChooserDialogType=1, directoriesOnly=true) @OptionMetadata(displayName="Output directory", description="The directory to save models to", displayOrder=0) public void setOutputDirectory(java.io.File directory)
directory - the directory to save topublic java.io.File getOutputDirectory()
@OptionMetadata(displayName="Filename prefix", description="A prefix to prepend to the filename", displayOrder=1) public void setFilenamePrefix(java.lang.String filenamePrefix)
filenamePrefix - the prefix to add to the filenamepublic java.lang.String getFilenamePrefix()
@OptionMetadata(displayName="Incremental save schedule", description="How frequently to save incremental classifiers (<= 0 indicates that the save will happen just once, at the end of the stream", displayOrder=4) public void setIncrementalSaveSchedule(int schedule)
schedule - how often (i.e. every x updates) to save the model. <= 0
indicates that the save will happen just once, at the end of the
stream.public int getIncrementalSaveSchedule()
@OptionMetadata(displayName="Include relation name in file name", description="Whether to include the relation name of the data as part of the file name", displayOrder=2) public void setIncludeRelationNameInFilename(boolean includeRelationName)
includeRelationName - true to include the relation name as part of the
filenamepublic boolean getIncludeRelationNameInFilename()
public java.util.List<java.lang.String> getIncomingConnectionTypes()
public java.util.List<java.lang.String> getOutgoingConnectionTypes()
public void stepInit()
public void processIncoming(Data data) throws WekaException
processIncoming in interface BaseStepExtenderprocessIncoming in interface StepprocessIncoming in class BaseStepdata - the data to processWekaException - if a problem occursprotected static java.lang.String sanitizeFilename(java.lang.String filename)
filename - the filename to cleanse