public class PageRankServiceImpl extends Object implements PageRankService
Constructor and Description |
---|
PageRankServiceImpl() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args) |
double[] |
pagerankIter(double[] currentScores,
Map<Integer,Double> dampingVector,
ConceptGraph cg,
double dampingFactor,
double N) |
double[] |
pagerankIter(double[] currentScores,
Map<Integer,Double> dampingVector,
ConceptGraph cg,
double dampingFactor,
double N,
Set<Integer> activeNodes) |
Map<Integer,Double> |
pagerankIter(Map<Integer,Double> currentScores,
Map<Integer,Double> dampingVector,
ConceptGraph cg,
double dampingFactor,
double N)
perform one iteration of pagerank
|
double[] |
rank(Map<String,Double> dampingVector,
ConceptGraph cg)
call rank() with default values for iter (30), threshold(1e-4),
dampingFactor(0.85)
|
double[] |
rank(Map<String,Double> dampingVector,
ConceptGraph cg,
int iter,
double threshold,
double dampingFactor)
PageRank for conceptGraph.
|
double[] |
rank2(Map<Integer,Double> dampingVector,
ConceptGraph cg,
int iter,
double threshold,
double dampingFactor) |
double |
sim(String concept1,
String concept2,
ConceptGraph cg,
int iter,
double threshold,
double dampingFactor)
compute similarity using personalized page rank, as documented in Exploring Knowledge Bases for Similarity
|
public double[] pagerankIter(double[] currentScores, Map<Integer,Double> dampingVector, ConceptGraph cg, double dampingFactor, double N, Set<Integer> activeNodes)
public double[] pagerankIter(double[] currentScores, Map<Integer,Double> dampingVector, ConceptGraph cg, double dampingFactor, double N)
public double[] rank2(Map<Integer,Double> dampingVector, ConceptGraph cg, int iter, double threshold, double dampingFactor)
rank2
in interface PageRankService
public Map<Integer,Double> pagerankIter(Map<Integer,Double> currentScores, Map<Integer,Double> dampingVector, ConceptGraph cg, double dampingFactor, double N)
currentScores
- cg
- public double sim(String concept1, String concept2, ConceptGraph cg, int iter, double threshold, double dampingFactor)
sim
in interface PageRankService
concept1
- concept2
- cg
- iter
- threshold
- dampingFactor
- public static void main(String[] args)
public double[] rank(Map<String,Double> dampingVector, ConceptGraph cg, int iter, double threshold, double dampingFactor)
PageRankService
rank
in interface PageRankService
dampingVector
- topic vector/personalized pagerank vector. If null will use
normal pagerank with a damping vector where every value is 1/Ncg
- concept graphiter
- max number of iterationsthreshold
- convergence thresholdpublic double[] rank(Map<String,Double> dampingVector, ConceptGraph cg)
PageRankService
rank
in interface PageRankService
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.