public class KStepMarkov<V,E> extends RelativeAuthorityRanker<V,E>
PageRankWithPriors
that computes the importance of a node based upon taking fixed-length random
walks out from the root set and then computing the stationary probability of being at each node. Specifically, it computes
the relative probability that the markov chain will spend at any particular node, given that it start in the root
set and ends after k steps.
A simple example of usage is:
KStepMarkov ranker = new KStepMarkov(someGraph,rootSet,6,null); ranker.evaluate(); ranker.printRankings();
Modifier and Type | Field and Description |
---|---|
static String |
RANK_SCORE |
priorRankScoreMap
edgeRankScores, vertexRankScores
Constructor and Description |
---|
KStepMarkov(DirectedGraph<V,E> graph,
Set<V> priors,
int k,
Map<E,Number> edgeWeights)
Construct the algorihm instance and initializes the algorithm.
|
Modifier and Type | Method and Description |
---|---|
protected double |
getCurrentRankScore(V v) |
String |
getRankScoreKey()
The user datum key used to store the rank scores.
|
protected void |
incrementRankScore(V v,
double rankValue) |
protected void |
initializeRankings() |
protected void |
setCurrentRankScore(V v,
double rankValue) |
void |
step()
Evaluate the result of the current iteration.
|
protected void |
updateRankings() |
finalizeIterations, getPriorRankScore, getPriors, setPriorRankScore, setPriors
assignDefaultEdgeTransitionWeights, getEdgeRankScore, getEdgeRankScore, getEdgeRankScores, getEdgeRankScores, getEdgeWeight, getEdgeWeights, getGraph, getRankings, getRankScores, getVertexCount, getVertexRankScore, getVertexRankScore, getVertexRankScores, getVertexRankScores, getVertices, initialize, isRankingEdges, isRankingNodes, normalizeEdgeTransitionWeights, normalizeRankings, onFinalize, printRankings, removeEdgeRankScore, removeEdgeRankScore, removeVertexRankScore, removeVertexRankScore, reset, setEdgeRankScore, setEdgeRankScore, setEdgeWeight, setEdgeWeights, setNormalizeRankings, setRemoveRankScoresOnFinalize, setVertexRankScore, setVertexRankScore
done, evaluate, getDesiredPrecision, getIterations, getMaximumIterations, getPrecision, hasConverged, initializeIterations, relativePrecision, setDesiredPrecision, setMaximumIterations, setPrecision
public static final String RANK_SCORE
public KStepMarkov(DirectedGraph<V,E> graph, Set<V> priors, int k, Map<E,Number> edgeWeights)
graph
- the graph to be analyzedpriors
- the set of root nodesk
- positive integer parameter which controls the relative tradeoff between a distribution "biased" towards
R and the steady-state distribution which is independent of where the Markov-process started. Generally values
between 4-8 are reasonableedgeWeights
- the weight for each edgepublic String getRankScoreKey()
getRankScoreKey
in class AbstractRanker<V,E>
protected void incrementRankScore(V v, double rankValue)
protected double getCurrentRankScore(V v)
protected void setCurrentRankScore(V v, double rankValue)
protected void initializeRankings()
public void step()
IterativeProcess
step
in interface IterativeContext
step
in class IterativeProcess
protected void updateRankings()
Copyright © 2015. All rights reserved.