Questions tagged [k-means]

k-means is a family of cluster analysis methods in which you specify the number of clusters you expect. This is as opposed to hierarchical cluster analysis methods.

Filter by
Sorted by
Tagged with
149
votes
13answers
191k views

K-Means clustering for mixed numeric and categorical data

My data set contains a number of numeric attributes and one categorical. Say, NumericAttr1, NumericAttr2, ..., NumericAttrN, CategoricalAttr, where ...
56
votes
8answers
68k views

Clustering geo location coordinates (lat,long pairs)

What is the right approach and clustering algorithm for geolocation clustering? I'm using the following code to cluster geolocation coordinates: ...
23
votes
3answers
17k views

K-means incoherent behaviour choosing K with Elbow method, BIC, variance explained and silhouette

I'm trying to cluster some vectors with 90 features with K-means. Since this algorithm asks me the number of clusters, I want to validate my choice with some nice math. I expect to have from 8 to 10 ...
17
votes
4answers
19k views

K-means: What are some good ways to choose an efficient set of initial centroids?

When a random initialization of centroids is used, different runs of K-means produce different total SSEs. And it is crucial in the performance of the algorithm. What are some effective approaches ...
15
votes
2answers
7k views

K-means vs. online K-means

K-means is a well known algorithm for clustering, but there is also an online variation of such algorithm (online K-means). What are the pros and cons of these approaches, and when should each be ...
14
votes
2answers
2k views

Fast k-means like algorithm for 10^10 points?

I am looking to do k-means clustering on a set of 10-dimensional points. The catch: there are 10^10 points. I am looking for just the center and size of the largest clusters (let's say 10 to 100 ...
10
votes
4answers
20k views

Clustering for mixed numeric and nominal discrete data

My data includes survey responses that are binary (numeric) and nominal / categorical. All responses are discrete and at individuals level. Data is of shape (n=7219, p=105). Couple things: I am ...
10
votes
1answer
3k views

Convergence in Hartigan-Wong k-means method and other algorithms

I have been trying to understand the different k-means clustering algorithms mainly that are implemented in the stats package of the ...
8
votes
1answer
54k views

Confused about how to apply KMeans on my a dataset with features extracted

I am trying to apply a basic use of the scikitlearn KMeans Clustering package, to create different clusters that I could use to identify a certain activity. For example, in my dataset below, I have ...
8
votes
3answers
10k views

How to get the probability of belonging to clusters for k-means?

I need to get the probability for each point in my data set. The idea is to compute distance matrix (first column contsins distances to first cluster, second column conteins distances to second ...
8
votes
2answers
9k views

Clustering high dimensional data

TL;DR: Given a big image dataset (around 36 GiB of raw pixels) of unlabeled data, how can I cluster the images (based on the pixel values) without knowing the number of clusters ...
7
votes
2answers
2k views

Efficient dynamic clustering

I have a set of datapoints from the unit interval (i.e. 1-dimensional dataset with numerical values). I receive some additional datapoints online, and moreover the value of some datapoints might ...
7
votes
1answer
2k views

Bag of Visual Words

What I am trying to do: I am trying to classify some images using local and global features. What I have done so far: I have extracted sift descriptors for each image and I am using this as my ...
6
votes
2answers
5k views

For which real world data sets does DBSCAN surpass K-means.?

For clustering, DBSCAN surpass k-means in terms of handling arbitrary shape data sets. In the most published papers about density based clustering, the experiments are performed with synthetic data ...
6
votes
2answers
4k views

Image clustering by similarity measurement (CW-SSIM)

I'm trying to use scikit-learn and pyssim for clustering a set of images - less than 100. The end goal is to place the images into several buckets (clusters) according to the calculated similarity ...
6
votes
1answer
1k views

Binning long-tailed / pareto data before clustering

I want to cluster a set of long-tailed / pareto-like data into several bins (actually the bin number is not determined yet). Which algorithm or model would anyone recommend?
6
votes
2answers
115 views

How to compare different similarity measurements in text clustering?

I have a dataset which contains vectors generated from subtitles (each column represents a genre, each row is a movie name), my purpose is to find the most similar movie titles, I want to use ...
6
votes
1answer
2k views

Improve k-means accuracy

Our weapons: I am experimenting with k-means and Hadoop, where I am chained to these options for various reasons (e.g. Help me win this war!). The battlefield: I have articles, which belong to c ...
5
votes
2answers
3k views

Distributed k-means in Spark

I want to implement K-means algorithm in Spark. I am looking for a starting point and I found Berkeley's naive implementation. However, is that distributed? I mean I see no mapreduce operations. Or ...
5
votes
1answer
15k views

K-Means vs hierarchical clustering [closed]

What use cases does it make more sense to use hierarchical clustering as opposed to K-Means and vice versa?
5
votes
4answers
17k views

k-means in R, usage of nstart parameter?

I try to use k-means clusters (using SQLserver + R), and it seems that my model is not stable : each time I run the k-means algorithm, it finds different clusters. But if I set nstart (in R k-means ...
5
votes
2answers
2k views

What is the meaning of spherical dataset?

In the following article, one of the statement is as follows: The K-means algorithm is effective only for spherical datasets What does spherical dataset mean?
5
votes
1answer
4k views

Predictive analysis of rare events

I'm trying to predict rare events, meaning less than 1% of positive cases. I basically try to predict if a subject will have 0, 1, 2 ... , 6, > 6 failures (there are cases in all those categories). I'...
5
votes
1answer
3k views

Determinate K in K-Means Clustering

I have salary data of several user (Python list). Now I am using KMeans to cluster them. Given this data, Is there a way to figure out the best value for 'K' automatically through program? I tried ...
5
votes
4answers
530 views

Couple PCA plot and clusters to labels

I am trying my first 'project' concerning machine learning and I am a bit stuck. However, I am not sure if it's even possible but here goes my question. What I want to achieve is clustering user ...
5
votes
1answer
2k views

How to make k-means distributed?

After setting up a 2-noded Hadoop cluster, understanding Hadoop and Python and based on this naive implementation, I ended up with this code: ...
5
votes
1answer
63 views

How do I interpret my result of clustering?

I am working on a clustering problem. I have 11 features. My complete data frame has 70-80% zeros. The data had outliers that I capped at 0.5 and 0.95 percentile. However, I tried k-means (python) on ...
5
votes
1answer
332 views

Clustering efficiency in a discrete time-series

Is it possible to identify the point in time where the cluster separation is at its most in a discrete time series clustering? Say I have 4 clusters of discrete time series and I want to pick a ...
5
votes
4answers
407 views

Categorical Clustering of Users Reading Habits

I have a data set with a set of users and a history of documents they have read, all the documents have metadata attributes (think topic, country, author) associated with them. I want to cluster the ...
5
votes
0answers
42 views

What are practical differences between kernel k-means and spectral clustering?

I've been lately wondering about kernel k-means and spectral clustering algorithms and their differences. I know that spectral clustering is a more broad term and different settings can affect the ...
4
votes
1answer
15k views

Clustering for multiple variable

There are total 50 students(john, Roy..) and used some action to do a job. My dataSet something like this ...
4
votes
3answers
2k views

Boundary conditions for clustering

I have some data that I would like to cluster with k-means. One of the features is the hour of the day. The problem is that the hour '23' is considered far from the hour '0'. How can I map the ...
4
votes
1answer
6k views

How to measure the similarity between two images?

I have two group images for cat and dog. And each group contain 2000 images for cat and dog respectively. My goal is try to cluster the images by using k-means. Assume image1 is ...
4
votes
1answer
5k views

Sklearn: unsupervised knn vs k-means

Sklearn has an unsupervised version of knn and also it provides an implementation of k-means. If I am right, kmeans is done exactly by identifying "neighbors" (at ...
4
votes
2answers
4k views

Plots with shaded standard deviation

What tools can I use to make a visualization similar to this one? I want to have the mean be bolded and the standard deviation be shaded.
4
votes
1answer
121 views

Does the choice of normalization change dramatically the result of a KMeans

I'm using a KMeans to get the profile of several users according to several columns (I'm working with RStudio). To analyze my clusters, I decided to realize a radar chart, so I decided to use feature ...
4
votes
3answers
25k views

How to test accuracy of an unsupervised clustering model output?

I am trying to test how well my unsupervised K-Means clustering properly clusters my data. I have an unsupervised K-Means clustering model output (as shown in the first photo below) and then I ...
4
votes
2answers
8k views

How to calculate the silhouette coefficient?

Calculate the silhouette coefficient of point Pi from the above image. To apply the given formula, how to know which is a(i) and b(i)?
4
votes
3answers
3k views

k-means clustering data with large number of meaningless values

I am looking to perform k-means on my dataset which contains a large number of 0 values. Edit: the last value you see is different to the others, that is simply the sum of transactions, not related ...
4
votes
1answer
2k views

How to explain the outcome of k-means clustering?

I am currently conducting some analysis using NTSB aviation accident database. There are cause statements for most of the aviation incidents in this dataset that describe the factors lead to such ...
4
votes
2answers
4k views

Scikit Learn: KMeans Clustering 3D data over a time period (dimentionality reduction?)

I have a dataset of xyz coordinates with a date component in a pandas dataframe ex: date1: $[x_1,y_1,z_1]$, date2: $[x_2,y_2,z_2]$, date3: $[x_3,y_3,z_3]$, .. I would like to classify a sample of ...
4
votes
1answer
603 views

What's the difference between finding the average Euclidean distance and using inertia_ in KMeans in sklearn?

I've found two different approaches online when using the Elbow Method to determine the optimal number of clusters for K-Means. One approach is to use the following code: ...
4
votes
2answers
508 views

k-means|| in PySpark

I'm trying to apply k-means$\|$ clustering in PySpark. According to this paper, there is an oversampling factor, $l$, that would affect the model's cost. I couldn't find any parameter regarding ...
4
votes
2answers
5k views

K-means clustering on the data frame having only one column

unsup_df is a DataFrame which has only one column: review. I want to form 2 clusters of the reviews. One positive and one ...
4
votes
1answer
531 views

Details of the k-means++ algorithm that is used to seed k-means

Regard to K-Means++ algorithm, which is an algorithm for choosing the initial values (or "seeds") for the k-means clustering algorithm. K-Means++ algorithm in Wikipedia The exact algorithm is as ...
4
votes
2answers
2k views

Constrained k-means algorithms in R (must-link constraints)

I currently face an unsupervised learning task that is to be approaches using clustering. More specifically, it is a segementation task and hence there is some prior knowledge about a) the number of ...
3
votes
3answers
66 views

k-means classifies one data point as a group

I have 1000 sets of one dimensional data (360 each in length), and I want k means to classify what is a small/medium/large value (n_clusters=3) for each set of data, but I'm getting a lot of instances ...
3
votes
2answers
15k views

calculate distance between each data point of a cluster to their respective cluster centroids

I have a dataset of some keywords in some text files. Using the append feature I have access each text file and I append all of the keywords to token_dict like this ...
3
votes
3answers
2k views

What approach other than Tf-Idf could I use for text-clustering using K-Means?

I am working on a text-clustering problem. My goal is to create clusters with similar context, similar talk. I have around 40 million posts from social media. To start with I have written clustering ...
3
votes
1answer
272 views

Why K-harmonic means is less sensitive to random initialization than K-means?

As we know that K-Means is a powerful clustering, however it often stuck with local minimum problem because of bad initialization . One of the solution is K-Harmonic means that use Harmonic Average as ...

1
2 3 4 5
7