Constructor and Description |
---|
PredictEvalTask()
Create a new eval task.
|
Modifier and Type | Method and Description |
---|---|
void |
addMetric(PredictMetric<?> metric)
Add a prediction metric.
|
ConditionEvaluator |
createConditionEvaluator(AlgorithmInstance algorithm,
DataSet dataSet,
Recommender rec)
Set up a measurement of a single recommender.
|
void |
finish()
Finalize this eval task.
|
static PredictEvalTask |
fromJSON(com.fasterxml.jackson.databind.JsonNode json,
URI base)
Create a predict eval task from a JSON/YAML file.
|
List<Metric<?>> |
getAllMetrics()
Get the list of all metrics.
|
List<String> |
getGlobalColumns()
Get columns that will go in the aggregate output file.
|
Path |
getOutputFile()
Get the output file for writing predictions.
|
List<PredictMetric<?>> |
getPredictMetrics()
Get the list of prediction metrics.
|
Set<Class<?>> |
getRequiredRoots()
Get the root types required by this evaluation.
|
List<String> |
getUserColumns()
Get columns that will go in the per-user output file.
|
void |
setOutputFile(Path file)
Set the output file for predictions.
|
void |
start(ExperimentOutputLayout outputLayout)
Do initial setup for this eval task.
|
public static PredictEvalTask fromJSON(com.fasterxml.jackson.databind.JsonNode json, URI base) throws IOException
Create a predict eval task from a JSON/YAML file.
json
- The task specification.base
- The base URI from which json
came, used for resolving relative paths.IOException
public Path getOutputFile()
Get the output file for writing predictions.
null
if no file is configured.public void setOutputFile(Path file)
Set the output file for predictions.
file
- The output file for writing predictions. Will get a CSV file.public List<PredictMetric<?>> getPredictMetrics()
Get the list of prediction metrics.
public List<Metric<?>> getAllMetrics()
Get the list of all metrics.
public void addMetric(PredictMetric<?> metric)
Add a prediction metric.
metric
- The metric to add.public Set<Class<?>> getRequiredRoots()
EvalTask
Get the root types required by this evaluation.
getRequiredRoots
in interface EvalTask
public List<String> getGlobalColumns()
EvalTask
Get columns that will go in the aggregate output file.
getGlobalColumns
in interface EvalTask
public List<String> getUserColumns()
EvalTask
Get columns that will go in the per-user output file.
getUserColumns
in interface EvalTask
public void start(ExperimentOutputLayout outputLayout)
EvalTask
Do initial setup for this eval task. This should create any per-task output files, etc.
public void finish()
EvalTask
Finalize this eval task. This should finish writing and close any per-task output files, etc.
public ConditionEvaluator createConditionEvaluator(AlgorithmInstance algorithm, DataSet dataSet, Recommender rec)
EvalTask
Set up a measurement of a single recommender.
createConditionEvaluator
in interface EvalTask
algorithm
- The algorithm being evaluated.dataSet
- The data set being evaluated.rec
- The recommender to measure.