Class LinkPredictionMetricConfigurationsReader
java.lang.Object
es.uam.eps.ir.relison.grid.ConfigurationsReader
es.uam.eps.ir.relison.grid.links.prediction.metrics.LinkPredictionMetricConfigurationsReader
public class LinkPredictionMetricConfigurationsReader extends ConfigurationsReader
Class for reading contact recommendation metrics.
For each metric, it reads a list of configurations.
File format:
metrics:
metric_name:
- param1: ...
param2: ...
- param1: ...
...
File format:
metrics:
metric_name:
- param1: ...
param2: ...
- param1: ...
...
- See Also:
ConfigurationsReader
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,Configurations>
metricConfs
Map for storing the different configurations of a metric.private static java.lang.String
METRICS
-
Constructor Summary
Constructors Constructor Description LinkPredictionMetricConfigurationsReader()
Constructor. -
Method Summary
Modifier and Type Method Description Configurations
getConfigurations(java.lang.String algorithm)
Gets the different configurations for a single metric.java.util.Set<java.lang.String>
getMetrics()
Once the configurations have been read, it obtains the set of metrics which have been read from the file.void
read(java.util.Map<java.lang.String,java.lang.Object> map)
Reads a YAML document containing the different configurations of a list of metrics.private void
readMetrics(java.util.Map.Entry<java.lang.String,java.lang.Object> element)
Reads the configurations for a single metric.
-
Field Details
-
METRICS
private static final java.lang.String METRICS- See Also:
- Constant Field Values
-
metricConfs
Map for storing the different configurations of a metric.
-
-
Constructor Details
-
LinkPredictionMetricConfigurationsReader
public LinkPredictionMetricConfigurationsReader()Constructor.
-
-
Method Details
-
read
public void read(java.util.Map<java.lang.String,java.lang.Object> map)Reads a YAML document containing the different configurations of a list of metrics.- Parameters:
map
- a map containing the configurations for the different metrics.
-
readMetrics
private void readMetrics(java.util.Map.Entry<java.lang.String,java.lang.Object> element)Reads the configurations for a single metric.- Parameters:
element
- an object containing the configurations for a single metric.
-
getMetrics
public java.util.Set<java.lang.String> getMetrics()Once the configurations have been read, it obtains the set of metrics which have been read from the file. Otherwise, it returns an empty set.- Returns:
- a set containing the names of the metrics in the configuration file.
-
getConfigurations
Gets the different configurations for a single metric.- Parameters:
algorithm
- the name of the metric.- Returns:
- the configurations for the given metric if exists, an empty list of configurations otherwise.
-