Linked Questions

3
votes
1answer
487 views

Can I use k-means with a distance matrix composed of percentages? [duplicate]

I have objects o1, o2,...,on and for each pair I calculate a value that measures the pair's difference. This is a percentage, so for example o1o2 differ by 56%. Now I want to cluster this data. I can ...
61
votes
6answers
85k views

Why does k-means clustering algorithm use only Euclidean distance metric?

Is there a specific purpose in terms of efficiency or functionality why the k-means algorithm does not use for example cosine (dis)similarity as a distance metric, but can only use the Euclidean norm? ...
62
votes
5answers
104k views

Loadings vs eigenvectors in PCA: when to use one or another?

In principal component analysis (PCA), we get eigenvectors (unit vectors) and eigenvalues. Now, let us define loadings as $$\text{Loadings} = \text{Eigenvectors} \cdot \sqrt{\text{Eigenvalues}}.$$ I ...
21
votes
8answers
17k views

Perform K-means (or its close kin) clustering with only a distance matrix, not points-by-features data

I want to perform K-means clustering on objects I have, but the objects aren't described as points in space, i.e. by objects x features dataset. However, I am able ...
34
votes
3answers
37k views

Why does correlation matrix need to be positive semi-definite and what does it mean to be or not to be positive semi-definite?

I have been researching the meaning of positive semi-definite property of correlation or covariance matrices. I am looking for any information on Definition of positive semi-definiteness; Its ...
18
votes
9answers
9k views

Pairwise Mahalanobis distances

I need to calculate the sample Mahalanobis distance in R between every pair of observations in a $n \times p$ matrix of covariates. I need a solution that is efficient, i.e. only $n(n-1)/2$ distances ...
14
votes
2answers
7k views

Understanding distance correlation computations

As far as I understood, distance correlation is a robust and universal way to check if there is a relation between two numeric variables. For example, if we have a set of pairs of numbers: ...
12
votes
3answers
26k views

Euclidean distance score and similarity

I'm just working with the book Collective Intelligence (by Toby Segaran) and came across the Euclidean distance score. In the book the author shows how to calculate the similarity between two ...
15
votes
3answers
6k views

Is it ok to use Manhattan distance with Ward's inter-cluster linkage in hierarchical clustering?

I am using hierarchical clustering to analyze time series data. My code is implemented using the Mathematica function DirectAgglomerate[...], which generates ...
5
votes
2answers
11k views

Gower's (dis)similarity index

I would like to ask a question about Gower similarity/dissimilarity index. Is it ok to use the Gower dissimilarity measure with Ward linkage clustering? I was reading that the Gower similarity index ...
7
votes
2answers
13k views

K-means: Why minimizing WCSS is maximizing Distance between clusters?

From a conceptual and algorithmic standpoint, I understand how K-means works. However, from a mathematical standpoint, I don't understand why minimizing the WCSS (within-cluster sums of squares) will ...
9
votes
2answers
1k views

Does a distance have to be a “metric” for an hierarchical clustering to be valid on it?

Let us say that we define a distance, which is not a metric, between N items. Based on this distance we then use an Agglomerative hierarchical clustering. Can we use each of the known algorithm (...
7
votes
4answers
8k views

Pairwise Mahalanobis distance in R [duplicate]

I'm trying to calculate a Mahalanobis-type pairwise distance matrix in R. I have 33 individuals, each with 10 variables. The idea is to get a distance matrix D, where $$D_{i,j}=(\mathbf{X}_i-\mathbf{...
2
votes
1answer
6k views

Chosing optimal k and optimal distance-metric for k-means [duplicate]

I have a data-set with roughly 20-dimensions and millions of points which I want to cluster. The goal is to find a set of clusters which: Are as distinct as possible from each other (minimum ...
3
votes
2answers
2k views

Inverting non positive definite covariance matrix

I have an expression for a covariance matrix $C$ in terms of the indices $i$ and $j$. In this way I can analytically calculate the elements of my covariance matrix, however when I try to invert $C$ ...

15 30 50 per page