Class FeatureIndividualKLDivergence<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,P>
es.uam.eps.ir.relison.diffusion.metrics.features.indiv.AbstractFeatureKLDivergence<U,I,F>
es.uam.eps.ir.relison.diffusion.metrics.features.indiv.FeatureIndividualKLDivergence<U,I,F>
- Type Parameters:
U
- type of the users.I
- type of the information pieces.F
- type of the features.
- All Implemented Interfaces:
IndividualSimulationMetric<U,I,F>
,SimulationMetric<U,I,F>
public class FeatureIndividualKLDivergence<U extends java.io.Serializable,I extends java.io.Serializable,F> extends AbstractFeatureKLDivergence<U,I,F>
This individual metric computes the number of bytes of information we expect to lose
if we approximate the real distribution of features of the users (the total frequency of appearance
of the features over the information pieces) with the estimated distribution
obtained from simulating. It uses KL Divergence for that.
We apply a Laplace smoothing to prevent divisions by zero in both distributions.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
ENTROPY
Name fixed value.Fields inherited from class es.uam.eps.ir.relison.diffusion.metrics.features.indiv.AbstractFeatureKLDivergence
pvalues, qvalues, sumP, sumQ
Fields inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric
data, initialized
-
Constructor Summary
Constructors Constructor Description FeatureIndividualKLDivergence(java.lang.String feature, boolean userFeat, boolean unique)
Constructor. -
Method Summary
Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.features.indiv.AbstractFeatureKLDivergence
calculate, clear, initialize, updateInfoFeatures, updateUserFeatures
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
-
ENTROPY
private static final java.lang.String ENTROPYName fixed value.- See Also:
- Constant Field Values
-
-
Constructor Details
-
FeatureIndividualKLDivergence
public FeatureIndividualKLDivergence(java.lang.String feature, boolean userFeat, boolean unique)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.unique
- true if a piece of information is considered once, false if it is considered each time it appears.
-
-
Method Details
-
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.
-