scratch.joshua.ranking
Class AbstractIterativeRanker
java.lang.Object
scratch.joshua.ranking.AbstractRanker
scratch.joshua.ranking.AbstractIterativeRanker
- Direct Known Subclasses:
- HITSRanker, SingleValueRanker
public abstract class AbstractIterativeRanker
- extends AbstractRanker
Constructor Summary |
AbstractIterativeRanker(ArchetypeGraph g,
int max_iterations,
double tolerance)
|
AbstractIterativeRanker(ArchetypeGraph g,
NumberEdgeValue edge_value,
int max_iterations,
double tolerance)
|
AbstractIterativeRanker(ArchetypeGraph g,
NumberVertexValue priors,
int max_iterations,
double tolerance)
|
AbstractIterativeRanker(ArchetypeGraph g,
NumberVertexValue priors,
NumberEdgeValue edge_value,
int max_iterations,
double tolerance)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UNIFORM_OUT
protected static final NumberEdgeValue UNIFORM_OUT
UNIFORM_INCIDENT
protected static final EdgeVertexNumberFunction UNIFORM_INCIDENT
priors
protected NumberVertexValue priors
max_iterations
protected int max_iterations
tolerance
protected double tolerance
AbstractIterativeRanker
public AbstractIterativeRanker(ArchetypeGraph g,
int max_iterations,
double tolerance)
AbstractIterativeRanker
public AbstractIterativeRanker(ArchetypeGraph g,
NumberVertexValue priors,
int max_iterations,
double tolerance)
AbstractIterativeRanker
public AbstractIterativeRanker(ArchetypeGraph g,
NumberEdgeValue edge_value,
int max_iterations,
double tolerance)
AbstractIterativeRanker
public AbstractIterativeRanker(ArchetypeGraph g,
NumberVertexValue priors,
NumberEdgeValue edge_value,
int max_iterations,
double tolerance)
getToleranceValue
public double getToleranceValue(double cur_tolerance,
NumberVertexValue old_value,
NumberVertexValue new_value)
- Returns the maximum of largest single difference between any value in
old_value
and the corresponding value in
new_value
.
Override this if you want to calculate the tolerance value in a
different way (e.g., mean difference over all vertices).
- Parameters:
cur_tolerance
- old_value
- new_value
-
- Returns:
hasConverged
protected boolean hasConverged(ArchetypeVertex v,
NumberVertexValue first,
NumberVertexValue second)
getNormalizedInitialValues
protected static NumberVertexValue getNormalizedInitialValues(ArchetypeGraph graph,
boolean squared)
- Returns
NumberVertexValue
with uniformly distributed values
such that their sum (of their squares if squared
is
true
) over all vertices in g
is 1.
getNormalizedInitialValues
protected static NumberVertexValue getNormalizedInitialValues(ArchetypeGraph g)
- Returns
NumberVertexValue
with uniformly distributed values
such that their sum, over all vertices in g
, is 1.