View source: R/sparse_encodes.R
sparse_encode | R Documentation |
Sparse encoding method by closest neighbors. Three methods are available: - hard encoding: each patient's closest neighbors are set to 1, others are set to 0 - soft encoding: each patient's closest neighbors distances are transformed by the exponential norm, others are set to 0 - epsilon encoding: each patient's neighbors closer than the mean of the distance matrix are transformed by the exponential norm and others are set to 0.
sparse_encode(
m_data,
dist_method = "norm_inprod",
encoding = c("epsilon", "hard", "soft"),
sigma,
n_neighbors = floor(nrow(m_data)/10),
scale_obs = TRUE
)
m_data |
Numeric matrix |
dist_method |
Distance method passed to qb_dist |
encoding |
Encoding method: one of hard, soft, or epsilon |
sigma |
Parameter for the exponential norm transform. Default is mean of std. dev. of distance matrix columns |
n_neighbors |
Number of neighbors (ignored in epsilon encoding) |
scale_obs |
Scale by observations |
Projected matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.