These functions can be used when building a metasnf
distance functions
list. Each function converts a data frame into to a distance matrix.
Usage
euclidean_distance(df, weights_row)
gower_distance(df, weights_row)
sn_euclidean_distance(df, weights_row)
sew_euclidean_distance(df, weights_row)
hamming_distance(df, weights_row)
Details
Functions that work for numeric data:
euclidean_distance: typical Euclidean distance
sn_euclidean_distance: Data frame is first standardized and normalized before typical Euclidean distance is applied
siw_euclidean_distance: Squared (including weights) Euclidean distance, where the weights are also squared
sew_euclidean_distance: Squared (excluding weights) Euclidean distance, where the weights are not also squared
Functions that work for binary data:
hamming_distance: typical Hamming distance
Functions that work for any type of data:
gower_distance: Gower distance (cluster::daisy)