Class FeatureGlobalKLDivergence<U extends java.io.Serializable,I extends java.io.Serializable,F>
java.lang.Object
es.uam.eps.ir.relison.diffusion.metrics.AbstractGlobalSimulationMetric<U,I,F>
es.uam.eps.ir.relison.diffusion.metrics.features.AbstractFeatureGlobalSimulationMetric<U,I,F>
es.uam.eps.ir.relison.diffusion.metrics.features.global.AbstractFeatureGlobalKLDivergence<U,I,F>
es.uam.eps.ir.relison.diffusion.metrics.features.global.FeatureGlobalKLDivergence<U,I,F>
- Type Parameters:
U
- type of the users.I
- type of the information pieces.F
- type of the user / information pieces features.
- All Implemented Interfaces:
GlobalSimulationMetric<U,I,F>
,SimulationMetric<U,I,F>
public class FeatureGlobalKLDivergence<U extends java.io.Serializable,I extends java.io.Serializable,F> extends AbstractFeatureGlobalKLDivergence<U,I,F>
This global metric computes the number of bytes of information we expect to lose
if we approximate the real distribution of features with the estimated distribution
obtained from simulating. It uses KL Divergence for that.
-
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.global.AbstractFeatureGlobalKLDivergence
pvalues, qvalues, sumP, sumQ
Fields inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractGlobalSimulationMetric
data, initialized
-
Constructor Summary
Constructors Constructor Description FeatureGlobalKLDivergence(java.lang.String feature, boolean userFeat, boolean unique)
Constructor. -
Method Summary
Modifier and Type Method Description double
calculate()
Calculates the metric for the current state of the simulation.Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.features.global.AbstractFeatureGlobalKLDivergence
clear, initialize, updateInfoFeature, updateUserFeature
Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.features.AbstractFeatureGlobalSimulationMetric
getFeature, update, usesUserFeatures
Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractGlobalSimulationMetric
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.SimulationMetric
calculate, initialize
-
Field Details
-
ENTROPY
private static final java.lang.String ENTROPYName fixed value.- See Also:
- Constant Field Values
-
-
Constructor Details
-
FeatureGlobalKLDivergence
public FeatureGlobalKLDivergence(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
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
-