Class AbstractExternalFeatureIndividualSimulationMetric<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>
- Type Parameters:
U
- type of the users.I
- type of the information pieces.P
- type of the user / information pieces features.
- All Implemented Interfaces:
IndividualSimulationMetric<U,I,P>
,SimulationMetric<U,I,P>
- Direct Known Subclasses:
ExternalFeatureIndividualGiniComplement
,ExternalFeatureIndividualRate
,ExternalFeatureRecall
public abstract class AbstractExternalFeatureIndividualSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,P> extends AbstractFeatureIndividualSimulationMetric<U,I,P>
Abstract class representing individual feature-based metrics which do not take into account features that the user already knows
(with already knows meaning that the user has the feature, in case of user features, or the user has an information piece containing
the feature, in case of information features).
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<U,java.util.Set<P>>
ownFeats
The set of own parameters for each user.Fields inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric
data, initialized
-
Constructor Summary
Constructors Constructor Description AbstractExternalFeatureIndividualSimulationMetric(java.lang.String name, java.lang.String parameter, boolean userparam)
Constructor. -
Method Summary
Modifier and Type Method Description protected void
clearOwnFeatures()
Clears all the information pieces features of all users.protected void
computeOwnFeatures()
Computes and stores the own features for every user in the network.protected java.util.Set<P>
computeOwnFeatures(U u)
Computes the features for a userprotected java.util.Set<P>
computeOwnInfoFeatures(U u)
Computes information piece features for an individual user.protected java.util.Set<P>
computeOwnUserFeatures(U u)
Computes the user features for an individual user.protected java.util.Map<U,java.util.Set<P>>
getOwnFeats()
Obtains the map identifying the features of all users.protected java.util.Set<P>
getOwnFeats(U u)
Obtains the features that an individual user already knows.protected void
setOwnFeatures(U u, java.util.Set<P> features)
Adds features for an individual user.Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.features.AbstractFeatureIndividualSimulationMetric
getParameter, update, updateInfoFeatures, updateUserFeatures, usesUserParam
Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractIndividualSimulationMetric
calculateIndividuals, getName, initialize, 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, calculate, calculateIndividuals
Methods inherited from interface es.uam.eps.ir.relison.diffusion.metrics.SimulationMetric
calculate, calculate, clear, initialize
-
Field Details
-
ownFeats
The set of own parameters for each user.
-
-
Constructor Details
-
AbstractExternalFeatureIndividualSimulationMetric
public AbstractExternalFeatureIndividualSimulationMetric(java.lang.String name, java.lang.String parameter, boolean userparam)Constructor.- Parameters:
name
- Name of the metric.parameter
- Name of the metric parameter.userparam
- True if the parameter is a user parameter, false if it is not.
-
-
Method Details
-
getOwnFeats
Obtains the map identifying the features of all users.- Returns:
- the features of all users.
-
getOwnFeats
Obtains the features that an individual user already knows.- Parameters:
u
- the user.- Returns:
- the set of features the user already knows. If the user does not exist, an empty set is returned.
-
computeOwnFeatures
protected void computeOwnFeatures()Computes and stores the own features for every user in the network. -
computeOwnFeatures
Computes the features for a user- Parameters:
u
- the user.- Returns:
- the feature set for the user
-
computeOwnUserFeatures
Computes the user features for an individual user.- Parameters:
u
- the user.- Returns:
- the feature set.
-
computeOwnInfoFeatures
Computes information piece features for an individual user.- Parameters:
u
- the user.- Returns:
- the feature set.
-
clearOwnFeatures
protected void clearOwnFeatures()Clears all the information pieces features of all users. -
setOwnFeatures
Adds features for an individual user.- Parameters:
u
- the user.features
- the features.
-