Package weka.knowledgeflow.steps
Class SerializedModelSaver
java.lang.Object
weka.knowledgeflow.steps.BaseStep
weka.knowledgeflow.steps.SerializedModelSaver
- All Implemented Interfaces:
Serializable
,BaseStepExtender
,Step
@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
Step that can save models encapsulated in incoming
Data
objects to
the filesystem.- Version:
- $Revision: $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the text to prepend to the filenameboolean
Get whether to include the relation name as part of the filenameGet a list of incoming connection types that this step can accept.int
Get how frequently to save an incremental modelGet a list of outgoing connection types that this step can produce.Get the directory to save tovoid
processIncoming
(Data data) Process an incoming data payload (if the step accepts incoming connections)void
setFilenamePrefix
(String filenamePrefix) Set the text to prepend to the filenamevoid
setIncludeRelationNameInFilename
(boolean includeRelationName) Set whether to include the relation name as part of the filenamevoid
setIncrementalSaveSchedule
(int schedule) Set how frequently to save an incremental modelvoid
setOutputDirectory
(File directory) Set the directory to save tovoid
stepInit()
Initialize the stepMethods inherited from class weka.knowledgeflow.steps.BaseStep
environmentSubstitute, getCustomEditorForStep, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, outputStructureForConnectionType, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreaded, stop
-
Constructor Details
-
SerializedModelSaver
public SerializedModelSaver()
-
-
Method Details
-
setOutputDirectory
@FilePropertyMetadata(fileChooserDialogType=1, directoriesOnly=true) @OptionMetadata(displayName="Output directory", description="The directory to save models to", displayOrder=0) public void setOutputDirectory(File directory) Set the directory to save to- Parameters:
directory
- the directory to save to
-
getOutputDirectory
Get the directory to save to- Returns:
- the directory to save to
-
setFilenamePrefix
@OptionMetadata(displayName="Filename prefix", description="A prefix to prepend to the filename", displayOrder=1) public void setFilenamePrefix(String filenamePrefix) Set the text to prepend to the filename- Parameters:
filenamePrefix
- the prefix to add to the filename
-
getFilenamePrefix
Get the text to prepend to the filename- Returns:
- the prefix to add to the filename
-
setIncrementalSaveSchedule
@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) Set how frequently to save an incremental model- Parameters:
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.
-
getIncrementalSaveSchedule
public int getIncrementalSaveSchedule()Get how frequently to save an incremental model- Returns:
- 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.
-
setIncludeRelationNameInFilename
@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) Set whether to include the relation name as part of the filename- Parameters:
includeRelationName
- true to include the relation name as part of the filename
-
getIncludeRelationNameInFilename
public boolean getIncludeRelationNameInFilename()Get whether to include the relation name as part of the filename- Returns:
- true if the relation name will be included as part of the filename
-
getIncomingConnectionTypes
Get a list of incoming connection types that this step can accept. Ideally (and if appropriate), this should take into account the state of the step and any existing incoming connections. E.g. a step might be able to accept one (and only one) incoming batch data connection.- Returns:
- a list of incoming connections that this step can accept given its current state
-
getOutgoingConnectionTypes
Get a list of outgoing connection types that this step can produce. Ideally (and if appropriate), this should take into account the state of the step and the incoming connections. E.g. depending on what incoming connection is present, a step might be able to produce a trainingSet output, a testSet output or neither, but not both.- Returns:
- a list of outgoing connections that this step can produce
-
stepInit
public void stepInit()Initialize the step -
processIncoming
Process an incoming data payload (if the step accepts incoming connections)- Specified by:
processIncoming
in interfaceBaseStepExtender
- Specified by:
processIncoming
in interfaceStep
- Overrides:
processIncoming
in classBaseStep
- Parameters:
data
- the data to process- Throws:
WekaException
- if a problem occurs
-