Class LinkPredictionMetricGridReader
java.lang.Object
es.uam.eps.ir.relison.grid.GridReader
es.uam.eps.ir.relison.grid.links.prediction.metrics.LinkPredictionMetricGridReader
public class LinkPredictionMetricGridReader extends GridReader
Class for reading contact recommendation metrics..
For each metric, a grid of parameters is read.
File format:
metrics:
metric_name:
param1: ...
File format:
metrics:
metric_name:
param1: ...
- See Also:
GridReader
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
METRICS
private java.util.Map<java.lang.String,Grid>
metricsGrid
Metrics grid. -
Constructor Summary
Constructors Constructor Description LinkPredictionMetricGridReader()
Constructor -
Method Summary
Modifier and Type Method Description Grid
getGrid(java.lang.String algorithm)
Gets the grid for a given algorithmjava.util.Set<java.lang.String>
getMetrics()
Gets the set of algorithms previously read.void
read(java.util.Map<java.lang.String,java.lang.Object> map)
Obtains the different grids for contact recommendation metrics.private void
readMetric(java.util.Map.Entry<java.lang.String,java.lang.Object> element)
Reads the grid for a single metric.Methods inherited from class es.uam.eps.ir.relison.grid.GridReader
readBooleanGrid, readDoubleGrid, readGridGrid, readIntegerGrid, readLongGrid, readOrientationGrid, readParameterGrid, readStringGrid
-
Field Details
-
METRICS
private static final java.lang.String METRICS- See Also:
- Constant Field Values
-
metricsGrid
Metrics grid. Uses a grid for each metric.
-
-
Constructor Details
-
LinkPredictionMetricGridReader
public LinkPredictionMetricGridReader()Constructor
-
-
Method Details
-
read
public void read(java.util.Map<java.lang.String,java.lang.Object> map)Obtains the different grids for contact recommendation metrics.- Parameters:
map
- a map containing the information in the YAML file about the different metrics.
-
readMetric
private void readMetric(java.util.Map.Entry<java.lang.String,java.lang.Object> element)Reads the grid for a single metric.- Parameters:
element
- a map containing the information in the YAML file about the metric.
-
getMetrics
public java.util.Set<java.lang.String> getMetrics()Gets the set of algorithms previously read.- Returns:
- The set of algorithms previously read from the grid file.
-
getGrid
Gets the grid for a given algorithm- Parameters:
algorithm
- the algorithm to search- Returns:
- the grid if exists, an empty grid if not.
-