Questions tagged [euclidean-distance]

the Euclidean distance or Euclidean metric is the "ordinary" distance between two points that one would measure with a ruler, and is given by the Pythagorean formula.

In mathematics, the Euclidean distance or Euclidean metric is the "ordinary" distance between two points that one would measure with a ruler, and is given by the Pythagorean formula. By using this formula as distance, Euclidean space (or even any inner product space) becomes a metric space. The associated norm is called the Euclidean norm.

http://en.wikipedia.org/wiki/Euclidean_distance

941 questions
0
votes
0 answers

Calculate distance in a point cloud as cube distances

I'm working with python on a 3d point cloud files that are in format XYZ, I need to calculate the distance from each one of them to the center, and then label (and colour for better visualization) them according to it. So far I got this cloud…
0
votes
0 answers

Extract numpy array of Euclidean distances

I am trying to extract a python numpy array of euclidean distances. I already have the values properly imported and distances calculated, and they are already in a visual heat map, but I do not know how to extract the values in a simple array to do…
b1234
  • 63
  • 7
0
votes
0 answers

How to implement Mahalanobis Distance in Matlab for Eigenfaces

I'm trying to implement the Eigenfaces algorithm and was able to check if a face matches by checking the euclidean distance as shown below. I would like to improve the code using Mahalanobis Distance instead. similarity_score = arrayfun(@(n) 1 / (1…
0
votes
0 answers

Monalisa TSP Tour Length/Distance always wrong

the tour length of www.math.uwaterloo.ca/tsp/data/ml/tour/monalisa_5757191.tour is supposed to be 5757191 yet my code gives a result of 5759929.877458311. Assuming that the claim of being willing to pay $1000 for any improvement to be true, then…
0
votes
1 answer

Euclidean distance calculation using apache flink

Apache flink has setup libraries to calculate euclidean distance. I want to use the same API for distance calculation on n-dimensional space. I have two dataset with 3 features. a = {0.1,0.3,0.8} b = {0.2,0.4,0.7} How can I calculate the…
Soumyajit Swain
  • 1,298
  • 1
  • 21
  • 35
0
votes
1 answer

computing the euclidean distance for KNN

I've been seeing a lot of examples of computing euclidean distance for KNN but non for sentiment classification. For example I have a sentence "a very close game" How do I compute the euclidean distance for the sentence "A great game"?
0
votes
1 answer

Python: how to create a distance network with a given distribution?

I have N agents to place in a grid n x n following the (truncated Levy) distribution px = (r + r0)**(-beta)*exp(-r/k) Each agent has two favorite cells: home and work and px is the probability for each agent to move from home and work with a…
emax
  • 6,965
  • 19
  • 74
  • 141
0
votes
0 answers

Compute total distance along vector by distance matrix look up

I have a data.frame of an ordering of row.names and I'd like to compute the total distance for each row (e.g. Var1 --> Var2 --> Var3 --> Var4 --> Var5 --> Var6 --> Var7). l1 <- as.list(c(row.names(subset(example, Timepoint=='T1')))) l2 <-…
user2117258
  • 515
  • 4
  • 18
0
votes
2 answers

Calculating distance between two LaB colors Java

I am working on a program where I am trying to find the euclidean distance between two LaB colors. I was wondering if they way I calculate the the distance between the two is correct . Here is what I am doing: public static void main(String[] args)…
ProgrammingCuber
  • 377
  • 4
  • 14
0
votes
1 answer

Good similarity measure for comparing users

I want to compare users based on responses to 10 questions. My original idea was to resolve each question to an integer [1, 5], but this idea won't work all the time. For example: vec1 = [1,1,1,1,1,1,1,1,1,1] vec2 =…
0
votes
1 answer

Speed-up special case euclidean distance in MATLAB

I want to optimize the following code example: %Example definition A = rand(40,10000,250); B = rand(40,10000,250); %Euclidean seuc = sum((A-B).^2, 3); Do you have any idea how to speed this up? Or is it already optimized for MATLAB?
yoshiii90
  • 15
  • 4
0
votes
0 answers

Using the Weighted Euclidean Distance Function for DBSCAN in ELKI

I'm experimenting with ELKI (which is awesome, btw) and would like to try the weighted Euclidean distance function as a metric for the DBSCAN algorithm. First of all, I don't know how it works, except for this. I tried a few values for the…
BSheep
  • 1
  • 1
0
votes
1 answer

Caffe EuclideanLoss reproduce in Tensorflow

I am trying to reproduce the EuclideanLoss from Caffe in Tensorflow. I found a function called: tf.nn.l2_loss which according to the documents computes the following: output = sum(t ** 2) / 2 When looking at the EuclideanLoss in the Python version…
user4911648
0
votes
2 answers

which distance function between two different variables?

What is the best metric to calculate the distance between two objects? The objects are represented by four paremeters (two same variables before and after a procedure). The goal is to assign data points as pairs among the whole set. Additionally …
Ben
  • 1,432
  • 4
  • 20
  • 43
0
votes
0 answers

nested transformations apache spark

I need some help about my code, which doesn't response. I need to compute similarities between items mutually based on their ratings, these similarities will be used to construct the similarity matrix. I have three main functions: the first one…