Constructor and Description |
---|
SimpleEvaluator()
Construct a simple evaluator.
|
SimpleEvaluator(Properties props)
Create a simple evaluator with a custom configuration.
|
Modifier and Type | Method and Description |
---|---|
SimpleEvaluator |
addAlgorithm(AlgorithmInstance algo)
Adds an algorithmInfo to the
TrainTestEvalCommand being built. |
SimpleEvaluator |
addAlgorithm(AlgorithmInstanceBuilder algo)
Adds a fully configured algorithmInfo command to the
TrainTestEvalCommand being built. |
SimpleEvaluator |
addAlgorithm(String name,
LenskitConfiguration config)
An algorithm instance constructed with a name and Lenskit configuration
|
SimpleEvaluator |
addDataset(CrossfoldTask cross)
Calls the
CrossfoldCommand and adds the resulting TTDataSet s to the TrainTestEvalCommand . |
SimpleEvaluator |
addDataset(DataSource train,
DataSource test)
This constructs a new
TTDataSet and passes it to the TrainTestEvalCommand . |
SimpleEvaluator |
addDataset(DataSource source,
int partitions)
Add a new data set to be cross-folded.
|
SimpleEvaluator |
addDataset(DataSource source,
int partitions,
double holdout)
Add a new data set to be cross-folded.
|
SimpleEvaluator |
addDataset(String name,
DataSource source,
int partitions)
Add a new data set to be cross-folded.
|
SimpleEvaluator |
addDataset(String name,
DataSource source,
int partitions,
double holdout)
Add a new data set to be cross-folded.
|
SimpleEvaluator |
addDataset(String name,
EventDAO train,
EventDAO test,
PreferenceDomain dom)
This constructs a new
TTDataSet and passes it to the TrainTestEvalCommand . |
SimpleEvaluator |
addDataset(TTDataSet data)
Adds a single
TTDataSet to the TrainTestEvalCommand . |
<T> SimpleEvaluator |
addMetric(Class<? extends Metric<T>> metric)
Adds a completed metric to the
TrainTestEvalCommand |
SimpleEvaluator |
addMetric(Metric<?> metric)
Adds a completed metric to the
TrainTestEvalCommand |
Table |
call()
If this is called more than once it will call of these commands again and most likely throw an exception.
|
EvalConfig |
getEvalConfig() |
TrainTestEvalTask |
getRawCommand()
Provides raw unrestricted access for the command.
|
SimpleEvaluator |
setOutput(File file)
This provides a wrapper around
TrainTestEvalCommand.setOutput() |
SimpleEvaluator |
setOutputPath(String path)
Creates a new file with the
name and passes it to
TrainTestEvalCommand.setOutput() |
SimpleEvaluator |
setPredictOutput(File file)
This provides a wrapper around
TrainTestEvalCommand.setPredictOutput |
SimpleEvaluator |
setPredictOutputPath(String path)
Creates a new file with the
name and passes it to
TrainTestEvalCommand.setPredictOutput() |
SimpleEvaluator |
setUserOutput(File file)
This provides a wrapper around
TrainTestEvalCommand.setUserOutput |
SimpleEvaluator |
setUserOutputPath(String path)
Creates a new file with the
name and passes it to
TrainTestEvalCommand.setUserOutput() |
public SimpleEvaluator()
public SimpleEvaluator(Properties props)
props
- Properties for the eval configuration.public EvalConfig getEvalConfig()
public SimpleEvaluator addAlgorithm(AlgorithmInstance algo)
TrainTestEvalCommand
being built.
If any exception is thrown while the command is called it is rethrown as a runtime error.algo
- The algorithmInfo added to the TrainTestEvalCommand
public SimpleEvaluator addAlgorithm(String name, LenskitConfiguration config)
name
- config
- Lenskit configurationpublic SimpleEvaluator addAlgorithm(AlgorithmInstanceBuilder algo)
TrainTestEvalCommand
being built.algo
- The algorithmInfo added to the TrainTestEvalCommand
public SimpleEvaluator addDataset(CrossfoldTask cross)
CrossfoldCommand
and adds the resulting TTDataSet
s to the TrainTestEvalCommand
.
Any exceptions that are thrown are wrapped as RuntimeExceptions
.cross
- public SimpleEvaluator addDataset(String name, DataSource source, int partitions, double holdout)
CrossfoldTask
and passes it to addDataset(CrossfoldTask)
. All crossfold parameters that are not
taken as arguments by this method are left at their defaults.name
- The name of the crossfoldsource
- The source for the crossfoldpartitions
- The number of partitionsholdout
- The holdout fractionpublic SimpleEvaluator addDataset(DataSource source, int partitions, double holdout)
CrossfoldTask
and passes it to addDataset(CrossfoldTask)
. All crossfold parameters that are not
taken as arguments by this method are left at their defaults.source
- The source for the crossfoldpartitions
- The number of partitionsholdout
- The holdout fractionpublic SimpleEvaluator addDataset(String name, DataSource source, int partitions)
CrossfoldTask
and passes it to addDataset(CrossfoldTask)
. All crossfold parameters that are not
taken as arguments by this method are left at their defaults.
Note: Prior to LensKit 2.2, this method used a holdout fraction of 0.2. In
LensKit 2.2, it was changed to use the CrossfoldTask
's default holdout.
name
- The name of the crossfoldsource
- The source for the crossfoldpartitions
- The number of partitionspublic SimpleEvaluator addDataset(DataSource source, int partitions)
CrossfoldTask
and passes it to addDataset(CrossfoldTask)
. All crossfold parameters that are not
taken as arguments by this method are left at their defaults.
Note: Prior to LensKit 2.2, this method used a holdout fraction of 0.2. In
LensKit 2.2, it was changed to use the CrossfoldTask
's default holdout.
source
- The source for the crossfoldpartitions
- The number of partitionspublic SimpleEvaluator addDataset(TTDataSet data)
TTDataSet
to the TrainTestEvalCommand
.
This acts a wrapper around TrainTestEvalCommand.addDataset
data
- The dataset to be added to the command.public SimpleEvaluator addDataset(String name, EventDAO train, EventDAO test, PreferenceDomain dom)
TTDataSet
and passes it to the TrainTestEvalCommand
.name
- The name of the new dataset.train
- The DAOFactory
with the train data.test
- The DAOFactory
with the test data.dom
- The PreferenceDomain
to be supplied to the new TTDataSet
public SimpleEvaluator addDataset(DataSource train, DataSource test)
TTDataSet
and passes it to the TrainTestEvalCommand
.
The name for the data source will default to 'generic-data-source'. Because of this,
be careful of calling this method more than once.train
- The DAOFactory
with the train data.test
- The DAOFactory
with the test data.public SimpleEvaluator addMetric(Metric<?> metric)
TrainTestEvalCommand
metric
- The metric to be added.public <T> SimpleEvaluator addMetric(Class<? extends Metric<T>> metric)
TrainTestEvalCommand
metric
- The metric to be added.public SimpleEvaluator setOutput(File file)
TrainTestEvalCommand.setOutput()
file
- The file set as the output of the commandpublic SimpleEvaluator setPredictOutput(File file)
TrainTestEvalCommand.setPredictOutput
file
- The file set as the prediction output.public SimpleEvaluator setUserOutput(File file)
TrainTestEvalCommand.setUserOutput
file
- The file set as the prediction user.public SimpleEvaluator setOutputPath(String path)
name
and passes it to
TrainTestEvalCommand.setOutput()
path
- The path to the file to be createdpublic SimpleEvaluator setPredictOutputPath(String path)
name
and passes it to
TrainTestEvalCommand.setPredictOutput()
path
- The path to the file to be createdpublic SimpleEvaluator setUserOutputPath(String path)
name
and passes it to
TrainTestEvalCommand.setUserOutput()
path
- The path to the file to be createdpublic TrainTestEvalTask getRawCommand()
TrainTestDataSet
can force this command to throw
an exception farther down the line.public Table call() throws TaskExecutionException
call
in interface Callable<Table>
TaskExecutionException