java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.multisource.clustering.ComputeErrDegree<T>

public class ComputeErrDegree<T> extends Object
This class can compute two things:
1) Communities detected by the Louvrain algorithm. 2) Error degree of an edge as computed by Detecting Erroneous Identity Links on the Web Using Network Metrics by Raad J., Beek W., van Harmelen F., Pernelle N., Saïs F. (2018). This class represents a graph of sameas edges. The edges can be added by the addEdge method. After adding some edges, you can call detectCommunities or computeLinkError.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • elementToID

      private final Map<T,Integer> elementToID
    • idToElement

      private final Map<Integer,T> idToElement
    • uniformDirectedEdges

      private final Map<Integer,Map<Integer,Double>> uniformDirectedEdges
    • currentID

      private int currentID
    • countUndirectedEdges

      private int countUndirectedEdges
  • Constructor Details

    • ComputeErrDegree

      public ComputeErrDegree()
  • Method Details

    • addNodes

      void addNodes(List<T> nodes)
    • addEdge

      public void addEdge(T source, T target)
    • addEdge

      public void addEdge(T source, T target, double weight)
    • getNodeID

      private int getNodeID(T node)
    • detectCommunities

      public Map<T,Integer> detectCommunities()
      Detect communities in this graph. Default values for the parameters are used.
      Returns:
      a map from element to corresponding community number
    • detectCommunities

      public Map<T,Integer> detectCommunities(ModularityAlgorithm algorithm)
      Detect communities in this graph.
      Parameters:
      algorithm - Algorithm for modularity optimization
      Returns:
      a map from element to corresponding community number
    • detectCommunities

      public Map<T,Integer> detectCommunities(int modularityFunction, double resolution, long randomSeed, int nRandomStarts, int nIterations, ModularityAlgorithm algorithm)
      Detect communities in this graph.
      Parameters:
      modularityFunction - Modularity function (1 = standard; 2 = alternative)
      resolution - Use a value of 1.0 for standard modularity-based community detection. Use a value above (below) 1.0 if you want to obtain a larger (smaller) number of communities.
      randomSeed - Seed of the random number generator
      nRandomStarts - Number of random starts
      nIterations - Number of iterations per random start
      algorithm - Algorithm for modularity optimization
      Returns:
      a map from element to corresponding community number
    • computeClustering

      private Clustering computeClustering(int modularityFunction, double resolution, long randomSeed, int nRandomStarts, int nIterations, ModularityAlgorithm algorithm)
    • computeLinkError

      public Map<Map.Entry<T,T>,Double> computeLinkError()
    • computeLinkError

      public Map<Map.Entry<T,T>,Double> computeLinkError(ModularityAlgorithm algorithm)
    • computeLinkError

      public Map<Map.Entry<T,T>,Double> computeLinkError(int modularityFunction, double resolution, long randomSeed, int nRandomStarts, int nIterations, ModularityAlgorithm algorithm)
    • computeClusterToID

      private Map<Integer,List<Integer>> computeClusterToID(Clustering clustering)
    • computeIDToCluster

      private Map<Integer,Integer> computeIDToCluster(Map<Integer,List<Integer>> clusterToID)
    • computeElementToCluster

      private Map<T,Integer> computeElementToCluster(Clustering clustering)
    • getNetwork

      private Network getNetwork(int modularityFunction)
      Based on the uniformDirectedEdges attribute of the class, computes the internal representation (Network).
      Parameters:
      modularityFunction - the modularity Function
      Returns:
      the internal representation (Network)