java.lang.Object
es.upm.fi.cig.multictbnc.performance.ValidationMethod
- Direct Known Subclasses:
CrossValidationBinaryRelevanceMethod
,CrossValidationMethod
,HoldOutMethod
,TestDatasetBinaryRelevanceMethod
,TestDatasetMethod
Abstract class defining common methods for validation algorithms.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
displayModel
(MultiCTBNC<?, ?> model) Displays the model obtained with the validation method.void
displayResults
(Map<String, Double> results) Displays the results obtained with the validation method.evaluate
(MultiCTBNC<?, ?> model) Evaluates the performance of the specified model and returns the results.evaluate
(MultiCTBNC<?, ?> model, double preprocessingExecutionTime) Evaluates the performance of the specified model and returns the results.void
setWriter
(MetricsWriter metricsWriter) Defines the metrics writer used to save the results of the evaluation.
-
Constructor Details
-
ValidationMethod
public ValidationMethod()
-
-
Method Details
-
displayModel
Displays the model obtained with the validation method.- Parameters:
model
- obtained model
-
displayResults
Displays the results obtained with the validation method.- Parameters:
results
- aMap
with the results of the validation method
-
evaluate
public abstract Map<String,Double> evaluate(MultiCTBNC<?, ?> model) throws UnreadDatasetException, ErroneousValueExceptionEvaluates the performance of the specified model and returns the results.- Parameters:
model
- model to evaluate- Returns:
- results saved in a
Map
. - Throws:
UnreadDatasetException
- if there was an error while reading a datasetErroneousValueException
- if a provided parameter is erroneous for the requested task
-
evaluate
public abstract Map<String,Double> evaluate(MultiCTBNC<?, ?> model, double preprocessingExecutionTime) throws UnreadDatasetException, ErroneousValueExceptionEvaluates the performance of the specified model and returns the results. This method receives the execution time of previous tasks so it is add up to the total mean learning time.- Parameters:
model
- model to evaluatepreprocessingExecutionTime
- execution time of previous tasks- Returns:
- results saved in a
Map
. - Throws:
UnreadDatasetException
- if there was an error while reading a datasetErroneousValueException
- if a provided parameter is erroneous for the requested task
-
setWriter
Defines the metrics writer used to save the results of the evaluation.- Parameters:
metricsWriter
- aMetricsWriter
used to save the results of the evaluation
-