Class MeanSquaredError
-
- All Implemented Interfaces:
-
it.unibo.alchemist.boundary.Extractor
public final class MeanSquaredError<T extends Object> extends AbstractDoubleExporter
Exports the Mean Squared Error for the concentration of some molecule, given another molecule that carries the correct result. The correct value is extracted from every node, then the provided {@link UnivariateStatistic} is applied to get a single, global correct value. Then, the actual value is extracted from every node, its value is compared (subtracted) to the computed correct value, it gets squared, and then logged.
-
-
Field Summary
Fields Modifier and Type Field Description private final List<String>
columnNames
private final Integer
precision
-
Constructor Summary
Constructors Constructor Description MeanSquaredError(Incarnation<T, ?> incarnation, String localCorrectValueMolecule, String statistics, String localValueMolecule, Integer precision)
MeanSquaredError(Incarnation<T, ?> incarnation, String localCorrectValueMolecule, String localCorrectValueProperty, String statistics, String localValueMolecule, String localValueProperty, Integer precision)
MeanSquaredError(Incarnation<T, ?> incarnation, String localCorrectValueMolecule, String localCorrectValueProperty, String statistics, String localValueMolecule, String localValueProperty)
MeanSquaredError(Incarnation<T, ?> incarnation, String localCorrectValueMolecule, String localCorrectValueProperty, String statistics, String localValueMolecule)
MeanSquaredError(Incarnation<T, ?> incarnation, String localCorrectValueMolecule, String statistics, String localValueMolecule)
-
Method Summary
Modifier and Type Method Description List<String>
getColumnNames()
<T extends Any> Map<String, Double>
extractData(Environment<T, ?> environment, Actionable<T> reaction, Time time, Long step)
Extracts properties from an environment. -
-
Constructor Detail
-
MeanSquaredError
MeanSquaredError(Incarnation<T, ?> incarnation, String localCorrectValueMolecule, String statistics, String localValueMolecule, Integer precision)
-
MeanSquaredError
MeanSquaredError(Incarnation<T, ?> incarnation, String localCorrectValueMolecule, String localCorrectValueProperty, String statistics, String localValueMolecule, String localValueProperty, Integer precision)
-
MeanSquaredError
MeanSquaredError(Incarnation<T, ?> incarnation, String localCorrectValueMolecule, String localCorrectValueProperty, String statistics, String localValueMolecule, String localValueProperty)
-
MeanSquaredError
MeanSquaredError(Incarnation<T, ?> incarnation, String localCorrectValueMolecule, String localCorrectValueProperty, String statistics, String localValueMolecule)
-
MeanSquaredError
MeanSquaredError(Incarnation<T, ?> incarnation, String localCorrectValueMolecule, String statistics, String localValueMolecule)
-
-
Method Detail
-
getColumnNames
List<String> getColumnNames()
- Returns:
the name of the properties that this Extractor can provide
-
extractData
<T extends Any> Map<String, Double> extractData(Environment<T, ?> environment, Actionable<T> reaction, Time time, Long step)
Extracts properties from an environment. The returned map must either:
contain a single element,
have the keys matching columnNames, or
be iterable in predictable order (namely, implement SortedMap or extend one of LinkedHashMap or ConcurrentLinkedHashMap).
- Parameters:
environment
-the {@link Environment}
reaction
-the last executed {@link Reaction}
time
-the current {@link Time}
step
-the simulation step
- Returns:
the extracted properties with their names. The returned map must either: - contain a single element, - have the keys matching columnNames, or - be iterable in predictable order (namely, implement SortedMap or extend LinkedHashMap).
-
-
-
-