public class HITSWithPriors extends RelativeAuthorityRanker
A simple example of usage is:
HITSWithPriors ranker = new HITSWithPriors(someGraph,0.3,rootSet); ranker.evaluate(); ranker.printRankings();
Running time: O(|V|*I) where |V| is the number of vertices and I is the number of iterations until convergence
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
AUTHORITY_KEY |
protected static java.lang.String |
HUB_KEY |
PRIOR_KEY
DEFAULT_EDGE_WEIGHT_KEY
Constructor and Description |
---|
HITSWithPriors(Graph graph,
boolean useAuthorityForRanking,
double bias,
java.util.Set priors,
java.lang.String edgeWeightKey)
More specialized constructor where the type of importance can be specified.
|
HITSWithPriors(Graph graph,
double bias,
java.util.Set priors)
Constructs an instance of the ranker where the type of importance that is associated with the
rank score is the node's importance as an authority.
|
Modifier and Type | Method and Description |
---|---|
protected double |
evaluateIteration()
Evaluate the result of the current interation.
|
protected void |
finalizeIterations()
Cleans up all of the prior rank scores on finalize.
|
protected double |
getInEdgeWeight(Edge e) |
protected double |
getPreviousAuthorityScore(Element v) |
protected double |
getPreviousHubScore(Element v) |
double |
getRankScore(Element v)
Given a node, returns the corresponding rank score.
|
protected double |
getRankScore(Element v,
java.lang.String key)
Given a node and a key, returns the corresponding rank score.
|
java.lang.String |
getRankScoreKey()
the user datum key used to store the rank scores
|
protected void |
initialize(Graph g,
java.lang.String edgeWeightKeyName) |
protected void |
setInEdgeWeight(Edge e,
double weight) |
protected void |
setRankScore(Element v,
double rankValue) |
protected void |
setRankScore(Element v,
double rankValue,
java.lang.String key) |
void |
setUseAuthorityForRanking(boolean useAuthorityForRanking)
If
evaluate() has not already been called, the user can override the type of importance. |
protected void |
updateAuthorityRankings() |
protected void |
updateHubRankings() |
protected void |
updatePreviousScores() |
getPriorRankScore, getPriorRankScoreKey, getPriors, setPriorRankScore, setPriors
assignDefaultEdgeTransitionWeights, getEdgeWeight, getEdgeWeightKeyName, getGraph, getRankings, getRankScores, getVertices, initialize, isRankingEdges, isRankingNodes, normalizeEdgeTransitionWeights, normalizeRankings, onFinalize, printRankings, reinitialize, setEdgeWeight, setNormalizeRankings, setRemoveRankScoresOnFinalize, setUserDefinedEdgeWeightKey
evaluate, getDesiredPrecision, getIterations, getMaximumIterations, getPrecision, hasConverged, initializeIterations, relativePrecision, setDesiredPrecision, setMaximumIterations
protected static final java.lang.String AUTHORITY_KEY
protected static final java.lang.String HUB_KEY
public HITSWithPriors(Graph graph, double bias, java.util.Set priors)
graph
- the graph whose nodes are to be rankedbias
- the weight that should be placed on the root nodes (between 0 and 1)priors
- the set of root nodespublic HITSWithPriors(Graph graph, boolean useAuthorityForRanking, double bias, java.util.Set priors, java.lang.String edgeWeightKey)
graph
- the graph whose nodes are to be rankeduseAuthorityForRanking
- bias
- the weight that should be placed on the root nodes (between 0 and 1)priors
- the set of root nodesprotected void initialize(Graph g, java.lang.String edgeWeightKeyName)
protected void finalizeIterations()
RelativeAuthorityRanker
finalizeIterations
in class RelativeAuthorityRanker
protected double getInEdgeWeight(Edge e)
protected void setInEdgeWeight(Edge e, double weight)
public java.lang.String getRankScoreKey()
getRankScoreKey
in class AbstractRanker
public double getRankScore(Element v)
getRankScore
assumes
the decoration representing the rank score is of type MutableDouble
.getRankScore
in class AbstractRanker
protected double getRankScore(Element v, java.lang.String key)
MutableDouble
.v
- the node in questionkey
- the user datum key that indexes the rank score valueprotected double getPreviousAuthorityScore(Element v)
protected double getPreviousHubScore(Element v)
protected void setRankScore(Element v, double rankValue, java.lang.String key)
protected void setRankScore(Element v, double rankValue)
setRankScore
in class AbstractRanker
protected double evaluateIteration()
IterativeProcess
evaluateIteration
in class IterativeProcess
public void setUseAuthorityForRanking(boolean useAuthorityForRanking)
evaluate()
has not already been called, the user can override the type of importance.
(hub or authority) that should be associated with the rank score.useAuthorityForRanking
- if true
, authority is used; if false
, hub is usedprotected void updateAuthorityRankings()
protected void updateHubRankings()
protected void updatePreviousScores()