Class LinkPredictionMetricParametersReader

java.lang.Object
es.uam.eps.ir.relison.grid.ParametersReader
es.uam.eps.ir.relison.grid.links.prediction.metrics.LinkPredictionMetricParametersReader

public class LinkPredictionMetricParametersReader
extends ParametersReader
Class for reading contact recommendation metrics. For each metric, it reads a single configuration.
File format:
metrics:
metric_name:
param1: ...
See Also:
ParametersReader
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private static java.lang.String METRICS  
    private java.util.Map<java.lang.String,​Parameters> metricsGrid
    Metric parameters.
  • Constructor Summary

    Constructors 
    Constructor Description
    LinkPredictionMetricParametersReader()
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    java.util.Set<java.lang.String> getMetric()
    Gets the set of metrics previously read.
    Parameters getParameters​(java.lang.String metric)
    Gets the grid for a given metric
    void read​(java.util.Map<java.lang.String,​java.lang.Object> map)
    Obtains the metric parameters for different recommendation metrics.
    private void readMetric​(java.util.Map.Entry<java.lang.String,​java.lang.Object> element)
    Reads the parameters for a single metric.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • read

      public void read​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Obtains the metric parameters for different recommendation metrics.
      Parameters:
      map - the map containing the metric configuration.
    • readMetric

      private void readMetric​(java.util.Map.Entry<java.lang.String,​java.lang.Object> element)
      Reads the parameters for a single metric.
      Parameters:
      element - a map containing the information in the YAML file about the metric.
    • getMetric

      public java.util.Set<java.lang.String> getMetric()
      Gets the set of metrics previously read.
      Returns:
      The set of metrics previously read from the grid file.
    • getParameters

      public Parameters getParameters​(java.lang.String metric)
      Gets the grid for a given metric
      Parameters:
      metric - the metric to search
      Returns:
      the grid if exists, an empty grid if not.