Class CrossValidationBinaryRelevanceMethod

java.lang.Object
es.upm.fi.cig.multictbnc.performance.ValidationMethod
es.upm.fi.cig.multictbnc.performance.CrossValidationBinaryRelevanceMethod

public class CrossValidationBinaryRelevanceMethod extends ValidationMethod
Implements a cross-validation method used to learn one CTBNC for each class variable and merge the results.
  • Constructor Details

    • CrossValidationBinaryRelevanceMethod

      public CrossValidationBinaryRelevanceMethod(DatasetReader datasetReader, int folds, boolean estimateProbabilities, boolean shuffle, long seed) throws UnreadDatasetException
      Constructor for cross-validation method.
      Parameters:
      datasetReader - a DatasetReader to read the dataset
      folds - number of folds
      estimateProbabilities - true to estimate the probabilities of the class configurations, false otherwise
      shuffle - true to shuffle the sequences, false otherwise
      seed - seed used to shuffle the sequences
      Throws:
      UnreadDatasetException - if the provided dataset could not be read
  • Method Details

    • evaluate

      public Map<String,Double> evaluate(MultiCTBNC<?,?> model)
      Evaluates the performance of the specified model using cross-validation.
      Specified by:
      evaluate in class ValidationMethod
      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, ErroneousValueException
      Description 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 class ValidationMethod
      Parameters:
      model - model to evaluate
      preprocessingExecutionTime - execution time of previous tasks
      Returns:
      results saved in a Map.
      Throws:
      UnreadDatasetException - if there was an error while reading a dataset
      ErroneousValueException - if a provided parameter is erroneous for the requested task