Module es.upm.fi.cig.multictbnc
Class TestDatasetBinaryRelevanceMethod
java.lang.Object
es.upm.fi.cig.multictbnc.performance.ValidationMethod
es.upm.fi.cig.multictbnc.performance.TestDatasetBinaryRelevanceMethod
Implements a validation method for evaluating CTBNCs using a test. This method involves training separate models
for each class variable and then combining their predictions to evaluate the overall performance of the model on
the test dataset.
-
Constructor Summary
ConstructorsConstructorDescriptionTestDatasetBinaryRelevanceMethod
(DatasetReader trainingDatasetReader, DatasetReader testDatasetReader, boolean estimateProbabilities) Constructor that receives the dataset readers and configuration. -
Method Summary
Modifier and TypeMethodDescriptionevaluate
(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.Methods inherited from class es.upm.fi.cig.multictbnc.performance.ValidationMethod
displayModel, displayResults, setWriter
-
Constructor Details
-
TestDatasetBinaryRelevanceMethod
public TestDatasetBinaryRelevanceMethod(DatasetReader trainingDatasetReader, DatasetReader testDatasetReader, boolean estimateProbabilities) throws UnreadDatasetException Constructor that receives the dataset readers and configuration.- Parameters:
trainingDatasetReader
- reader for the training datasettestDatasetReader
- reader for the test datasetestimateProbabilities
- flag indicating if probabilities should be estimated- Throws:
UnreadDatasetException
- if the dataset cannot be read
-
-
Method Details
-
evaluate
public Map<String,Double> evaluate(MultiCTBNC<?, ?> model) throws UnreadDatasetException, ErroneousValueExceptionDescription copied from class:ValidationMethod
Evaluates the performance of the specified model and returns the results.- Specified by:
evaluate
in classValidationMethod
- 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 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
-