|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.yrbcn.graph.weighted.WeightedPageRank
es.yrbcn.graph.weighted.WeightedPageRankPowerMethod
public class WeightedPageRankPowerMethod
Computes PageRank using the Power Method.
The Power Method computes the principal eigenvector of a matrix M starting from an (arbitrary) vector x(0) and iterating the computation
Note that
The attribute previousRank
represents the ranking at the previous step.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class es.yrbcn.graph.weighted.WeightedPageRank |
---|
WeightedPageRank.IterationNumberStoppingCriterion, WeightedPageRank.Norm, WeightedPageRank.NormDeltaStoppingCriterion, WeightedPageRank.StoppingCriterion |
Field Summary | |
---|---|
String |
coeffBasename
If not null , the basename for coefficents. |
double[][] |
derivative
The value of derivatives (only for the subset of nodes specified in subset , if not null ). |
int[] |
order
The order of the derivatives. |
double[] |
previousRank
The rank vector after the last iteration (only meaningful after at least one step). |
protected it.unimi.dsi.logging.ProgressLogger |
progressLogger
A progress logger. |
int[] |
subset
If not null , the subset of nodes over which the derivatives should be computed. |
Fields inherited from class es.yrbcn.graph.weighted.WeightedPageRank |
---|
alpha, buckets, DEFAULT_ALPHA, DEFAULT_MAX_ITER, DEFAULT_THRESHOLD, g, iterationNumber, logger, norm, numNodes, preference, preferentialAdjustment, rank, start, STOCHASTIC_TOLERANCE, stronglyPreferential, sumoutweight |
Constructor Summary | |
---|---|
WeightedPageRankPowerMethod(ArcLabelledImmutableGraph g)
Creates a new PageRank Power-Method based calculator. |
|
WeightedPageRankPowerMethod(ArcLabelledImmutableGraph g,
org.apache.log4j.Logger logger)
Creates a new PageRank Power–Method based calculator. |
Method Summary | |
---|---|
void |
clear()
Clears all data. |
void |
init()
Initializes the variables for PageRank computation. |
static void |
main(String[] arg)
|
double |
normDelta()
Returns a norm of the difference with the previous step rank vector. |
void |
step()
Computes the next step of the Power Method. |
void |
stepUntil(WeightedPageRank.StoppingCriterion stoppingCriterion)
Calls WeightedPageRank.init() and steps until a given stopping criterion is met. |
Methods inherited from class es.yrbcn.graph.weighted.WeightedPageRank |
---|
and, buildProperties, isStochastic, or |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public double[] previousRank
protected final it.unimi.dsi.logging.ProgressLogger progressLogger
public int[] subset
null
, the subset of nodes over which the derivatives should be computed.
public double[][] derivative
subset
, if not null
).
public int[] order
null
, but it can be the empty array.
public String coeffBasename
null
, the basename for coefficents.
Constructor Detail |
---|
public WeightedPageRankPowerMethod(ArcLabelledImmutableGraph g, org.apache.log4j.Logger logger)
g
- the graph.logger
- a logger that will be passed to super()
.public WeightedPageRankPowerMethod(ArcLabelledImmutableGraph g)
g
- the graph.Method Detail |
---|
public void init() throws IOException
WeightedPageRank
This method initialises the starting vector
init
in class WeightedPageRank
IOException
public void step() throws IOException
step
in class WeightedPageRank
IOException
public void stepUntil(WeightedPageRank.StoppingCriterion stoppingCriterion) throws IOException
WeightedPageRank
WeightedPageRank.init()
and steps until a given stopping criterion is met.
The criterion is checked a posteriori (i.e., after each step); this means that
at least one step is performed.
stepUntil
in class WeightedPageRank
stoppingCriterion
- the stopping criterion to be used.
IOException
- if an exception occurs during computation.public double normDelta()
WeightedPageRank
normDelta
in class WeightedPageRank
public void clear()
WeightedPageRank
WeightedPageRank.init()
before computing PageRank again.
clear
in class WeightedPageRank
public static void main(String[] arg) throws IOException, JSAPException, org.apache.commons.configuration.ConfigurationException, ClassNotFoundException
IOException
JSAPException
org.apache.commons.configuration.ConfigurationException
ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |