Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [euclidean]

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

0
votes
0answers
13 views

Measuring distance preservation in dimensionality reduction

I am looking to compare the distance preserved during dimension reductions for several techniques. I have read some papers on similar topics here and here. For example, I would like to use the ...
3
votes
0answers
27 views

Is my variable considered okay to use in k-means clustering with Euclidean distance?

I was wondering if I can use regular kmeans() in R with my variable "number of drug prescriptions" which equals a number between 1-25. From what I've read k-means ...
0
votes
0answers
12 views

Set similarity as weight to ratings

I have a problem deciding which similarity function to use. I want to find the similarity between the users based on their requirements about computer performance metrics normalized to 1. Each user ...
2
votes
1answer
37 views

What to do when results of hiearchical, k-means elbow, and k-means silhoutte disagree?

I am conducting a cluster analysis involving 60 subjects and 5 continuous variables. After appropriate scaling, I performed hierarchical clustering with Euclidean distance and complete linkage, and ...
1
vote
0answers
45 views

How to improve Pairwise Euclidean Distance for Similarity Measure

I am trying to identify the most similar stations between two DataFrames like below: ...
0
votes
0answers
37 views

Dot Product and Distance Matrix

If we want to calculate the squared distance between 2 vectors, $x$ and $y$, we use the dot product: $$||x-y||^2 = (x-y)(x-y)^T = xx^T - 2xy + yy^T$$ The question is, how to generalize this concept ...
2
votes
1answer
132 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 ...
0
votes
0answers
47 views

Clustering: choosing correlation-based over euclidean distance (fviz_dist)

I'm trying to cluster some business data. You can imagine the data as describing customers (age, no. of purchases, satisfaction after the first purchase, etc.). I work with normalised data. I also ...
2
votes
1answer
37 views

$L_2$ norm of product of two vectors

Let's assume we have two matrices $A^{d\times 1}$ and $B^{1 \times e}$, and we define their product as $C^{d\times e}$. Assuming $A,B$ are real valued with all entries in $[-1,1]$. I can intuitively ...
2
votes
1answer
44 views

Distance metric with characteristics of cosine and Manhattan

I'm working on a project where I want to find similarities between groups of events. So far I have expressed groups of events as vectors of event counts and computing similarities between them. I'm ...
0
votes
1answer
22 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, ...
0
votes
0answers
12 views

Comparing relative distances between separate ordinations

I have four sites: Treatment_1 and Control_1 of experiment 1 (8 plots in total) Treatment_2 & Control_2 of experiment 2 (8 plots in total) I ran an RDA for each experiment separately to compare ...
0
votes
0answers
17 views

Best method to obtain representative sample for clusters in high-dimensional space

I am clustering a large amount of high-dimensional data using KMeans (and the Euclidean distance metric), and then calculating the silhouette score and the Euclidean distance to the calculated cluster ...
-1
votes
1answer
216 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 ...
0
votes
1answer
26 views

Similarity between 2 profiles (observations). Is it possible to generate a % similarity?

I have multiple profiles for 10 different people. Each person has been measured for 5 different continuous variables of different magnitudes. So my dataframe is 10x5 where each row represents a person ...
1
vote
1answer
102 views

Does it make sense to cluster asymmetric binary data with Ward's method?

I'm working with 104x42 data set where all variables are (asymmetric) binary (0-1). I've read that Ward's linkage method doesn't work theoretically properly with binary data beaucause it requests ...
0
votes
0answers
7 views

What features or architecture for a text answering system?

From this dataset with paragraphs, questions about these paragraphs and answers from these paragraphs, when there exists, I'm trying to predict the sentence where there is an answer. After ...
9
votes
1answer
409 views

My neural network can't even learn Euclidean distance

So I'm trying to teach myself neural networks (for regression applications, not classifying pictures of cats). My first experiments were training a network to implement an FIR filter and a Discrete ...
1
vote
1answer
39 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[[1]]) As ...
1
vote
1answer
25 views

Hierarchical Cluster Analysis of 100 objects with 114 variables each

I'm intending to make a cluster analysis of 100 objects. I've read a couple of books and determined that a Hierarchical agglomerative procedure with Ward's linkage method should be used in my case. As ...
2
votes
0answers
211 views

Obtain within-group Gram matrix out of distance matrix

Gram matrix Let $\bf X$ be a n x p dataset with columns (variables) centered. Then p x p $\bf X'X$ is the total scatter matrix ...
0
votes
0answers
45 views

Common methods to calculate total distance from data with categorical, continuous and counting variables

I have a data set with categorical, continuous and counting variables. I want to be able to use a method that will give me a distance for each pairwise data point. From my understanding, each type ...
4
votes
2answers
217 views

Is the maximum bound of Euclidean distance between two probability distributions equal to $\sqrt{2}$?

I used Euclidean distance to compute the distance between two probability distribution. The example of computation shown in the Figure below. As my understanding, the maximum distance occur while $...
2
votes
0answers
47 views

Recovering a distance matrix from nonnegative sparse correlation matrix?

After doing extensive literature research in all sorts of science I am completely puzzled. I am trying to find out what the state-of-the-art techniques would be to recover a (let's say euclidean) ...
1
vote
0answers
20 views

Shrinking the mean: distance loss function and risk function

I'm reading some slides about the shrinkage of the mean and I cannot understand some results. Assume an n-dimensional vector $\mathbf{x} \sim N(\mu, I_n)$. We are interested in obtaining an estimate ...
0
votes
0answers
6 views

Modifying input feature set to incorporate neighboring weekdays effect

I'm using k-NN regression for one of my problems where one of the feature of my input feature set contains the type of weekday (0 for Monday $\ldots$ 6 for Sunday). This has been used to account for ...
3
votes
0answers
95 views

Which dimensionality reduction technique preserves the k nearest neighbors (euclidean space)?

I'm looking for a lower dimensional projection of data such that the k nearest neighbors (in Euclidean space) in high dimensions remain the k nearest neighbors in low dimensions. I found that Isomap ...
0
votes
1answer
86 views

Normalized weighted Euclidian Distance

Hi Guys I would like to get an euclidian distance and be able to compare multiple set o data but I am not sure how to normalized it properly Each data set have values ranging from (-100->100) and ...
1
vote
0answers
360 views

Distance Matrix for Big Data

I have been struggling to create a distance matrix for some Big Data (800,000x20). I have tried R (dist function), Matlab (pdist function), and cloud computing (to increase RAM). Ultimately, the ...
0
votes
1answer
468 views

Distance between all the dots in a scatterplot in R [closed]

Is there any possibility in R to get a list of distances between all the points in a Scatterplot? For instance, this Scatterplot: So, I would like to obtain a list of distances among all the points.
2
votes
1answer
2k views

Explanation for MSE formula for vector comparison with “Euclidean distance”?

I study the loss functions for regression tasks with artificial neural networks. In case of evaluating loss with Mean Squared Error for multidimensional outputs I read the following usual formula ...
0
votes
1answer
131 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 ...
0
votes
1answer
143 views

Mathematical term for finding the variance of the euclidean distance between two matrices of the same dimension?

Is there any mathematical term for carrying out this procedure. I am finding the euclidean distance between the rows of the matrices by treating them as individual vector. Then I get a single vector A ...
0
votes
0answers
178 views

Why is only Euclidean distance allowed to be used for Ward's method? [duplicate]

Using scipy, I noticed that I am allowed to use only Euclidean distance for Ward's method. Is it because Ward's uses Error Sum of Squared? What if I use Ward's method with cosine similarity? Cosine ...
1
vote
1answer
33 views

Measuring simmilarity 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 ...
1
vote
0answers
269 views

Dummy data clustering: OK to apply Euclidian distance hierarchical clustering on Jaccard similarity matrix?

I created dummy variables (binary data) from categorical variables where I want to partition N subjects into multiple classes by some clustering method. I created a Jaccard similarity index matrix for ...
7
votes
1answer
9k 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 Kmeans clustering. However, the standard Kmeans clustering package (from Sklearn package) uses ...
1
vote
1answer
21 views

Question related to symmetry in distances

My dataset represents products and evaluation of every product by users. E.g., I might have: ...
1
vote
1answer
282 views

linear decision boundaries of using the Euclidean distance?

How does Euclidean-norm in K-means cause it to have linear decision boundaries? The Euclidean-norm is a non-linear measure between two points, then how does it make the boundaries till linear?
0
votes
0answers
84 views

Is the Normalized Information Distance (NID) a euclidean distance?

I'm trying to determine if I can plot my dissimilarity matrix (which is a Normalized Information Distance / the "Universal Distance Metric" dissimilarity matrix), in a lower-dimensional space using ...
2
votes
0answers
884 views

Convert Pearson correlation matrix into dissimilarity matrix

I would like to execute multidimensional scaling (MDS) based on a matrix of Pearson correlation coefficients. The sklearn.manifold.MDS function takes a dissimilarity matrix as an input and I therefore ...
0
votes
1answer
437 views

Is there a difference between K Nearest Neighbor = 1 and Minimum Euclidean Distance Classifier?

I believe the header asks it all. In this case, I am assuming I am using euclidean distance for KNN as well. Therefore when KNN = 1, I should be looking for only the nearest point, which should be the ...
3
votes
0answers
941 views

Cross-validated Manhattan/L1 distance

Consider the task that we want to compute the Euclidean distance between two vectors $\mathbf{a}$ and $\mathbf{b}$, where the vectors are noisy sample from some measurement. Our goal is to get an ...
3
votes
0answers
371 views

Curse of dimensionality for time series?

I am a bit boggled when trying to conciliate econometric and machine learning view for time series. Let's assume that each of the $N$ (stochastic) time series have $T$ synchronous i.i.d. observations,...
0
votes
1answer
432 views

High dimensional clustering of percentage data using cosine similarity

I'm building a clustering algorithm and was trying to determine the best way to get separate and accurate clusters. I have 300+ features to cluster on, and they are all percentages between 0 and 1. ...
1
vote
1answer
211 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 ...
3
votes
3answers
939 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 ...
3
votes
3answers
100 views

How to find the most similar profiles ?

Let's start with an example: I would like to know what alternative for euclidean distance could be use to distinguish if orange or blue plot is "closer" to red one. In which situations I should apply ...
0
votes
1answer
1k views

Why is the Manhattan distance (or block distance) appropriate when I have a discrete data set?

Why is the Manhattan distance (or block distance) appropriate when I have a discrete data set and the Euclidean distance is appropriate when I have continuous numerical variables? Thanks for reply
3
votes
1answer
696 views

What is the inverse square of a distance (Euclidean)?

I'm studying k-nearest neighbor algorithms and the book I'm reading mentions that records are weighted according to their inverse square in order to perform weighted voting. so I was wondering what ...