Class ExternalFeatureRecall<U extends java.io.Serializable,I extends java.io.Serializable,P>
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,P>
es.uam.eps.ir.relison.diffusion.metrics.features.indiv.AbstractExternalFeatureIndividualSimulationMetric<U,I,P>
es.uam.eps.ir.relison.diffusion.metrics.features.indiv.ExternalFeatureRecall<U,I,P>
- Type Parameters:
U- type of the user.I- type of the information.P- type of the parameters.
- All Implemented Interfaces:
IndividualSimulationMetric<U,I,P>,SimulationMetric<U,I,P>
public class ExternalFeatureRecall<U extends java.io.Serializable,I extends java.io.Serializable,P> extends AbstractExternalFeatureIndividualSimulationMetric<U,I,P>
Estimates the fraction of the unknown features of a user have been discovered thanks to the diffusion.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringRECALLName fixed value.private java.util.Map<U,java.util.Set<P>>receivedFeatsStores (if it is necessary), a relation between users and features.private java.util.Map<U,java.lang.Double>totalThe total number of external parameters that have reached the different usersFields inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric
data, initialized -
Constructor Summary
Constructors Constructor Description ExternalFeatureRecall(java.lang.String feature, boolean userFeat)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,P> iteration)Updates the necessary values for computing the metric (when using information piece features).protected voidupdateUserFeatures(Iteration<U,I,P> iteration)Updates the necessary values for computing the metric (when using user features).Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.features.indiv.AbstractExternalFeatureIndividualSimulationMetric
clearOwnFeatures, computeOwnFeatures, computeOwnFeatures, computeOwnInfoFeatures, computeOwnUserFeatures, getOwnFeats, getOwnFeats, setOwnFeaturesMethods 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 features. -
total
The total number of external parameters that have reached the different users
-
-
Constructor Details
-
ExternalFeatureRecall
public ExternalFeatureRecall(java.lang.String feature, boolean userFeat)Constructor.- Parameters:
userFeat- true if we are using a user feature, false if we are using an information piece feature.feature- 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 features).- Specified by:
updateUserFeaturesin classAbstractFeatureIndividualSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,P>- Parameters:
iteration- the iteration data.
-
updateInfoFeatures
Updates the necessary values for computing the metric (when using information piece features).- Specified by:
updateInfoFeaturesin classAbstractFeatureIndividualSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,P>- 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,P>
-
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.
-