Questions tagged [pdist]

pdist computes pairwise distance between pairs of objects in m-by-n data matrix in MATLAB.

pdist computes Euclidean distance between pairs of objects in m-by-n data matrix in .

Syntax

D = pdist(X)
D = pdist(X,distance)

Where, X is m-by-n data matrix.

  1. In D = pdist(X), the calculated distance is Euclidean distance.
  2. In D = pdist(X,distance) , the method can be specified by distance, which can be any one of the following
'euclidean'  
'seuclidean'  
'cityblock'  
'minkowski'  
'chebychev'  
'mahalanobis'    
'cosine'  
'correlation'  
'spearman'  
'hamming'     
'jaccard'  

or any custom distance function of form d2 = distfun(XI,XJ)

You should use this tag if your question is related to the use of pdist or any custom distance functions associated with it.

48 questions
0
votes
1 answer

Minkowski distance and pdist

Minkowski's distance equation can be found here. If we want to calculate the Minkowski distance in MATLAB, I think we can do the following (correct me if I'm wrong): dist=pdist([x(i);y(j)],'minkowski'); Up till here, the above command will do the…
Simplicity
  • 47,404
  • 98
  • 256
  • 385
-1
votes
2 answers

pairwise distances between list of strings rows within a dataframe column

i have a dataframe that has a column of lists of string ids. (see below). I want to create a distance matrix between all pairwise "distances" between all the rows (e.g. if 10 rows, then it's a 10x 10 matrix). the rows are lists of ids, so I'm not…
nerdlyfe
  • 487
  • 7
  • 21
-1
votes
1 answer

Finding euclidean distance between coordinates in python

I have a problem with pdist function in python. I have coordinates of points that I want to find the distance between them but it does not consider them as coordinates and find distance between two points rather than coordinate (it consider…
Fairy
  • 379
  • 1
  • 5
  • 17
1 2 3
4