org.encog.app.analyst
Class EncogAnalyst
- java.lang.Object
-
- org.encog.app.analyst.EncogAnalyst
-
public class EncogAnalyst extends java.lang.ObjectThe Encog Analyst runs Encog Analyst Script files (EGA) to perform many common machine learning tasks. It is very much like Maven or ANT for Encog. Encog analyst files are made up of configuration information and tasks. Tasks are series of commands that make use of the configuration information to process CSV files.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringTASK_FULLThe name of the task that SHOULD everything.static intUPDATE_TIMEThe update time for a download.
-
Constructor Summary
Constructors Constructor and Description EncogAnalyst()Construct the Encog analyst.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddAnalystListener(AnalystListener listener)Add a listener.voidaddCommand(Cmd cmd)Add a command.voidanalyze(java.io.File file, boolean headers, AnalystFileFormat format)Analyze the specified file.intdetermineInputCount()Determine the input count.intdetermineInputFieldCount()Determine the input field count, the fields are higher-level than columns.intdetermineMaxTimeSlice()intdetermineMinTimeSlice()intdetermineOutputCount()Determine the output count, this is the number of output columns needed.intdetermineOutputFieldCount()Determine the number of output fields.intdetermineTotalColumns()intdetermineTotalInputFieldCount()Determine the total input field count, minus ignored fields.intdetermineUniqueColumns()Determine how many unique columns there are.intdetermineUniqueInputFieldCount()Determine the unique input field count.intdetermineUniqueOutputFieldCount()Determine the unique output field count.voiddownload()Download a raw file from the Internet.voidexecuteTask(AnalystTask task)Execute a task.voidexecuteTask(java.lang.String name)Execute a task.intgetLagDepth()intgetLeadDepth()java.util.List<AnalystListener>getListeners()intgetMaxIteration()MLMethodgetMethod()java.util.Map<java.lang.String,java.lang.String>getRevertData()AnalystScriptgetScript()AnalystUtilitygetUtility()booleanisTimeSeries()voidload(java.io.File file)Load the specified script file.voidload(java.io.InputStream stream)Load from an input stream.voidload(java.lang.String filename)Load from the specified filename.voidreanalyze(java.io.File file, boolean headers, AnalystFileFormat format)Analyze the specified file.voidremoveAnalystListener(AnalystListener listener)Remove a listener.voidreportTraining(MLTrain train)Report training.voidreportTrainingBegin()Report that training has begun.voidreportTrainingEnd()Report that training has ended.voidsave(java.io.File file)Save the script to a file.voidsave(java.io.OutputStream stream)Save the script to a stream.voidsave(java.lang.String filename)Save the script to a filename.voidsetCurrentQuantTask(QuantTask task)Set the current task.voidsetMaxIteration(int i)Set the max iterations.voidsetMethod(MLMethod method)booleanshouldStopCommand()Should the current command be stopped.voidstopCurrentTask()Stop the current task.
-
-
-
Field Detail
-
TASK_FULL
public static final java.lang.String TASK_FULL
The name of the task that SHOULD everything.- See Also:
- Constant Field Values
-
UPDATE_TIME
public static final int UPDATE_TIME
The update time for a download.- See Also:
- Constant Field Values
-
-
Method Detail
-
addAnalystListener
public void addAnalystListener(AnalystListener listener)
Add a listener.- Parameters:
listener- The listener to add.
-
addCommand
public void addCommand(Cmd cmd)
Add a command.- Parameters:
cmd- The command to add.
-
analyze
public void analyze(java.io.File file, boolean headers, AnalystFileFormat format)Analyze the specified file. Used by the wizard.- Parameters:
file- The file to analyze.headers- True if headers are present.format- The format of the file.
-
reanalyze
public void reanalyze(java.io.File file, boolean headers, AnalystFileFormat format)Analyze the specified file. Used by the wizard.- Parameters:
file- The file to analyze.headers- True if headers are present.format- The format of the file.
-
determineInputCount
public int determineInputCount()
Determine the input count. This is the actual number of columns.- Returns:
- The input count.
-
determineInputFieldCount
public int determineInputFieldCount()
Determine the input field count, the fields are higher-level than columns.- Returns:
- The input field count.
-
determineOutputCount
public int determineOutputCount()
Determine the output count, this is the number of output columns needed.- Returns:
- The output count.
-
determineOutputFieldCount
public int determineOutputFieldCount()
Determine the number of output fields. Fields are higher level than columns.- Returns:
- The output field count.
-
determineUniqueColumns
public int determineUniqueColumns()
Determine how many unique columns there are. Timeslices are not counted multiple times.- Returns:
- The number of columns.
-
determineUniqueInputFieldCount
public int determineUniqueInputFieldCount()
Determine the unique input field count. Timeslices are not counted multiple times.- Returns:
- The number of unique input fields.
-
determineTotalInputFieldCount
public int determineTotalInputFieldCount()
Determine the total input field count, minus ignored fields.- Returns:
- The number of unique input fields.
-
determineUniqueOutputFieldCount
public int determineUniqueOutputFieldCount()
Determine the unique output field count. Do not count timeslices multiple times.- Returns:
- The unique output field count.
-
download
public void download()
Download a raw file from the Internet.
-
executeTask
public void executeTask(AnalystTask task)
Execute a task.- Parameters:
task- The task to execute.
-
executeTask
public void executeTask(java.lang.String name)
Execute a task.- Parameters:
name- The name of the task to execute.
-
getLagDepth
public int getLagDepth()
- Returns:
- The lag depth.
-
getLeadDepth
public int getLeadDepth()
- Returns:
- The lead depth.
-
getListeners
public java.util.List<AnalystListener> getListeners()
- Returns:
- the listeners
-
getMaxIteration
public int getMaxIteration()
- Returns:
- The max iterations.
-
getRevertData
public java.util.Map<java.lang.String,java.lang.String> getRevertData()
- Returns:
- The reverted data.
-
getScript
public AnalystScript getScript()
- Returns:
- the script
-
load
public void load(java.io.File file)
Load the specified script file.- Parameters:
file- The file to load.
-
load
public void load(java.io.InputStream stream)
Load from an input stream.- Parameters:
stream- The stream to load from.
-
load
public void load(java.lang.String filename)
Load from the specified filename.- Parameters:
filename- The filename to load from.
-
removeAnalystListener
public void removeAnalystListener(AnalystListener listener)
Remove a listener.- Parameters:
listener- The listener to remove.
-
reportTraining
public void reportTraining(MLTrain train)
Report training.- Parameters:
train- The trainer.
-
reportTrainingBegin
public void reportTrainingBegin()
Report that training has begun.
-
reportTrainingEnd
public void reportTrainingEnd()
Report that training has ended.
-
save
public void save(java.io.File file)
Save the script to a file.- Parameters:
file- The file to save to.
-
save
public void save(java.io.OutputStream stream)
Save the script to a stream.- Parameters:
stream- The stream to save to.
-
save
public void save(java.lang.String filename)
Save the script to a filename.- Parameters:
filename- The filename to save to.
-
setCurrentQuantTask
public void setCurrentQuantTask(QuantTask task)
Set the current task.- Parameters:
task- The current task.
-
setMaxIteration
public void setMaxIteration(int i)
Set the max iterations.- Parameters:
i- The value for max iterations.
-
shouldStopCommand
public boolean shouldStopCommand()
Should the current command be stopped.- Returns:
- True if the current command should be stopped.
-
stopCurrentTask
public void stopCurrentTask()
Stop the current task.
-
isTimeSeries
public boolean isTimeSeries()
- Returns:
- True, if any field has a time slice.
-
getMethod
public MLMethod getMethod()
- Returns:
- the method
-
setMethod
public void setMethod(MLMethod method)
- Parameters:
method- the method to set
-
determineTotalColumns
public int determineTotalColumns()
-
determineMaxTimeSlice
public int determineMaxTimeSlice()
-
determineMinTimeSlice
public int determineMinTimeSlice()
-
getUtility
public AnalystUtility getUtility()
- Returns:
- the utility
-
-
DMelt 3.0 © DataMelt by jWork.ORG