Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

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

0
votes
0answers
13 views

Why I have fewer clusters than I have assigned using semi-supervised k-means?

I am working on class discovery related work in leukaemia and I have some RNA-Seq data. With them, I am using kcca in flexclust ...
0
votes
0answers
8 views

What are the advantages of Louvain method versus K-means for clustering sparse data?

I would like to better understand the strengths of the Louvain method versus K-means for high-dimensional sparse data (e.g. zero-inflated negative binomial gene expression counts or natural language ...
0
votes
0answers
6 views

How to inform the space and time complexity of K-means, SOM and Hierachical clustering

In the paper I am writing, one of the reviewers asked for an "a simple computational complexity analysis or time computational demands of their method" My question is : Can I simply report the ...
0
votes
1answer
15 views

How can i know that my dataset is being well distributed with K-means?

I'm trying to make an anomaly detection system using Spark Mlib an its K-means implementation but i'm struggling to decide when should i stop searching for K. I'm following Chapter 5 of the Advanced ...
0
votes
0answers
6 views

How to asses discoverability of a K-means based classification?

We are assessing a patent for "discoverability" (when a competitor copies the idea in the same domain with a similar approach we can say that is so just reviewing the customer facing feature). The ...
0
votes
2answers
47 views

Identifying k_means clusters number programmaticaly

I am stuck on finding a way to determine the elbow point (the optimal number of clusters to be used) programmaticaly. I need to run k-means on a set of 2D points obtained from an image and group ...
0
votes
1answer
23 views

Can I perform KMeans on a bimodal data?

I am preparing a dataset for KMean clusters. But a series of data appears to be bimodal: My question is: Can I perform KMeans on a bimodal data? If not, what kind ...
0
votes
1answer
18 views

Normalizing variables before clustering

I am looking to apply k-means clustering on two features of remote sensing data. The first layer is the Normalized Difference Vegetation Index (NDVI), which is expressed on a scale between 0-1. The ...
0
votes
0answers
24 views

Why can't K-means be used on LDA output

I started working on a topic definition task and my initial approach was as follows: Use LDA (Latent Dirichlet Allocation) to obtain the initial topic distribution for each of my documents. Then use ...
0
votes
0answers
8 views

Which is the best strategy for clustering a glossary of terms by exploiting their definitions

I have a glossary (dictionary) of terms together with short definitions (1 to 20 words). I want to cluster these terms by their application domains by using their definitions; for example, clustering ...
0
votes
0answers
12 views

Effect of dimensionality for time taken to cluster data with k-means

In a dataset if I have $N$ features and for k-means clustering it might take $T$ seconds. If the dimensionality increased to $2N$, how would the time taken to run k-means clustering increase?
0
votes
1answer
24 views

Which clustering algorithm is most suitable for grouping by set overlap?

I'm trying to cluster sets by their similarity in terms of included elements. The group of possible elements is of size ~1 million. It is my understanding that in order to run k-means or a similar ...
-1
votes
2answers
33 views

how to classify input image using clustering algorithm such as k-mean?

I want to classify cifar10 images using a clustering algorithm (k-mean). Each image in the cifar10 dataset has a label, so, the results must be a set of labels which are corresponding to the test ...
0
votes
1answer
59 views

Questions about a k-means variant : recompute centroids after each point is reasigned

I have a variant of k-means, where the points are reassigned incrementally and I have a few questions about it. Each time we reassign a point (we move the point from cluster $C_1 $to $C_2$), we ...
1
vote
1answer
34 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}) - (...
0
votes
1answer
84 views

K means clustering time fluctuates with increased value of K

I have written k means clustering code in c#. I am clustering random 99 text articles of Sports Area which I downloaded from Github for different values of K i.e.3,4,5,6,7. I want to analyze the time ...
0
votes
0answers
8 views

Is it appropriate to predict a trained KMeans model on holdout data that would not be included in the training set?

I have a KMeans model that is trained on features that are percentage-transformed descriptions of events. Each observation contains between 1 and 180 events. To help with meaningful comparisons, I ...
0
votes
0answers
13 views

Best method to obtain representative sample for clusters in high-dimensional space

I am clustering a large amount of high-dimensional data using KMeans (and the Euclidean distance metric), and then calculating the silhouette score and the Euclidean distance to the calculated cluster ...
-1
votes
0answers
8 views

Proving the convergence of k-means algorithm using fixed point theorem

I'm learning machine learning and functional analysis this semester. When I learn the k-means algorithm , it came to me that the stopping criterion is very similar to the fixed point theorem thought. ...
0
votes
1answer
30 views

Best Clusterizing Techninque for 7 points Likert scale

What is the best clustering method seven points Likert Scale. When what I am looking to answer is if there are groups of people behavior on it. For example. I have around 30 questions with this scale....
1
vote
1answer
44 views

What does it mean to apply k-means algorithm on transformed distance matrix?

I am reading a very good (recent) publication in clustering: Kiselev et al., 2017, SC3 - consensus clustering of single-cell RNA-Seq data (if you don't have access, see author PDF). The algorithm ...
0
votes
2answers
21 views

Unsupervised Classification of Linear Trends

I have a data set which results in a series of non-parallel linear trends on a scatter plot. I'm trying to find a way to classify each data point into its closest corresponding linear trend. There ...
1
vote
1answer
125 views

How to I determine the maximum number of iterations in K-means clustering?

In the documentation of kmeans, the default value of iter.max is 10: kmeans(data, modes, iter.max = 10, weighted = FALSE, fast = TRUE) I don't understand why. And I also wonder how to determine the ...
0
votes
1answer
53 views

K-Means Variable Selection

I have a simple data set, 1200 Rows and 20 variables, 1 is a categorical variable with 8 unique values. 1 variable is a unique reference number. I'm looking into using Kmeans clustering to find the ...
0
votes
1answer
50 views

Clustering for medium data [closed]

Which clustering method is good in R for a data with ~32,000 subjectsa and 10 variables, hierarchical or k-means?
0
votes
0answers
11 views

kmeans ++ alternative deterministic

k-means++ Consider the following variant of the k-means++ algorithm, which we call k-means􀀀􀀀. Select the k centroids as follows. The rst point is chosen uniformly at random from the input points. ...
1
vote
1answer
130 views

Best BIC value for K-means clusters

I am using code from Using BIC to estimate the number of k in KMEANS (answer by Prabhath Nanisetty) to find BIC values for K-means using different number of components. However, using iris dataset, I ...
0
votes
1answer
59 views

Silhouette score behaving counter intuitively

My Silhouette score decreases as number of clusters increase. I'm using scikit's kmeans algorithm on the modified white wine dataset from UCI. Here's the final dataset I'm using - https://drive.google....
2
votes
1answer
63 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 ...
0
votes
1answer
21 views

Kmeans results, is the cluster vector ordered by 'closeness"?

I ran kmeans in r with k = 20 centers and 7 scaled variables to cluster with on a data frame with n = 100K. Using dplyr group_by I was able to view summary data for each of the 20 clusters: the mean ...
-1
votes
1answer
41 views

How k-means computes cluster centroids differently for each distance metric?

K-means computes cluster centroids differently for each distance metric. I don't know why the way of computing the centroid is dependent of the distance measure. I don't know how we compute the ...
0
votes
1answer
11 views

How to interpret contrasting information from the Variation of Information, Dunn and Rand Index for comparing clusterings

There are related questions but the answers don't seem to explain how to practically judge these measurements for non stats users. I have a dataset which I clustered with K=4 using hierarchical ...
1
vote
2answers
82 views

In cluster analysis should I scale (standardize) my data if variables are in the same units?

I am performing cluster analysis (k-means and hierarchical) based on multiple variables. Each variable is in percentage 0-100% and the sum of all variables is at most 100%. I see that in many of the ...
1
vote
2answers
194 views

Comparing K-Means and Expectation Maximization on the dataset generated - When does K-Means perform better?

I was experimenting with K-Means and Gaussian Mixture Models (Expectation-Maximization) on the data set that I generated. Here is how the plot for two distributions looks like: Since this was ...
1
vote
2answers
30 views

Weakened version of k-means

I'd like to know if this "weakened" version of k-means exists. Pick a value $\delta > 0 $ small enough. Imagine you have computed all the distances between all the points in the dataset and the ...
1
vote
0answers
190 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
2answers
64 views

How to optimize the result of K means

I am analyzing the data of abalone. My goal is to classify the data into three categories(premium, medium premium, and classic). Since it's an unlabeled dataset, so I utilized K means clustering to do ...
1
vote
2answers
111 views

Convert categorical variable to numeric values or dummies for k-means clustering? [closed]

I am using K-Means clustering algorithm on a dataset. One variale has 6 categories and I want to know how to deal with this. I am thinking of two approaches: Converting the values to 1,2,3,4,5,6 ...
0
votes
2answers
26 views

How to cluster temporal pattern of users with k means

I have data relating to the movement of travelers through a toll road based on a smart card. I have the ID of the individual and a datetime stamp for each time they pass through the toll (in either ...
2
votes
1answer
35 views

Appropriate clustering algorithm with mixed data types

I have a customer data set with several features. These features have mostly different meanings e.g. (Currency / Money) Customer monthly spend in $ (Count) Quantity of service x customer has active ...
1
vote
0answers
50 views

Interpretation scatter and cluster plots [closed]

I used the frequencies of different learning strategies that students mentioned in a 2x2 factorial within design (across 4 different situations) to draw up several plots in R. What I tried to find out ...
1
vote
0answers
97 views

silhouette function in R gives error `NA/NaN/Inf in foreign function call (arg 1)` [closed]

I am trying to produce silhouette scores of a kmeans clustering with correlation distance in R. I did a k-means clustering using the Kmeans function from the ...
0
votes
1answer
167 views

K-Means: Between SS vs. Cost Function

For a class project I am clustering stock time-series via K-Means. For this initial project, we are choosing a fixed number of clusters, 10, and will not be optimizing the number of clusters. I ran K-...
0
votes
2answers
43 views

How to learn new clusters on residuals of KMeans

I have 800k long-lat locations that I've clustered into 40k locations. I reverse-geocoded these using a free API. As I get a new "budget" (40k) next month, I'll be able to process another 40k ...
0
votes
0answers
40 views

Accounting for repeat observations in k-means clustering

I am applying k-means clustering (i.e. kmeans function from the stats r package) to a distance matrix generated using ...
0
votes
0answers
39 views

Cluster or Scoring Model

My Goal: Out of X number of people with credit card debt, predict the ones that are most likely to set up Payments. When someone sets up payments, a date is recorded. We want to reach out to people ...
-1
votes
1answer
23 views

Device grouping using k-means to create clusters with overlapping neiborhoods

I want to use k-means to group (cluster) my devices into overlapping regions. For example I randomly generate the locations of my node devices on an $XY$ plane such as $n_1$ at location $(x_1,y_1)$, $...
0
votes
0answers
39 views

MCA and K-Means simultaneously

I was reading the article Multiple Correspondence K-means: Simultaneous versus sequential approach for dimension reduction https://link.springer.com/chapter/10.1007/978-3-319-55477-8_8 I have this ...
0
votes
0answers
48 views

K-means clustering for longitudinal data with fixed effects or other non-time dependant covariates

I am looking to run a k-means clustering analysis over some time series data and am currently using the kml3d package with three different variables that have been repeatedly measured over 3 weeks. ...
1
vote
0answers
13 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-...