Class HITSWithPriors<V,E>
java.lang.Object
edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorer<V, E, HITS.Scores>
edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorerWithPriors<V, E, HITS.Scores>
edu.uci.ics.jung.algorithms.scoring.HITSWithPriors<V,E>
- All Implemented Interfaces:
VertexScorer<V, HITS.Scores>, IterativeContext
- Direct Known Subclasses:
HITS
A generalization of HITS that permits non-uniformly-distributed random jumps.
The 'vertex_priors' (that is, prior probabilities for each vertex) may be
thought of as the fraction of the total 'potential' (hub or authority score)
that is assigned to that vertex out of the portion that is assigned according
to random jumps.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HITS.ScoresThe sum of the potential, at each step, associated with vertices with no outedges (authority) or no inedges (hub).Fields inherited from class AbstractIterativeScorerWithPriors
alpha, vertex_priorsFields inherited from class AbstractIterativeScorer
edge_weights, graph, hyperedges_are_self_loops, max_delta, max_iterations, output_reversed, tolerance, total_iterations -
Constructor Summary
ConstructorsConstructorDescriptionHITSWithPriors(Hypergraph<V, E> g, com.google.common.base.Function<E, ? extends Number> edge_weights, com.google.common.base.Function<V, HITS.Scores> vertex_priors, double alpha) Creates an instance for the specified graph, edge weights, vertex prior probabilities, and random jump probability (alpha).HITSWithPriors(Hypergraph<V, E> g, com.google.common.base.Function<V, HITS.Scores> vertex_priors, double alpha) Creates an instance for the specified graph, vertex priors, and random jump probability (alpha). -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCode which is executed after each step.protected voidCollects the "disappearing potential" associated with vertices that have either no incoming edges, no outgoing edges, or both.protected voidNormalizes scores so that sum of their squares = 1.protected doubleUpdates the value for this vertex.Methods inherited from class AbstractIterativeScorerWithPriors
getAlpha, getVertexPrior, getVertexPriors, initializeMethods inherited from class AbstractIterativeScorer
acceptDisconnectedGraph, done, evaluate, getAdjustedIncidentCount, getCurrentValue, getEdgeWeight, getEdgeWeights, getIterations, getMaxIterations, getOutputValue, getTolerance, getVertexScore, isDisconnectedGraphOK, setCurrentValue, setEdgeWeights, setHyperedgesAreSelfLoops, setMaxIterations, setOutputValue, setTolerance, step, swapOutputForCurrent, updateMaxDeltaMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VertexScorer
getVertexScore
-
Field Details
-
disappearing_potential
The sum of the potential, at each step, associated with vertices with no outedges (authority) or no inedges (hub).
-
-
Constructor Details
-
HITSWithPriors
public HITSWithPriors(Hypergraph<V, E> g, com.google.common.base.Function<E, ? extends Number> edge_weights, com.google.common.base.Function<V, HITS.Scores> vertex_priors, double alpha) Creates an instance for the specified graph, edge weights, vertex prior probabilities, and random jump probability (alpha).- Parameters:
g- the input graphedge_weights- the edge weightsvertex_priors- the prior probability for each vertexalpha- the probability of a random jump at each step
-
HITSWithPriors
public HITSWithPriors(Hypergraph<V, E> g, com.google.common.base.Function<V, HITS.Scores> vertex_priors, double alpha) Creates an instance for the specified graph, vertex priors, and random jump probability (alpha). The edge weights default to 1.0.- Parameters:
g- the input graphvertex_priors- the prior probability for each vertexalpha- the probability of a random jump at each step
-
-
Method Details
-
update
Updates the value for this vertex.- Specified by:
updatein classAbstractIterativeScorer<V, E, HITS.Scores>- Parameters:
v- the vertex whose value is to be updated- Returns:
- the updated value
-
afterStep
protected void afterStep()Code which is executed after each step. In this case, deals with the 'disappearing potential', normalizes the scores, and then callssuper.afterStep().- Overrides:
afterStepin classAbstractIterativeScorer<V, E, HITS.Scores>- See Also:
-
normalizeScores
protected void normalizeScores()Normalizes scores so that sum of their squares = 1. This method may be overridden so as to yield different normalizations. -
collectDisappearingPotential
Collects the "disappearing potential" associated with vertices that have either no incoming edges, no outgoing edges, or both. Vertices that have no incoming edges do not directly contribute to the hub scores of other vertices; similarly, vertices that have no outgoing edges do not directly contribute to the authority scores of other vertices. These values are collected at each step and then distributed across all vertices as a part of the normalization process. (This process is not required for, and does not affect, the 'sum-of-squares'-style normalization.)- Overrides:
collectDisappearingPotentialin classAbstractIterativeScorer<V, E, HITS.Scores>- Parameters:
v- the vertex whose potential is being collected
-