trimNeighbors | R Documentation |
Further reduce the cutoff value of a nearest neighbor (NN) table, as produced by
nearestNeighbors
. This allows one to compute a very relaxed NN table
initially, and then quickly restrict it later without having to re-compute all the
similarities.
trimNeighbors(nnm, cutoff)
nnm |
A nearest neighbor table, as produced by |
cutoff |
The new similarities cutoff value. All pairs with a similarity less than this value will be removed from the table. |
The return value has the same structure as nnm
, with some neighbors
removed from the indexes
and similarties
entries.
Kevin Horan
jarvisPatrick
nearestNeighbors
data(sdfsample)
ap = sdf2ap(sdfsample)
nnm = nearestNeighbors(ap,numNbrs=20)
nnm = trimNeighbors(nnm,cutoff=0.5)
clustering = jarvisPatrick(nnm,k=2,mode="a1b")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.