Questions tagged [distance-functions]

Distance functions refer to functions used for quantifying the notion of distance between members of a set, or between objects.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Similarity matrix from Frechet distance

I have a Frechet Distance matrix and I need to transfer it to the Similarity matrix. Can I use same approach like here ?
1
vote
1answer
23 views

Am I right that Calinski-Harabasz index (Pseudo-F) can not be calculated from a distance matrix other than euclidean?

Part: I wonder if one could calculate the Calinski-Harabasz index when only having a distance matrix (and a cluster solution, of course). As you need the within and between sum of squares to come up ...
1
vote
0answers
12 views

Does Mahalanabis Distance have something to do with Min-Max normalisation? [duplicate]

Does Mahalanabis Distance have something to do with Min-Max normalisation? I know that it has something to do with Z-score normalisation, but when I tried Mahalanabis Distance on the Min-max ...
0
votes
0answers
12 views

Calculating a single Factor value against a table of variables

Ok here's a fun one... We have to calculate a given referee's strength rating/appropriateness for refereeing a given game. The number we come up with has to be something meaningful, so it should be ...
0
votes
1answer
50 views

Is Hierarchical clustering a special case of knn(specific n=1)?

I'am working on time series in the scope of similarity detection at the moment. What seems to be a well researched approach is dynamic time warping in combination with k-1NN as classification ...
0
votes
0answers
5 views

Dispersion index and Cosine distance

I have different sets of vectors of dimension n and I want to measure and compare the dispersion index of each set. For my specific problem, each set contains vector representations of words (...
3
votes
1answer
46 views

Non-metrics give “pathological” solutions: what does this mean?

In this set of slides on DTW, slide 25 says that we generally prefer metrics over measures because, "Non-Metrics can sometimes give pathological solutions when clustering or classifying data etc." ...
2
votes
0answers
84 views

Which distance metric to use to cluster categorical sequences (clickstreams or clickpaths)?

For my research, I want to cluster website visitors based on their clickstreams to understand different information behavior patterns (i.e., customer/visitor journeys). The data can be characterized ...
0
votes
0answers
16 views

How to Measure/Quantify Similarity between > 2 Sets of Dummies Indicators

I have multiple sets, each with a binary indicator for whether an element is part of the set. ...
0
votes
0answers
38 views

Signature of a distribution - Earth Mover distance

I am studying the Earth Mover Distance from here, but I have some difficulty in fully understanding what is the signature of a distribution and how it matches with the last constraint of the Earth ...
0
votes
0answers
35 views

Total variation norm

I am reading Dwork, C., Hardt, M., Pitassi, T., Reingold, O., & Zemel, R. (2012, January). Fairness through awareness. In Proceedings of the 3rd innovations in theoretical computer science ...
0
votes
0answers
15 views

Proxy for Mahalanobis distance when n < p? [duplicate]

I'm working on a ranking problem where I want to measure the distance between a collection of query points (as a group) and each target point in my database. Each query point is part of the set of ...
0
votes
0answers
20 views

determine suitable values for the parameters of the distance function for this graph

Hi I've been learning data mining and came across this question. I couldn't seem to figure it out myself. So we have a large single undirected graph(without attributes) G = (V,E) and want to detect ...
0
votes
0answers
279 views

Jaccard Index for Binary Data in R using dist function

I have a presence/absence table of 0s and 1s and I would like to cluster this data. I want to create a pairwise matrix using R's dist function which has a binary ...
1
vote
1answer
17 views

Finding the effect of nodes on a density heatmap

Let's say I have a geo-tagged dataset of all payment transactions for businesses in a city. I know whether each payment is made by cash or card, and have made a heatmap of where in the city the ...
1
vote
0answers
115 views

Relationship between KL divergence, JS divergence, and MMD?

What kind of relationship is there between the KL (Kullback-Leibler) divergence, JS (Jensen-Shannon) divergence, and MMD (maximum mean discrepancy)? I know that they all share a global minimum at $P=...
2
votes
1answer
336 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
30 views

Similarity measure before and after dimensionality reduction or clustering

I have a dataset with 500 000 samples, each sample contains 30 features. The values of the features are in the range 0.0 to 1.0. ...
0
votes
0answers
18 views

Mahalanobis: Covariance or correlation? [duplicate]

Is the Mahalanobis distance using correlations or covariances (among two vectors) to determine the similarity? I know that both are quite the same and differ only by a division of a standard deviation ...
1
vote
0answers
40 views

Distance between two distributions

I am analyzing time-series data, and I would like to detect a significant change in data distribution. I already know about Bhattacharyya distance, but that requires histograms of equal-sized bins. ...
0
votes
0answers
15 views

How to measure the “variability” across a set of many (>>2) probability distributions?

Given a set of many of discrete probability distributions, is there a way I can efficiently calculate a metric that quantifies how different the entire set of these probability distributions are to ...
0
votes
0answers
8 views

Calculate association trends

I have time series dataset for 10 consecutive periods (i.e. T, T+1, T+2, ..., T+9). Moreover, I also have 100 term triplets in each time period. Each triplet contains 3 objects namely x, y and z. I ...
4
votes
1answer
255 views

Calculation of relative distance

I have 100 term triplets as shown in the below mentioned figure. Each triplet contains 3 objects namely x, y and z. I want to rank the triplets according to the following two properties. y should be ...
3
votes
1answer
118 views

The violation of triangle inequality in KNN

If the 0<p<1 in the distance metrics, then the triangle inequality is violated. The question as follows Does the violation of this inequality affect the ...
1
vote
0answers
29 views

Distance metrics [closed]

I read about different distance metrics, such as Euclidean distance and so on. What are the machine learning algorithms that use distance metrics in their calculations?
2
votes
1answer
389 views

How can I order kmeans clusters?

I have a kmeans cluster object and I would like to order the clusters. Not the observations within the clusters, rather the clusters in order of each other. Is there a way of doing this? I found ...
-1
votes
1answer
193 views

Cleaning Up the Data with Mahalanobis Distance [duplicate]

I have a data set and I want to cleaning up my data set from the ouliers, so I decide to use the Mahalanobis distance to find the outliers. But I have a problem here since my covariance matrix isn't ...
1
vote
0answers
147 views

What happens with Mahalanobis-Distance, when the assumption of equal Covariance-Matrices breaks down

Assume that we want to compare the forecast quality of various forecasters $f$ on $n$ values such as stock-market prices or whatever. We could then define a "Mahalanobis-Distance" (MD) (or rather ...
0
votes
0answers
49 views

What distance measure (e.g. Jaccard) to use when there are correlated observations?

I would like to use a simple distance measure (e.g. Jaccard) on a rather sparse set of 0/1 variables or probability densities, for which some of the observations are similar; this is due to repeated ...
0
votes
1answer
251 views

Is Earth Mover Distance has maximum bound?

I have two probability distributions which each distribution has sum up to 1. I want to compute the distance between those two probability distributions. I want to use Earth Mover Distance to ...
4
votes
2answers
423 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
72 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) ...
2
votes
1answer
134 views

When does the Wasserstein metric attain inequality WLOG?

I’m reading a classic paper [1] that describes a version of the Wasserstein metric (aka Mallows metric), defined as follows. Let $F$ and $G$ be probabilities in $\mathbb{R} ^B$, and let $U \sim F$ and ...
3
votes
2answers
110 views

Distance calculation on variables that cannot be represented in the Euclidean space

Given a variable such as number of events attended together, which is more of a multi-dimensional data how can you calculate a sort of distance between people (i.e. ...
1
vote
0answers
25 views

Name of divergence $D(p||q) = \max_x {p(x) - q(x)}$

$D(p||q) = \max_x {p(x) - q(x)}$ is thought of as a very simple divergence for two continuous probability distributions. This satisfies minimum requirements of divergence, $D(p||q)\ge0$ and $D(p||q)=...
0
votes
1answer
212 views

K-means clustering on a large matrix using kendall's tau as a distance measure

I'm trying to use kmeans clustering on a relatively large matrix (4000x4000) using the amap::Kmeans function but R seems to be freezed even after more than half an hour. I have to restart R after this....
3
votes
2answers
190 views

Distance metric for source code

I'm trying to compare source code from multiple github projects, and in particular I'm looking for projects that include large chunks of code from other repositories, or large chunks with small ...
0
votes
1answer
35 views

How to compare hundreds of one-dimensional functions

I have hundreds (2002 in today's case) of functions of the distance between two objects: $f_1(x)$, $f_2(x)$, ..., $f_{2002}(x)$. They are correlation functions. They all converge to 0 when $x$ is ...
1
vote
0answers
22 views

How to calculate the similarity/distance between multiple measures for a single individual

I have what may be a relatively simple query, but I'm unsure of the best way to do it. I would like to calculate the similarity between multiple measures for a single individual. I have a data matrix ...
1
vote
2answers
98 views

calculating distance to 1 (positive and negative numbers)

I have what I assume is a very simple question. I have a range of numbers from 81 to -6, that corresponds to racios pop. growth/urban construction of cities. The ideal ratio would be = 1. I need, ...
4
votes
2answers
610 views

Is there a version of the Mahalanobis distance for matrices?

I'm working on a computer vision problem and I want to use the Mahalanobis distance to cluster image patches (2D matrices having the same dimensions). I haven't been able to find any generalisation up ...
0
votes
3answers
1k views

Can I use Manhattan distance on binary data for hierarchical clustering?

I understand that classically Jaccard and Hamming work best with binary data, but is there anything specifically wrong with using a Manhattan distance instead with the complete linkage function?
1
vote
0answers
441 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 ...
3
votes
0answers
526 views

Clustering in high dimensions: distance metrics, binary vs continuous, statistical tests for number of clusters / noise points [closed]

I’ve got several thousand observations in approximately 300-dimensional space, in a relatively sparse matrix (typically 30 non-zero dimensions per observation). I'm using a clustering algorithm (so ...
0
votes
0answers
81 views

Levenshtein distance “proper” range for fuzzy matching

I am hoping to use Levenshtein distance concept for fuzzy matching in SQL joins between two tables on t1.first_name||last_name = t2.first_name||last_name. Is ...
5
votes
1answer
3k views

Can KL-Divergence ever be greater than 1?

I've been working on building some test statistics based on the KL-Divergence, \begin{equation} D_{KL}(p \| q) = \sum_i p(i) \log\left(\frac{p(i)}{q(i)}\right), \end{equation} And I ended up with a ...
0
votes
2answers
52 views

Clustering with Self Organizing Maps including time, date and month as attributes

I am about to start up a project on pattern recognition in a highdimensional dataset holding information on transactional salesdata for a company. In that manner I have decided to use the method of ...
0
votes
1answer
171 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 ...
2
votes
1answer
77 views

Mahalanobis distance invariant against further elements/individuals?

Assume following: There are ten individuals and each is represented by two properties (Size and Gender). Now I measure the distance between two individuals A and B via the Mahalanobis distance: $$ d(...
1
vote
0answers
141 views

covariance matrix of individuals or of the pool?

At first: I have individuals represented by vectors with four entries/properties: ...