Questions tagged [k-means]

k-means is a method to partition data into clusters by finding a specified number of means, k, s.t. when data are assigned to clusters w/ the nearest mean, the w/i cluster sum of squares is minimized

227 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
632 views

Can silhouette be calculated with distances to centroids, instead of pairwise point distances?

I am using Silhouette cluster validation for each repetition (for a specific K) of k-means, k-modes and k-medoids. All the definitions of Silhouette I see calculate the distance of each point to ...
4
votes
0answers
1k views

Pearson's Correlation Coefficient as a clustering criterion: why should it be close to -1?

Let's say we have a dataset $x = (x_1, x_2, ..., x_n)$ where each data point is assigned to one of $m$ clusters. Let $D = \{d_{ij}\}$ be the $n\times n$ distance matrix where $d_{ij} = d(x_1, x_j)$. ...
4
votes
0answers
19k views

k-means clustering why sum of squared errors (why k-medoids not)?

K-means clustering uses the sum of squared errors (SSE) $E = \sum\limits_{i=1}^k \sum\limits_{p \in C_i} (p-m_i)^2$ (with k clusters, C the set of objects in a cluster, m the center point of a ...
3
votes
0answers
31 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 ...
3
votes
1answer
157 views

k-means clustered data: how to label newly incoming data

I have a data set with labels that were produced by a k-means clustering algorithm. Now there is some data (with the same data structure) from another source and I wonder what is the most sensible way ...
3
votes
0answers
575 views

Clustering a set of curves

I am working with a MRI dataset where we inject dye into a person's wrist and measure intensity per time on a voxel-by-voxel basis. I am trying to determine if it is possible to identify certain ...
3
votes
0answers
627 views

If I want to do PCA before k - means, is it mandatory to do it for all variables?

I have 10 variables and some of them are highly correlated. So before I do k - means, I want to get lower number of variables that are not correlated, but retain as much information as possible. Thus, ...
3
votes
0answers
68 views

How to check whether there are any clusters in data?

In short: I am using k-means clustering with correlation distance. How to check, how many clusters should be used, if any? There are many indices and answers on how to establish a number of clusters ...
3
votes
0answers
156 views

How to deal with variability in clustering. Multiple/Meta clustering?

I'm not sure what information is relevant here, so here is some background: I'm using Python 3 / sklearn, but I could probably use R if needed. I have a small sparse data-set (~1500 samples, ~1600 ...
3
votes
0answers
681 views

Why does Kernel K-means work better than spectral clustering in this case?

I want to cluster a dataset using spectral clustering. Assuming $X$ is $d \times n$ data matrix as $n$ is the number of data samples. I construct a directed Adjacency matrix $W, n \times n$ in which ...
3
votes
0answers
210 views

Convergence of k-means or EM on Mixture of Gaussians

There are many algorithms for learning mixture of Gaussians but typically k-means/EM is used in practice. My question is related to the performance of k-means/EM for MoG. Recently, I came across this ...
3
votes
0answers
70 views

Adding weights to functions not accepting weights

If I had a vector of weights for each observation data(iris) wghts <- abs(rnorm(nrow(iris))) And I had a function that did not accept weights as an argument: ...
3
votes
0answers
6k views

K-Means Clustering with Dummy Variables

I want to use k-means to cluster my data. I have broken one column into 4 dummy variables and I have normalized all of the data to mean=0 and sd=1. Will k-means work with these dummy variables? I ...
3
votes
0answers
8k views

R: silhouette with k-means

I'm currently checking some clustering evaluation indexes in R, and now I'm using Silhouette and its respective function in R, "silhouette" (in "cluster" package). To test the method, I used the ...
3
votes
2answers
503 views

Need a little help understanding K-means++ seeding

I have been working on a project that involves using K-means clustering for generating adaptive palettes from images. I understand the general process of K-means clustering, and I understand the ...
2
votes
1answer
273 views

A proof of within-cluster sum of squares?

Anyone can provide a proof of the following equation as in @cardinal 's answer? $x_i$ and $x_j$ are vectors from the same clusters。 $\sum_{i,j} ||x_i - x_j||^2 = \sum_{i \neq j} ||(x_i - \bar{x}) - (...
2
votes
0answers
685 views

Is pairwise distance matrix useful to k-means?

The k-means implemented in scikit-learn precomputes distances but I don't how these distances are used. In its standard version, k-means is known to compute only the distances between the points and ...
2
votes
1answer
258 views

Compare clustering results with different attributes and number of clusters

I used K-means to cluster a large data set that has millions of samples. I tried to create the clusters with different sets of attributes, which, as a result, generated different optimal number of ...
2
votes
0answers
393 views

Difference between identifying outliers using LOF and K-means clustering

I am identifying outliers using K-means and LOF (Local Outlier Factor). Let's say if we are identifying possible outliers using both the techniques, I believe LOF will pick global outliers also as ...
2
votes
0answers
149 views

How to cluster customers by their purchases

I have matrix with about 40 columns which are sales of specific products and about 15 000 rows. Each row is purchases of specific customer. The data consists of information about sales for 2 years ...
2
votes
0answers
834 views

K means clustering for time series data

Suppose, we have three metrics (M1,M2,M3) for one database D1 which have time series data and similarly same metric (M1,M2,M3) for other database D2 and so on.How do we cluster using K- means ...
2
votes
0answers
96 views

Clustering data sitting close to corners of an N-dimensional parallelepiped

I am looking for a method of clustering data that are close to the corners of an $N$-dimensional parallelepiped (but I don't know the vectors spanning it). Is there a good method for finding ...
2
votes
0answers
67 views

Distribution of the initializing set at K-means++

There is a well-known modification of the initializing step of K-means, named K-means++. It chooses cluster centers with probability proportional to its squared distance from the point's closest ...
2
votes
0answers
193 views

When should I use classical k-means clustering and when should I use trimmed k-means clustering?

I suspect that if there are many unimportant outliers, trimmed k-mean clustering should be employed. Am I on the right track?
2
votes
0answers
118 views

Regression analysis for a big set of data

Well, it's my first post but I have been struggling hard with this problem so I had to look after help. The problem: I have a high set of data like this one (black dot are the data): I have to find ...
2
votes
0answers
545 views

Should dummy variables be normalized along with numeric variables when doing kmeans clustering

I am trying to cluster the data set 'How Americans spend their time' using kmeans clustering. The data set contains education, gender and age-range (55-60, 60-65 etc) as categorical variables and ...
2
votes
0answers
304 views

A problem with implementing PCA-guided k-means

I am new to machine learning. I am reading the papers K-means Clustering via Principal Component Analysis and PCA-guided search for K-means. But there are too many mathematical proofs in these papers. ...
2
votes
0answers
1k views

K-Means Clustering using modified correlation (1 - pearson correlation coefficient)

I am trying to implement k-means clustering on a 6x6 data set that looks like this: 2 3 6 0 1 7 4 9 9 6 2 2 0 1 7 9 5 0 2 3 2 7 8 3 8 2 9 2 3 1 8 0 0 1 7 9 Using ...
2
votes
0answers
990 views

Is K-Medoids really better at dealing with outliers than K-Means? (with example showing the contrary)

K-Medoids and K-Means are two popular methods of partitional clustering. The consensus is that K-Medoids is better at clustering data when there are outliers (source). This is because it chooses data ...
2
votes
0answers
1k views

Checking the assumptions of K-means clustering

I want to do a k-means clustering on a dataset containing 22 numerical variables between 0 and 100 and 75 observations using R. I read this post How to understand the drawbacks of K-means on k-means ...
2
votes
0answers
644 views

kMeans unsupervised feature learning on multiple layers

I'm trying to develop an unsupervised feature learning pipeline. I have a train set with 512x512 images. I've extracted 16x16 patches, performed preprocessing steps (normalization and whitening). ...
2
votes
0answers
148 views

Anomaly Analysis (K-Means) - finding suspicious activities/operators

I am relativly new to the field of data mining and want to make a anomaly detection on transactional retail data. I want to use a simple anomaly detection (kmeans at the moment) for finding suspicious ...
2
votes
0answers
209 views

Vector Quantization of heavy tailed distribution

I'm generating with Monte Carlo simulation some stock price $X$. Once I have the stock price sample, I want to cluster it with 100 points $\hat{X}$. My problem is that the error associate with my k-...
2
votes
0answers
432 views

Standardizing non-normal data for use in distance-based classifier

I have a dataset containing non-normally distributed variables that I want to feed into a distance-based classifier (e.g. K-means). Is it ok to just subtract the mean and divide by the standard ...
2
votes
0answers
1k views

Using linear discriminant analysis to validate the cluster groups resulting from kmeans

I'm currently working on a cluster analysis project and ran kmeans on the data for k=2. I was reading similar articles on similar experiments, and the investigators used discriminant analysis to ...
2
votes
0answers
7k views

Distance threshold for clustering

Usually online clustering methods (based on kmeans or not) define a distance threshold value. If a new data-point $x$ is far enough from the nearest center $c$ (i.e. the distance from $x$ to $c$ is ...
1
vote
0answers
6 views

Dimension reduction - doing a PCA on the coordinates of a MCA

I have a dataset with 25 continuous variables and 2 categorical variables. I want to perform k-means clustering, so as a previous step I am performing a multiple correspondence analysis on the ...
1
vote
1answer
28 views

Modifying k-means for points on torus

My data coordinates are degrees so each axis has values [-180, 180]. Therefore it's easy to spot that in fact the scatter plot on the right end continues on the left side and the same thing for up and ...
1
vote
1answer
54 views

K-Means clustering: optimal clusters for common data sets

I use scikit-learn to get IRIS and WINE clusters for evaluating an algorithm for K-means clustering. The K-means algorithm is a heuristic algorithm for solving the "minimum-sum-of-squares-clustering (...
1
vote
1answer
106 views

K-means gives non-spherical clusters

I am trying to cluster 24 month utilization behaviors of customers using sklearn/K-means in python. When I plot the customers by clusters in a 2-D space (Principal Components 1 and 2 of my 24-point ...
1
vote
0answers
110 views

Why does kmeans after SVD result in ideal clusters

I am clustering tweets which are related to eye fashion and they are extracted using keywords like mascara, eyeliner, eyeshadow, etc from twitter. I constructed a Tf-idf matrix (tweets x words) ...
1
vote
0answers
16 views

Graph clustering for balanced sum of absolute deviations within each cluster (same sum of intracluster distances)

I'm given a set of points and a distance matrix. With these I'm trying to develop an algorithm similar to k-means that tries to minimize the sum of distances from each cluster datapoint to it's center ...
1
vote
0answers
665 views

How to determine the best batch-size value for Mini Batch K-means algorithm?

I am working on a project where I apply k-means on severals datasets. These datasets may include up to several billion points. I would like to use mini batch k-means to save time. However, the mini ...
1
vote
0answers
91 views

Apply K-means to the columns of the covariance matrix

In Section 5.3 of the paper distilling the knowledge in a neural network, it says we apply a clustering algorithm to the covariance matrix of the predictions of our generalist model, so that a set ...
1
vote
0answers
15 views

k-means and (re?) standardisation of a sub-set

I have data which is customer purchases of items in each of three months: I have summed the data over the three months for each customer; calculated the proportion of purchases that each item ...
1
vote
0answers
405 views

Grouping similar time series (clustering, cointegration)

I have a number of time series' that I am effectively trying to understand which are similar and which can be grouped together. I have some idea of what should be grouped with each other but I am also ...
1
vote
0answers
37 views

Why using L-method with CH and SIL for number of cluster selection?

In this paper, the author uses CH (Caliński–Harabasz index) and SIL (Silhouette index) methods to decide the number of clusters. However, instead of selecting the highest values, it applies a L-...
1
vote
1answer
173 views

Are my cluster means significantly different?

I have just performed a K-means clustering analysis on 43 variables and as a result I have 2 cluster. Now I want to test if the cluster means for each variable are significantly different between the ...
1
vote
1answer
231 views

Clustering spatial data based on location and values

I'm looking for a way, preferably in R, to create a cluster of point data (specifically, the centroids of UK postcodes), where each cluster comes as close as possible to containing a certain number of ...
1
vote
0answers
93 views

Selecting null reference distribution

I was going through an explanation of gap statistic here when I happened to come across the phrase null reference distribution of the data. And this is something I need help to understand. From what ...

1 2 3 4 5