|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.ConsoleObject
adams.core.option.AbstractOptionHandler
adams.flow.core.AbstractActor
adams.flow.transformer.AbstractTransformer
adams.flow.transformer.AbstractProcessWekaInstanceWithModel<T>
T - the type of model to usepublic abstract class AbstractProcessWekaInstanceWithModel<T>
Ancestor for transformers that user models for processing Instance objects, e.g., classifiers making predictions.
| Field Summary | |
|---|---|
static String |
BACKUP_MODEL
the key for storing the current model in the backup. |
protected T |
m_Model
the model that was loaded from the model file. |
protected GlobalActorReference |
m_ModelActor
the global actor to get the model from. |
protected PlaceholderFile |
m_ModelFile
the serialized model to load. |
protected boolean |
m_OnTheFly
whether the model gets built on the fly and might not be present at the start. |
| Fields inherited from class adams.flow.transformer.AbstractTransformer |
|---|
BACKUP_INPUT, BACKUP_OUTPUT, m_InputToken, m_OutputToken |
| Fields inherited from class adams.flow.core.AbstractActor |
|---|
FILE_EXTENSION, FILE_EXTENSION_GZ, m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_FullName, m_Headless, m_Name, m_Parent, m_Root, m_Self, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated |
| Fields inherited from class adams.core.option.AbstractOptionHandler |
|---|
m_DebugLevel, m_OptionManager |
| Constructor Summary | |
|---|---|
AbstractProcessWekaInstanceWithModel()
|
|
| Method Summary | |
|---|---|
Class[] |
accepts()
Returns the class that the consumer accepts. |
protected Hashtable<String,Object> |
backupState()
Backs up the current state of the actor before update the variables. |
void |
defineOptions()
Adds options to the internal list of options. |
protected String |
doExecute()
Executes the flow item. |
abstract Class[] |
generates()
Returns the class of objects that it generates. |
GlobalActorReference |
getModelActor()
Returns the global actor to obtain the model from if model file is pointing to a directory. |
PlaceholderFile |
getModelFile()
Returns the file to load the model from. |
boolean |
getOnTheFly()
Returns whether the model file gets built on the fly and might not be present at start up time. |
String |
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI. |
String |
modelActorTipText()
Returns the tip text for this property. |
String |
modelFileTipText()
Returns the tip text for this property. |
String |
onTheFlyTipText()
Returns the tip text for this property. |
protected abstract Token |
processInstance(weka.core.Instance inst)
Processes the instance and generates the output token. |
protected void |
pruneBackup()
Removes entries from the backup. |
protected void |
restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated. |
void |
setModelActor(GlobalActorReference value)
Sets the global actor to obtain the model from if model file is pointing to a directory. |
void |
setModelFile(PlaceholderFile value)
Sets the file to load the model from. |
void |
setOnTheFly(boolean value)
Sets whether the model file gets built on the fly and might not be present at start up time. |
String |
setUp()
Initializes the item for flow execution. |
protected String |
setUpModel()
Loads the model from the model file. |
void |
wrapUp()
Cleans up after the execution has finished. |
| Methods inherited from class adams.flow.transformer.AbstractTransformer |
|---|
execute, hasPendingOutput, input, output, postExecute, reset |
| Methods inherited from class adams.core.option.AbstractOptionHandler |
|---|
cleanUpOptions, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, globalInfo, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString |
| Methods inherited from class adams.core.ConsoleObject |
|---|
getDebugging, getSystemErr, getSystemOut |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String BACKUP_MODEL
protected PlaceholderFile m_ModelFile
protected GlobalActorReference m_ModelActor
protected T m_Model
protected boolean m_OnTheFly
| Constructor Detail |
|---|
public AbstractProcessWekaInstanceWithModel()
| Method Detail |
|---|
public void defineOptions()
defineOptions in interface OptionHandlerdefineOptions in class AbstractActorpublic void setModelFile(PlaceholderFile value)
value - the model filepublic PlaceholderFile getModelFile()
public String modelFileTipText()
public void setModelActor(GlobalActorReference value)
value - the actor referencepublic GlobalActorReference getModelActor()
public String modelActorTipText()
public void setOnTheFly(boolean value)
value - if true then the model does not have to be present at
start up timepublic boolean getOnTheFly()
public String onTheFlyTipText()
public String getQuickInfo()
getQuickInfo in interface QuickInfoSupportergetQuickInfo in class AbstractActorpublic Class[] accepts()
public abstract Class[] generates()
protected void pruneBackup()
pruneBackup in class AbstractActorprotected Hashtable<String,Object> backupState()
backupState in class AbstractTransformerprotected void restoreState(Hashtable<String,Object> state)
restoreState in class AbstractTransformerstate - the backup of the state to restore fromprotected String setUpModel()
public String setUp()
setUp in class AbstractActor
protected abstract Token processInstance(weka.core.Instance inst)
throws Exception
inst - the instance to process
Exception - if processing failsprotected String doExecute()
doExecute in class AbstractActorpublic void wrapUp()
wrapUp in class AbstractTransformer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||