| Constructor and Description |
|---|
RecommendEvalTask()
Create a new recommend eval task.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMetric(TopNMetric<?> 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 RecommendEvalTask |
fromJSON(com.fasterxml.jackson.databind.JsonNode json,
URI base)
Parse a recommend task from JSON.
|
List<Metric<?>> |
getAllMetrics()
Get the list of all metrics.
|
ItemSelector |
getCandidateSelector()
Get the active candidate selector.
|
ItemSelector |
getExcludeSelector()
Get the active exclude selector.
|
List<String> |
getGlobalColumns()
Get columns that will go in the aggregate output file.
|
String |
getLabelPrefix()
Get the prefix applied to column labels.
|
int |
getListSize()
Get the list size to use.
|
Path |
getOutputFile()
Get the output file for writing predictions.
|
Set<Class<?>> |
getRequiredRoots()
Get the root types required by this evaluation.
|
List<TopNMetric<?>> |
getTopNMetrics()
Get the list of prediction metrics.
|
List<String> |
getUserColumns()
Get columns that will go in the per-user output file.
|
void |
setCandidateSelector(ItemSelector sel)
Set the candidate selector.
|
void |
setExcludeSelector(ItemSelector sel)
Set the exclude selector.
|
void |
setLabelPrefix(String prefix)
Set the prefix applied to column labels.
|
void |
setListSize(int n)
Set the list size to use.
|
void |
setOutputFile(Path file)
Set the output file for predictions.
|
void |
start(ExperimentOutputLayout outputLayout)
Do initial setup for this eval task.
|
public static RecommendEvalTask fromJSON(com.fasterxml.jackson.databind.JsonNode json, URI base) throws IOException
Parse a recommend task from JSON.
json - The JSON data.base - The base URI (for resolving relative paths).IOException - If there is an I/O error.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 String getLabelPrefix()
Get the prefix applied to column labels.
public void setLabelPrefix(String prefix)
Set the prefix applied to column labels. If provided, it will be prepended to column labels from this task, along with a “.”.
prefix - The label prefix.public int getListSize()
Get the list size to use.
public void setListSize(int n)
Set the list size to use.
n - The number of items to recommend per user.public ItemSelector getCandidateSelector()
Get the active candidate selector.
public void setCandidateSelector(ItemSelector sel)
Set the candidate selector.
sel - The candidate selector.public ItemSelector getExcludeSelector()
Get the active exclude selector.
public void setExcludeSelector(ItemSelector sel)
Set the exclude selector.
sel - The exclude selector.public List<TopNMetric<?>> getTopNMetrics()
Get the list of prediction metrics.
public List<Metric<?>> getAllMetrics()
Get the list of all metrics.
public void addMetric(TopNMetric<?> metric)
Add a prediction metric.
metric - The metric to add.public Set<Class<?>> getRequiredRoots()
EvalTaskGet the root types required by this evaluation.
getRequiredRoots in interface EvalTaskpublic List<String> getGlobalColumns()
EvalTaskGet columns that will go in the aggregate output file.
getGlobalColumns in interface EvalTaskpublic List<String> getUserColumns()
EvalTaskGet columns that will go in the per-user output file.
getUserColumns in interface EvalTaskpublic void start(ExperimentOutputLayout outputLayout)
EvalTaskDo initial setup for this eval task. This should create any per-task output files, etc.
public void finish()
EvalTaskFinalize this eval task. This should finish writing and close any per-task output files, etc.
public ConditionEvaluator createConditionEvaluator(AlgorithmInstance algorithm, DataSet dataSet, Recommender rec)
EvalTaskSet up a measurement of a single recommender.
createConditionEvaluator in interface EvalTaskalgorithm - The algorithm being evaluated.dataSet - The data set being evaluated.rec - The recommender to measure.