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.String
RECALL
Name fixed value.private java.util.Map<U,java.util.Set<P>>
receivedFeats
Stores (if it is necessary), a relation between users and features.private java.util.Map<U,java.lang.Double>
total
The 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 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,P> iteration)
Updates the necessary values for computing the metric (when using information piece features).protected void
updateUserFeatures(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, setOwnFeatures
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 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: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 features).- Specified by:
updateUserFeatures
in 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:
updateInfoFeatures
in 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: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,P>
-
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.
-