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.StringRECALLName fixed value.private java.util.Map<U,java.util.Set<F>>receivedFeatsStores (if it is necessary), a relation between users and the received features.private doubletotalThe 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 doublecalculate()Calculates the metric for the current state of the simulation.doublecalculate(U user)Calculates the metric value for a single user.voidclear()Resets the metric.protected voidinitialize()Initializes all the variables needed for computing and updating the values of the metric.protected voidupdateInfoFeatures(Iteration<U,I,F> iteration)Updates the necessary values for computing the metric (when using user parameters).protected voidupdateUserFeatures(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, usesUserParamMethods inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric
calculateIndividuals, getName, initialize, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface es.uam.eps.ir.relison.diffusion.metrics.IndividualSimulationMetric
calculate, calculateIndividualsMethods 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:SimulationMetricResets the metric. -
calculate
public double calculate()Description copied from interface:SimulationMetricCalculates 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:
updateUserFeaturesin 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:
updateInfoFeaturesin 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:AbstractIndividualSimulationMetricInitializes all the variables needed for computing and updating the values of the metric.- Specified by:
initializein classAbstractIndividualSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,F>
-
calculate
Description copied from interface:IndividualSimulationMetricCalculates the metric value for a single user.- Parameters:
user- the single user.- Returns:
- the value of the metric, NaN if something failed.
-