Module es.upm.fi.cig.multictbnc
Class CrossValidationMethod
java.lang.Object
es.upm.fi.cig.multictbnc.performance.ValidationMethod
es.upm.fi.cig.multictbnc.performance.CrossValidationMethod
Implements cross-validation method.
-
Constructor Summary
ConstructorDescriptionCrossValidationMethod
(DatasetReader datasetReader, int folds, boolean estimateProbabilities, boolean shuffle, Long seed) Constructor for cross-validation method. -
Method Summary
Modifier and TypeMethodDescriptionevaluate
(MultiCTBNC<?, ?> model) Evaluates the performance of the specified model using cross-validation.evaluate
(MultiCTBNC<?, ?> model, double preprocessingExecutionTime) Evaluates the performance of the specified model and returns the results.Methods inherited from class es.upm.fi.cig.multictbnc.performance.ValidationMethod
displayModel, displayResults, setWriter
-
Constructor Details
-
CrossValidationMethod
public CrossValidationMethod(DatasetReader datasetReader, int folds, boolean estimateProbabilities, boolean shuffle, Long seed) Constructor for cross-validation method.- Parameters:
datasetReader
- aDatasetReader
to read the datasetfolds
- number of foldsestimateProbabilities
- true to estimate the probabilities of the class configurations, false otherwiseshuffle
- true to shuffle the sequences, false otherwiseseed
- seed used to shuffle the sequences
-
-
Method Details
-
evaluate
public Map<String,Double> evaluate(MultiCTBNC<?, ?> model) throws UnreadDatasetException, ErroneousValueExceptionEvaluates the performance of the specified model using cross-validation.- Specified by:
evaluate
in classValidationMethod
- Parameters:
model
- model to evaluate- Returns:
- the results of the cross-validation in a
Map
- Throws:
UnreadDatasetException
- if the provided dataset could not be readErroneousValueException
- if a provided parameter is erroneous for the requested task
-
evaluate
public Map<String,Double> evaluate(MultiCTBNC<?, ?> model, double preprocessingExecutionTime) throws UnreadDatasetException, ErroneousValueExceptionDescription copied from class:ValidationMethod
Evaluates 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.- Specified by:
evaluate
in classValidationMethod
- 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
-