Class ValidationMethod

java.lang.Object
es.upm.fi.cig.multictbnc.performance.ValidationMethod
Direct Known Subclasses:
CrossValidationBinaryRelevanceMethod, CrossValidationMethod, HoldOutMethod, TestDatasetBinaryRelevanceMethod, TestDatasetMethod

public abstract class ValidationMethod extends Object
Abstract class defining common methods for validation algorithms.
  • Constructor Details

    • ValidationMethod

      public ValidationMethod()
  • Method Details

    • displayModel

      public void displayModel(MultiCTBNC<?,?> model)
      Displays the model obtained with the validation method.
      Parameters:
      model - obtained model
    • displayResults

      public void displayResults(Map<String,Double> results)
      Displays the results obtained with the validation method.
      Parameters:
      results - a Map with the results of the validation method
    • evaluate

      public abstract Map<String,Double> evaluate(MultiCTBNC<?,?> model) throws UnreadDatasetException, ErroneousValueException
      Evaluates 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 dataset
      ErroneousValueException - if a provided parameter is erroneous for the requested task
    • evaluate

      public abstract Map<String,Double> evaluate(MultiCTBNC<?,?> model, double preprocessingExecutionTime) throws UnreadDatasetException, ErroneousValueException
      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.
      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
    • setWriter

      public void setWriter(MetricsWriter metricsWriter)
      Defines the metrics writer used to save the results of the evaluation.
      Parameters:
      metricsWriter - a MetricsWriter used to save the results of the evaluation