public class BatchModelEvaluator extends java.lang.Object implements Commandable, Options
Usage: $<model> <batch size>
Implemented Commands
run $<data> - Evaluate a model in batch model
add $<data> $<generator> [<include|exclude> $<filter>]
- Generate entries, run them using a model, and add them to a dataset if
they pass a filter
Constructor and Description |
---|
BatchModelEvaluator() |
Modifier and Type | Method and Description |
---|---|
void |
evaluate(Dataset data)
Evaluate the model on a dataset in batch mode.
|
void |
evaluate(Dataset data,
BaseEntryGenerator generator,
BaseDatasetFilter filter)
Generate entries and store them in a dataset.
|
java.util.List<BaseEntry> |
getSubList()
Get list of entries to be evaluated
|
java.lang.String |
printUsage()
Print out required format for options.
|
protected void |
processEntries(java.util.List<BaseEntry> entries,
java.util.Map<java.lang.String,java.lang.Object> threadData)
Operation to be performed on a batch of entries
|
protected java.util.List<BaseEntry> |
runAndFilter(BaseModel model,
Dataset data,
BaseDatasetFilter filter)
Create entries, evaluate them, filter out acceptable candidates
|
java.lang.Object |
runCommand(java.util.List<java.lang.Object> Command)
Process some command described by a list of Objects.
|
protected void |
setAttributeComputer(Dataset dataset)
Set dataset used to generate attributes
|
void |
setBatchSize(int size)
Define how many entries to evaluate at once.
|
protected void |
setDataset(Dataset data)
Set dataset to be evaluated.
|
protected void |
setEntryIterator(java.util.Iterator<BaseEntry> iterator)
Set iterator over entries to be acted on
|
void |
setModel(BaseModel model)
Define which model this class is used to evaluate
|
void |
setOptions(java.util.List<java.lang.Object> Options)
Set any options for this object.
|
public void setOptions(java.util.List<java.lang.Object> Options) throws java.lang.Exception
Options
setOptions
in interface Options
Options
- Array of options as Objects - can be null
java.lang.Exception
- if problem with inputspublic java.lang.String printUsage()
Options
printUsage
in interface Options
public void setModel(BaseModel model)
model
- Model to be evaluatedpublic void setBatchSize(int size)
size
- Desired batch sizeprotected void setAttributeComputer(Dataset dataset)
dataset
- Dataset used to generate attributesprotected void setEntryIterator(java.util.Iterator<BaseEntry> iterator)
iterator
- Iterator over entries being acted onprotected void setDataset(Dataset data)
data
- Dataset to be evaluatedpublic void evaluate(Dataset data, BaseEntryGenerator generator, BaseDatasetFilter filter) throws java.lang.Exception
data
- Dataset to be added togenerator
- Generator for creating entriesfilter
- Filter to be used before adding entries to datajava.lang.Exception
public void evaluate(Dataset data) throws java.lang.Exception
data
- Dataset to be evaluatedjava.lang.Exception
protected void processEntries(java.util.List<BaseEntry> entries, java.util.Map<java.lang.String,java.lang.Object> threadData) throws java.lang.Exception
entries
- Entries to be processedthreadData
- Copy of objects belonging to this threadjava.lang.Exception
protected java.util.List<BaseEntry> runAndFilter(BaseModel model, Dataset data, BaseDatasetFilter filter) throws java.lang.Exception
model
- Model to be rundata
- Empty dataset used to compute attributesfilter
- Filter to be used to select best attributes. null to not
filter results. Can be nulljava.lang.Exception
public java.util.List<BaseEntry> getSubList()
public java.lang.Object runCommand(java.util.List<java.lang.Object> Command) throws java.lang.Exception
Commandable
runCommand
in interface Commandable
Command
- Command as a list of objectsjava.lang.Exception
- If something goes wrong