Description Usage Arguments Details Value Note Author(s) Examples
View source: R/WeightedEuclidean.R
Produces Weighted Eulidean Distance Matrix
1 | WeightedEuclidean(Data, Weights)
|
Data |
[1:n,1:c] data matric |
Weights |
vector [1:c] |
The second and las example shows the difference to common Euclidean distance. Only the first example shows how to use the weighted euclidean for cluster analysis.
Distance Matrix
should be implemented in Rcpp for efficiency
Michael Thrun
1 2 3 4 5 6 7 8 9 10 11 12 13 | #lets assume that feature 2 and 3
# are correlated, then one can use:
DistanceMatrix=WeightedEuclidean(FCPS$Hepta$Data,Weights = c(1,0.5,0.5))
##Comparisions for (un)correlated features:
#There is no difference to normal Euclid
# if uncorrelated, because the weights are always one
WeightedEuclidean(FCPS$Hepta$Data,Weights = c(1,1,1))-DistanceMatrix(FCPS$Hepta$Data)
#in case of correlations there is a difference
WeightedEuclidean(FCPS$Hepta$Data,Weights = c(1,0.5,0.5))-DistanceMatrix(FCPS$Hepta$Data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.