T - The type of nodespublic class NNDescent<T> extends GraphBuilder<T>
DEFAULT_K| Constructor and Description |
|---|
NNDescent() |
| Modifier and Type | Method and Description |
|---|---|
protected Graph<T> |
computeGraph(List<T> nodes,
int k,
SimilarityInterface<T> similarity) |
double |
getDelta() |
int |
getMaxIterations() |
double |
getRho() |
protected Set<Edge> |
getSetInstance(int size)
Return the correct instance of Set
|
protected Graph<T> |
nndescent(List<T> nodes,
SimilarityInterface<T> similarity) |
protected ArrayList<T> |
pickFalses(T node,
NeighborList neighbor_list) |
protected ArrayList<T> |
pickTruesAndMark(T node,
NeighborList neighbor_list)
Pick new neighbors with a probability of rho, and mark them as false.
|
protected NeighborList |
randomNeighborList(List<T> nodes,
T for_node) |
protected HashMap<T,ArrayList<T>> |
reverse(List<T> nodes,
Map<T,ArrayList<T>> lists)
Reverse NN array R[v] is the list of elements (u) for which v is a
neighbor (v is in B[u]).
|
protected ArrayList<T> |
sample(ArrayList<T> nodes,
int count) |
void |
setDelta(double delta)
Early termination coefficient.
|
void |
setMaxIterations(int max_iterations)
Set the maximum number of iterations.
|
void |
setRho(double rho)
Sampling coefficient.
|
protected ArrayList<T> |
union(ArrayList<T> l1,
ArrayList<T> l2) |
protected int |
updateNL(NeighborList nl,
T n,
double similarity) |
computeGraph, getComputedSimilarities, getK, getSimilarity, readFile, setK, setSimilarity, testprotected final Set<Edge> getSetInstance(int size)
public final double getRho()
public final void setRho(double rho)
rho - public final double getDelta()
public final void setDelta(double delta)
delta - public final int getMaxIterations()
public final void setMaxIterations(int max_iterations)
max_iterations - protected final NeighborList randomNeighborList(List<T> nodes, T for_node)
protected final ArrayList<T> pickFalses(T node, NeighborList neighbor_list)
protected final ArrayList<T> pickTruesAndMark(T node, NeighborList neighbor_list)
node - neighbor_list - protected final HashMap<T,ArrayList<T>> reverse(List<T> nodes, Map<T,ArrayList<T>> lists)
nodes - lists - protected final int updateNL(NeighborList nl, T n, double similarity)
nl - n - similarity - protected Graph<T> computeGraph(List<T> nodes, int k, SimilarityInterface<T> similarity)
computeGraph in class GraphBuilder<T>Copyright © 2017. All rights reserved.