Module es.upm.fi.cig.multictbnc
Class CrossValidationBinaryRelevanceMethod
java.lang.Object
es.upm.fi.cig.multictbnc.performance.ValidationMethod
es.upm.fi.cig.multictbnc.performance.CrossValidationBinaryRelevanceMethod
Implements a cross-validation method used to learn one CTBNC for each class variable and merge the results.
-
Constructor Summary
ConstructorDescriptionCrossValidationBinaryRelevanceMethod
(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
-
CrossValidationBinaryRelevanceMethod
public CrossValidationBinaryRelevanceMethod(DatasetReader datasetReader, int folds, boolean estimateProbabilities, boolean shuffle, long seed) throws UnreadDatasetException 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- Throws:
UnreadDatasetException
- if the provided dataset could not be read
-
-
Method Details
-
evaluate
Evaluates 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
-
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
-