Class FeatureRecall<U extends java.io.Serializable,I extends java.io.Serializable,F>
java.lang.Object
es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric<U,I,P>
es.uam.eps.ir.relison.diffusion.metrics.features.AbstractFeatureIndividualSimulationMetric<U,I,F>
es.uam.eps.ir.relison.diffusion.metrics.features.indiv.FeatureRecall<U,I,F>
- Type Parameters:
U
- type of the user.I
- type of the information.F
- type of the user / information pieces features.
- All Implemented Interfaces:
IndividualSimulationMetric<U,I,F>
,SimulationMetric<U,I,F>
public class FeatureRecall<U extends java.io.Serializable,I extends java.io.Serializable,F> extends AbstractFeatureIndividualSimulationMetric<U,I,F>
Computes the fraction of all the features that each user has received during the diffusion process.
The final result averages over the set of users.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
RECALL
Name fixed value.private java.util.Map<U,java.util.Set<F>>
receivedFeats
Stores (if it is necessary), a relation between users and the received features.private double
total
The different values of the feature.Fields inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric
data, initialized
-
Constructor Summary
Constructors Constructor Description FeatureRecall(java.lang.String features, boolean userFeats)
Constructor. -
Method Summary
Modifier and Type Method Description double
calculate()
Calculates the metric for the current state of the simulation.double
calculate(U user)
Calculates the metric value for a single user.void
clear()
Resets the metric.protected void
initialize()
Initializes all the variables needed for computing and updating the values of the metric.protected void
updateInfoFeatures(Iteration<U,I,F> iteration)
Updates the necessary values for computing the metric (when using user parameters).protected void
updateUserFeatures(Iteration<U,I,F> iteration)
Updates the necessary values for computing the metric (when using user parameters).Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.features.AbstractFeatureIndividualSimulationMetric
getParameter, update, usesUserParam
Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric
calculateIndividuals, getName, initialize, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface es.uam.eps.ir.relison.diffusion.metrics.IndividualSimulationMetric
calculate, calculateIndividuals
Methods inherited from interface es.uam.eps.ir.relison.diffusion.metrics.SimulationMetric
calculate, initialize
-
Field Details
-
RECALL
private static final java.lang.String RECALLName fixed value.- See Also:
- Constant Field Values
-
receivedFeats
Stores (if it is necessary), a relation between users and the received features. -
total
private double totalThe different values of the feature.
-
-
Constructor Details
-
FeatureRecall
public FeatureRecall(java.lang.String features, boolean userFeats)Constructor.- Parameters:
userFeats
- true if we are using a user features, false if we are using an information piece features.features
- the name of the feature.
-
-
Method Details
-
clear
public void clear()Description copied from interface:SimulationMetric
Resets the metric. -
calculate
public double calculate()Description copied from interface:SimulationMetric
Calculates the metric for the current state of the simulation.- Returns:
- the value of the metric for the current state of the simulation
-
updateUserFeatures
Updates the necessary values for computing the metric (when using user parameters).- Specified by:
updateUserFeatures
in classAbstractFeatureIndividualSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,F>
- Parameters:
iteration
- the iteration data.
-
updateInfoFeatures
Updates the necessary values for computing the metric (when using user parameters).- Specified by:
updateInfoFeatures
in classAbstractFeatureIndividualSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,F>
- Parameters:
iteration
- the iteration data.
-
initialize
protected void initialize()Description copied from class:AbstractIndividualSimulationMetric
Initializes all the variables needed for computing and updating the values of the metric.- Specified by:
initialize
in classAbstractIndividualSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,F>
-
calculate
Description copied from interface:IndividualSimulationMetric
Calculates the metric value for a single user.- Parameters:
user
- the single user.- Returns:
- the value of the metric, NaN if something failed.
-