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 Details

    • ownFeats

      private final java.util.Map<U extends java.io.Serializable,​java.util.Set<P>> 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

      protected java.util.Map<U,​java.util.Set<P>> getOwnFeats()
      Obtains the map identifying the features of all users.
      Returns:
      the features of all users.
    • getOwnFeats

      protected java.util.Set<P> getOwnFeats​(U u)
      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

      protected java.util.Set<P> computeOwnFeatures​(U u)
      Computes the features for a user
      Parameters:
      u - the user.
      Returns:
      the feature set for the user
    • computeOwnUserFeatures

      protected java.util.Set<P> computeOwnUserFeatures​(U u)
      Computes the user features for an individual user.
      Parameters:
      u - the user.
      Returns:
      the feature set.
    • computeOwnInfoFeatures

      protected java.util.Set<P> computeOwnInfoFeatures​(U u)
      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

      protected void setOwnFeatures​(U u, java.util.Set<P> features)
      Adds features for an individual user.
      Parameters:
      u - the user.
      features - the features.