diss_to_neighbors: From dissimilarity matrix to neighbors

Description Usage Arguments

View source: R/search_neighbors_helpers.R

Description

internal

Usage

1
2
3
4
5
6
7
8
diss_to_neighbors(
  diss_matrix,
  k = NULL,
  k_diss = NULL,
  k_range = NULL,
  spike = NULL,
  return_dissimilarity = FALSE
)

Arguments

diss_matrix

a matrix representing the dissimilarities between observations in a matrix Xu and observations in another matrix Xr. Xr in rows Xu in columns.

k

an integer value indicating the k-nearest neighbors of each observation in Xu that must be selected from Xr.

k_diss

an integer value indicating a dissimilarity treshold. For each observation in Xu, its nearest neighbors in Xr are selected as those for which their dissimilarity to Xu is below this k_diss threshold. This treshold depends on the corresponding dissimilarity metric specified in diss_method. Either k or k_diss must be specified.

k_range

an integer vector of length 2 which specifies the minimum (first value) and the maximum (second value) number of neighbors to be retained when the k_diss is given.

spike

a vector of integers indicating what observations in Xr (and Yr) must be 'forced' to always be part of all the neighborhoods.

return_dissimilarity

logical indicating if the input dissimilarity must be mirroed in the output.


resemble documentation built on Nov. 9, 2020, 5:08 p.m.