# Questions tagged [euclidean]

Euclidean distance is the intuitive notion of a 'straight-line' distance between two points in a Euclidean space.

145 questions
Filter by
Sorted by
Tagged with
302 views

### Should we apply PCA before calculating similarities in high-dimensional space if my observations have length 1?

I have high-dimensional space (around 20 features) and I want to calculate similarity based on the angle of observation, not the magnitude. I have a nice function that can compute euclidean distance ...
1 vote
149 views

### Euclidean distance between points in PCA space along different principal component dimensions

I've picked up this project half way through, and I'm working through the last guy's code, so please bear with me. So the original data consists of 500+ points in 150 dimensions, and I want to ...
14 views

### Is cosine similarity enough to measure word embedding similarity?

Is cosine similarity a good metric to measure word embedding similarity? Suppose that we have two vectors of word embedding in same direction but with different length( first one with len=1 and second ...
31 views

### In R perform k means clustering with k=3 and euclidean distance a 100 different times [closed]

I would like to perform k mean clustering with k=3 and the Euclidean distance a 100 different time. But it only gives me 2 iterations, how do i do a loop so it give me 100. Thanks
1 vote
320 views

### Does DTW return smaller distance measure than Euclidean Distance?

QUESTION 1: When computing the distance between two time series, shouldn't the DTW distance measure return a smaller distance than the Euclidean distance (assuming DTW internally uses the Euclidean ...
252 views

### Cosine similarity for Categorical datasets?

Can I use Cosine similarity measure for estimating similarity/relationship between D1 and D2 (two categorical datasets)
148 views

### Applying Dynamic Time Warping (DTW) instead of Euclidean Distance for Clustering Synchronized Time series data

I am trying to cluster members based on hourly login data. As this is mostly synchronized, I first applied Euclidean and it failed to cluster them into groups with sensible patterns. I tried DTW ...
1 vote
236 views

### Intuitive explanation of Ward's method

I got this explanation of the Ward's method of hierarchical clustering from Malhotra et. al (2017), and I don't really get what it means: Ward’s procedure is a variance method which attempts to ...
1 vote
30 views

### Similarity between datasets A and B where B is a subset of A

I have two datasets A and B, and for each entry in both datasets I have a mixture of ordered and unordered categorical variables such as gender, age (integral value) and date. It is believed that ...
1 vote
57 views

### What are the moments of the Beckmann distribution?

Let $U=(u_1, u_2)$ and $V=(v_1, v_2)$ be two randomly distributed points on the Euclidean plane assuming bivariate normal distributions $U \sim N(\mu_u, \Sigma_u)$ and $V \sim N(\mu_v, \Sigma_v)$ with ...
100 views

### About the calculation of covariance matrix in mahalanobis distance: How $W^TW$ is equal to the covariance matrix? [closed]

I was reading about deep metric learning (from here) and came across the mahalanobis distance. I understood why we can not use euclidean distance if the distribution is not isotropic (the covariance ...
572 views

### Analysis or Comparison of Euclidean Distance matrix

Related: Average distance in distance matrix I'm looking for some way to compare euclidean distance matrices. The matrices I need to compare will have constant number of rows but varying number of ...
293 views

### Cosine similarity seems to perform better with higher dimensions than Euclidean distance? Should this be the case?

I've generated 100 random vectors (data points) in n∈[1,...,50] dimensions. I then compared distances between each pair of vectors and calculated the mean value. I've done this for all dimensions ...
235 views

### How to define distance for vector of angles?

I have a vector of angles and I am looking for a method to compute the distance of my vector with any other vector of angles? I am looking for something similar to Euclidean distance but I know that ...
1k views

### How k-means computes cluster centroids differently for each distance metric?

K-means computes cluster centroids differently for each distance metric. I don't know why the way of computing the centroid is dependent of the distance measure. I don't know how we compute the ...
44k views

### Definition of normalized Euclidean distance

Recently I have started looking for the definition of normalized Euclidean distance between two real vectors $u$ and $v$. So far, I have discovered two apparently unrelated definitions: http://en....
2k views

### Is one-hot encoding and standardization of data equivalent to Gower's distance?

For clustering and other techniques for mixed data (numerical and categorical), Gower's distance is usually more preferred than Euclidean distance because the former computes distance differently for ...
539 views

### Euclidean distances in spaces of different dimensions

A modest attempt to illustrate my question: Setup Consider a survey where you have to choose if you like to do an activity or not. You do this for a number of activities $A_1,...,A_8$. In addition, ...
1 vote
63 views

### Euclidean Norm normalized Normal Distribution

Let $X$ be a multivariate normal $\mathcal{N}(\mu, \Sigma^2)$ and let $X$ be anistropic, that is I am considering $\Sigma$ to be a diagonal matrix but the elements on the diagonal might be different. ...
17 views

### Significance test for comparing two mean Euclidean distances?

First time poster here, so please let me know if more details are needed! In short, I'm analyzing a dataset that has scores from 98 siblings from 64 families. So some families contributed only one ...
38k views

### Which distance to use? e.g., manhattan, euclidean, Bray-Curtis, etc

I am not a community ecologist, but these days I am working on community ecology data. What I couldn't understand, apart from the mathematics of these distances, is the criteria for each distance to ...
21k views

### How I can convert distance (Euclidean) to similarity score

I am using $k$ means clustering to cluster speaker voices. When I compare an utterance with clustered speaker data I get (Euclidean distance-based) average distortion. This distance can be in range of ...
1 vote
124 views

### What is the effect of the limitations of Euclidean distances in high dimensions to multiple regression?

This is eye-opening, and the effect on KNN, for example, is easy to predict, but should the limitations of Euclidean distance in high dimension be a reason for concern in the very common application ...
535 views

### Distances between random points in a hypercube and statistics of exponents

TL;DR: Why is $\text{avg}\left(|a-b|^k\right)=\frac{2}{(k+1)(k+2)}$? I.e. for $k=2$, as for finding average Euclidian distances, the result is $\frac{1}{6}$? I've been reading a book about "Corobs," ...
65 views

### Is Euclidean distance the same as distance-from-correlation as $d(x, y) = \sqrt{2m[1 - r(x, y)]}$

I found in a couple of documents (e.g. this) that the Euclidean distance $d(x, y) = \sqrt{\sum_{i = 1}^{n}{(x_i - y_i)^2}}$ can be obtained from correlation coeffcient if $x$ and $y$ are standardised ...
18 views

### How can I cluster plant biomass and grain weight for different plant varieties using Ward's method based clustering?

I have plant biomass and grain weight data for different plant varieties which I now need to cluster. Do I need to define the number of clusters if using Ward's method and Squared Euclidean distance ...
1 vote
65 views

### How to find the average distance between randomly distributed points in a rectangle?

Assume there are n points randomly distributed in a rectangle (x being the height y being the width) shown below in the figure. I would like to calculate the average distance between 2 random red ...
284 views

### What is the difference between these distances in self organized maps

I am building an anomaly model and am confused between these distances below. What is the difference between these distances in self organized maps. som.iris$distances dist(som.iris$codes[]) As ...
2k views

### Difference between Euclidean, Pearson, Geodesic and Mahalanobis distance metrics

Given a set of samples $X$. We are tasked to find an appropriate distance metric for $X$ from the given options which are Euclidean Pearson Geodesic and Mahalanobis distance metrics. To solve this, ...
1 vote
157 views

### Measuring similarity of observations (non numeric)

I have a dataset of format : day,measurement1,measurement2 1,a,b 1,a,c 1,f,s 2,a,b 2,a,c 2,f,g 3,a,d 3,a,q 3,f,s In this example day1 is more similar with day2 ...
99 views

### Non-Euclidean analogue to MSE loss

The most basic machine learning model called OLS uses the RSS (squared loss) or its average, mean squared error (MSE), for its loss function, which is aligned with Euclidean geometry. What is the ...
3k views

### Z-Normalized Euclidean Distance Derivation

I am going through this paper: http://www.cs.ucr.edu/~eamonn/PID4481997_extend_Matrix%20Profile_I.pdf And on Page 4, it is claimed that the squared z-normalized euclidean distance between two ...
153 views

40 views

### Plotting Vector Embeddings

I am currently working on a project that requires some form of data on the paper. Even though I was able to get some coding done and communicate results, I need some graphs. What I want to do is ...
50 views

### Manhattan vs Euclidian Distance Measure [duplicate]

In which case we should pickup Manhattan distance and when we should use euclidian distance measure. To my understanding both are used for continues numeric data(not like cosine or others who works ...
4k views

### Why is Kullback-Leilbler divergence a better metric for measuring distance between two probability distributions than squared error? [duplicate]

I know that KL-divergence is a metric that is more suitable when we want to measure the distance between numbers which a probability form. However, I am still confused what is the benefit of using KL-...
1 vote
130 views

### How to find the list of nearest vectors if ony a vector is given?

I know there are many ways to compute similarity of two different non-zero vectors but is it possible to get a list of nearest vectors whose values are continous given a single continous vector. Lets ...
35k views

### Cosine Distance as Similarity Measure in KMeans [duplicate]

I am currently solving a problem where I have to use Cosine distance as the similarity measure for k-means clustering. However, the standard k-means clustering package (from Sklearn package) uses ...
1 vote
458 views

### How Rapidminer handle same distance for KNN Algorithm

Actually I already asked in rapidminer forum, but no one has given an answer yet.. https://community.rapidminer.com/discussion/55963/how-k-nn-algorithms-work-with-same-distance-in-rapidminer#latest ...
1 vote
677 views

### Comparing distance of two matrices with different sizes using eqdist.etest function in R

I want to compute a test statistic based on the Euclidean norm of two data matrices with same number of columns (i.e variables) but very different number of rows (i.e observations). I am using the ...
1 vote
71 views

### the accuracy of covariance between two high-dimensional vectors

Question Is the covariance between high-dimensional vectors less accruate than covariance between two vectors in low-dimensional vecotrs? I am asking this questio to check if there is a need for '...