Description Usage Arguments Value Author(s) See Also Examples
arch_dist()
calculates Euclidean distance from every point to every archetype give matrices that contain this data.
1 |
data |
matrix of dim(variables/dimentions, examples) |
archetypes |
matrix of dim(variables/dimentions, archetypes) |
dist_metric |
distance metric, currently only "euclidean" implemented |
matrix of distances to archetypes of dim(examples, archetypes)
Vitalii Kleshchevnikov
fit_pch
, generate_arc
, generate_data
1 2 3 4 5 6 7 8 9 10 11 | # Triangle with sides of 3,4,5 units length
arch_dist(matrix(c(0,0),1,2), matrix(c(3,4),1,2))
# Random data that fits into the triangle
set.seed(4355)
archetypes = generate_arc(arc_coord = list(c(5, 0), c(-10, 15), c(-30, -20)),
mean = 0, sd = 1, N_dim = 2)
data = generate_data(archetypes, N_examples = 1e4, jiiter = 0.04, size = 0.9)
# Find Euclidean distance between data points and archetypes
distance = arch_dist(data, archetypes)
# Find Euclidean distance between archetypes
arc_distance = arch_dist(archetypes, archetypes)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.