Package es.uam.eps.ir.relison.grid
Class GridReader
java.lang.Object
es.uam.eps.ir.relison.grid.GridReader
- Direct Known Subclasses:
AlgorithmGridReader
,CommunityDetectionGridReader
,LinkPredictionMetricGridReader
,MetricGridReader
,RecommMetricGridReader
,RerankerGridReader
public abstract class GridReader
extends java.lang.Object
Class for reading a grid of parameters from a YAML file. Given a single parameter, the
file should have the following form:
param_name:
type: value_of_type
values: [value1,value2,...,valueN] or value
range:
- start: startingValue
end: endingValue
step: stepValue
- start: ...
objects:
name_of_the_object:
param_name1:
type: value_of_the_type
...
We should note that
param_name:
type: value_of_type
values: [value1,value2,...,valueN] or value
range:
- start: startingValue
end: endingValue
step: stepValue
- start: ...
objects:
name_of_the_object:
param_name1:
type: value_of_the_type
...
We should note that
- objects is the only tag that appears if we have to retrieve an internal object which has its own parameters (i.e. similarities * in UB kNN). For them, this class reads a grid of parameters.
- range is only allowed for numeric values.
- values is only compulsory in numeric values if range does not appear.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
END
Identifier for the end of an intervalprivate static java.lang.String
OBJECTS
The identifier for the values in objects of the grid type.private static java.lang.String
RANGE
Identifier for a range of valuesprivate static java.lang.String
START
Identifier for the start of an intervalprivate static java.lang.String
STEP
Identifier for the interval stepprivate static java.lang.String
TYPE
Identifier for the parameter typeprivate static java.lang.String
VALUES
Identifier for the values of the parameter -
Constructor Summary
Constructors Constructor Description GridReader()
-
Method Summary
Modifier and Type Method Description protected java.util.List<java.lang.Boolean>
readBooleanGrid(java.util.Map<java.lang.String,java.lang.Object> map)
Reads boolean values from a gridprotected java.util.List<java.lang.Double>
readDoubleGrid(java.util.Map<java.lang.String,java.lang.Object> map)
Reads double values from a grid.protected java.util.Map<java.lang.String,Grid>
readGridGrid(java.util.Map<java.lang.String,java.lang.Object> map)
Reads a grid of grids.protected java.util.List<java.lang.Integer>
readIntegerGrid(java.util.Map<java.lang.String,java.lang.Object> map)
Obtains the integer values for a grid search.protected java.util.List<java.lang.Long>
readLongGrid(java.util.Map<java.lang.String,java.lang.Object> map)
Reads long values from a gridprotected java.util.List<EdgeOrientation>
readOrientationGrid(java.util.Map<java.lang.String,java.lang.Object> map)
Reads edge orientation values from a gridprotected Grid
readParameterGrid(java.util.Map<java.lang.String,java.lang.Object> parameters)
Given a map containing the different parameters to read, obtains a grid storing the different possible values for each single parameter.protected java.util.List<java.lang.String>
readStringGrid(java.util.Map<java.lang.String,java.lang.Object> map)
Reads string values from a grid
-
Field Details
-
VALUES
private static final java.lang.String VALUESIdentifier for the values of the parameter- See Also:
- Constant Field Values
-
OBJECTS
private static final java.lang.String OBJECTSThe identifier for the values in objects of the grid type.- See Also:
- Constant Field Values
-
TYPE
private static final java.lang.String TYPEIdentifier for the parameter type- See Also:
- Constant Field Values
-
RANGE
private static final java.lang.String RANGEIdentifier for a range of values- See Also:
- Constant Field Values
-
START
private static final java.lang.String STARTIdentifier for the start of an interval- See Also:
- Constant Field Values
-
END
private static final java.lang.String ENDIdentifier for the end of an interval- See Also:
- Constant Field Values
-
STEP
private static final java.lang.String STEPIdentifier for the interval step- See Also:
- Constant Field Values
-
-
Constructor Details
-
GridReader
public GridReader()
-
-
Method Details
-
readParameterGrid
Given a map containing the different parameters to read, obtains a grid storing the different possible values for each single parameter.- Parameters:
parameters
- a map, indexed by parameter name, containing the different values.- Returns:
- the configured grid.
-
readIntegerGrid
protected java.util.List<java.lang.Integer> readIntegerGrid(java.util.Map<java.lang.String,java.lang.Object> map)Obtains the integer values for a grid search.- Parameters:
map
- a map containing the possible values for the parameter.- Returns:
- the list of integer values.
-
readLongGrid
protected java.util.List<java.lang.Long> readLongGrid(java.util.Map<java.lang.String,java.lang.Object> map)Reads long values from a grid- Parameters:
map
- a map containing the possible values for the parameter.- Returns:
- The list of long values
-
readDoubleGrid
protected java.util.List<java.lang.Double> readDoubleGrid(java.util.Map<java.lang.String,java.lang.Object> map)Reads double values from a grid.- Parameters:
map
- a map containing the possible values for the parameter.- Returns:
- the list of double values.
-
readStringGrid
protected java.util.List<java.lang.String> readStringGrid(java.util.Map<java.lang.String,java.lang.Object> map)Reads string values from a grid- Parameters:
map
- a map containing the possible values for the parameter.- Returns:
- the list of string values.
-
readBooleanGrid
protected java.util.List<java.lang.Boolean> readBooleanGrid(java.util.Map<java.lang.String,java.lang.Object> map)Reads boolean values from a grid- Parameters:
map
- the map containing the values for the grid.- Returns:
- the list of boolean values.
-
readGridGrid
protected java.util.Map<java.lang.String,Grid> readGridGrid(java.util.Map<java.lang.String,java.lang.Object> map)Reads a grid of grids.- Parameters:
map
- the map containing the values for the grid.- Returns:
- the list of grids.
-
readOrientationGrid
protected java.util.List<EdgeOrientation> readOrientationGrid(java.util.Map<java.lang.String,java.lang.Object> map)Reads edge orientation values from a grid- Parameters:
map
- the map containing the values for the grid.- Returns:
- the list of edge orientation values.
-