Class AbstractIterativeScorerWithPriors<V,E,S>
java.lang.Object
edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorer<V,E,S>
edu.uci.ics.jung.algorithms.scoring.AbstractIterativeScorerWithPriors<V,E,S>
- Type Parameters:
V- the vertex typeE- the edge typeS- the score type
- All Implemented Interfaces:
VertexScorer<V,S>, IterativeContext
- Direct Known Subclasses:
HITSWithPriors, PageRankWithPriors
public abstract class AbstractIterativeScorerWithPriors<V,E,S>
extends AbstractIterativeScorer<V,E,S>
implements VertexScorer<V,S>
An abstract class for iterative random-walk-based vertex scoring algorithms
that have a
fixed probability, for each vertex, of 'jumping' to that vertex at each
step in the algorithm (rather than following a link out of that vertex).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleThe probability of making a 'jump' at each step.The prior probability of each vertex being visited on a given 'jump' (non-link-following) step.Fields inherited from class AbstractIterativeScorer
edge_weights, graph, hyperedges_are_self_loops, max_delta, max_iterations, output_reversed, tolerance, total_iterations -
Constructor Summary
ConstructorsConstructorDescriptionAbstractIterativeScorerWithPriors(Hypergraph<V, E> g, com.google.common.base.Function<? super E, ? extends Number> edge_weights, com.google.common.base.Function<? super V, ? extends S> vertex_priors, double alpha) Creates an instance for the specified graph, edge weights, vertex priors, and jump probability.AbstractIterativeScorerWithPriors(Hypergraph<V, E> g, com.google.common.base.Function<V, ? extends S> vertex_priors, double alpha) Creates an instance for the specified graph, vertex priors, and jump probability, with edge weights specified by the subclass. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetAlpha()Returns the probability of making a 'jump' (non-link-following step).protected SgetVertexPrior(V v) Returns the prior probability forv.Returns a Function which maps each vertex to its prior probability.voidInitializes the state of this instance.Methods inherited from class AbstractIterativeScorer
acceptDisconnectedGraph, afterStep, collectDisappearingPotential, done, evaluate, getAdjustedIncidentCount, getCurrentValue, getEdgeWeight, getEdgeWeights, getIterations, getMaxIterations, getOutputValue, getTolerance, getVertexScore, isDisconnectedGraphOK, setCurrentValue, setEdgeWeights, setHyperedgesAreSelfLoops, setMaxIterations, setOutputValue, setTolerance, step, swapOutputForCurrent, update, updateMaxDeltaMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VertexScorer
getVertexScore
-
Field Details
-
vertex_priors
-
alpha
protected double alphaThe probability of making a 'jump' at each step.
-
-
Constructor Details
-
AbstractIterativeScorerWithPriors
public AbstractIterativeScorerWithPriors(Hypergraph<V, E> g, com.google.common.base.Function<? super E, ? extends Number> edge_weights, com.google.common.base.Function<? super V, ? extends S> vertex_priors, double alpha) Creates an instance for the specified graph, edge weights, vertex priors, and jump probability.- Parameters:
g- the graph whose vertices are to be assigned scoresedge_weights- the edge weights to use in the score assignmentvertex_priors- the prior probabilities of each vertex being 'jumped' toalpha- the probability of making a 'jump' at each step
-
AbstractIterativeScorerWithPriors
public AbstractIterativeScorerWithPriors(Hypergraph<V, E> g, com.google.common.base.Function<V, ? extends S> vertex_priors, double alpha) Creates an instance for the specified graph, vertex priors, and jump probability, with edge weights specified by the subclass.- Parameters:
g- the graph whose vertices are to be assigned scoresvertex_priors- the prior probabilities of each vertex being 'jumped' toalpha- the probability of making a 'jump' at each step
-
-
Method Details
-
initialize
public void initialize()Initializes the state of this instance.- Overrides:
initializein classAbstractIterativeScorer<V,E, S>
-
getVertexPrior
-
getVertexPriors
-
getAlpha
public double getAlpha()Returns the probability of making a 'jump' (non-link-following step).- Returns:
- the probability of making a 'jump' (non-link-following step)
-