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

Filter by
Sorted by
Tagged with
0
votes
1answer
19 views

Weighting k-means with two attributes

I am aiming to use K-means to cluster lat-lon points, but I want to apply a weight to each point's distance based on two attributes of the point. Attribute 1 is population and attribute 2 is percent ...
1
vote
1answer
23 views

Confusion matrix for k-means algorithm

Using R, I ran the K-means algorithm on a dataset with 1m+ rows. Using elbow plot, the optimum no. of clusters was found to be 3. Now each data point is assigned a cluster from the set {1,2,3}. But I'...
1
vote
0answers
10 views

how to divide a group of time series into two so that each group has the same mean?

I have many time series, each shows the profit made from a different product on weekly basis over the last one year. I want to distribute these time-series into two groups such that the sum of the ...
1
vote
1answer
18 views

Does this shape one cluster? and why angles change every time i run the code?

I have data and tried to do clustering on it. every time I run the code with the below statements it changes the angle of the shape but still the same below shape ...
1
vote
0answers
19 views

K-means on a one-dimensional dataset [closed]

Given the data set $𝑋=\{−6,5,0,4,7\}$ and the cluster initialization $𝑉=\{ 5,6\}$ How would the cluster centers (i.e. means) look like after applying naive k-means(computing min. distance $|\cdot |$ ...
1
vote
1answer
17 views

Interpretation of Cluster Distortion on Normalized data

I have a clustering problem which I solved using KMeans clustering. I also know that the Elbow Method for cluster evaluation can be used to approximate a feasible pick for the number of clusters. I ...
1
vote
1answer
48 views

How do I analyze clustering post-PCA

I had in mind to cluster stocks based on some risk indicators such as VaR, sharpe ratio or variance. In a first instance I was thinking to cluster those data points and analyze the results, because ...
0
votes
0answers
6 views

Cluster analysis with dissimilar length sequences with text data

I am wondering how to do cluster analysis with dissimilar length sequences. When I do clustering (like k-means or k-mediods) it is clustering based on length. So it is not findings any groups or ...
0
votes
0answers
6 views

Can sombody interpret the explanation about Gap Statistic for Clustering?

The following content comes from the following site: [https://www.datanovia.com/en/lessons/determining-the-optimal-number-of-clusters-3-must-know-methods/][1] The algorithm works as follow: Cluster ...
0
votes
0answers
11 views

Can I use Customer ID or count(customer ID) in K means clustering? Also, how to find the data points that doesn't fit the clusters well(outliers)?

I am trying to cluster a large dataset with 150k observations. There are 4 variables: Customer ID, Type(credit/Debit), Amount and Country(4 levels). Usually, we don't use customer ID as it doesn't ...
0
votes
1answer
32 views

How to understand which is the optimal k number?

I have this plot but I would like to understand which is the optimal k number only by watching this. I already did the silhouette method and gap statistics, the first shows me optimal number equal to ...
0
votes
0answers
20 views

Hidden Markov Model library to study animal movement (preferably in R)

I want to describe the behaviour of whales using data of their vertical movement. Besides the time-depth profile of tagged whales, I calculated several variables for each dive performed (e.g. maximum ...
0
votes
0answers
17 views

Silhouette Coefficient acceptable value

Does anybody know about the acceptable values for Silhouette Coefficient (or maybe Calinski-Harabasz and Davies-Bouldin index) in K-means clustering?. I know that Silhouette Coefficients close to 1 ...
2
votes
0answers
22 views

Clustering text embeddings: TF-IDF + BERT Sentence Embeddings

I am trying to cluster a few thousand forum posts that are similar in content to Stackoverfow. So far, I have tried two main approaches to represent the posts: TF-IDF Sentence embedding based on BERT....
0
votes
0answers
9 views

While using Ward's method, should we always find optimal no. of clusters using Ward's method, then cluster by K means?

I have plant biomass and grain weight data for different plant varieties which I now need to cluster. I have performed Hierarchical clustering using Ward's method and squared Euclidean distance, ...
0
votes
0answers
10 views

Classification on aggregate data

I've been tasked with creating a model that can classify individual cases as either something to be flagged or not. However, the training data I have access to is only aggregate data, where each row ...
0
votes
0answers
17 views

Should one-dimensional data be normalized for K-Means clustering?

Data normalization is important prior to K-Means clustering when there are multiple variables in the clustered data set. Data centering and scaling (for instance using Z-score) can change the relative ...
0
votes
0answers
17 views

Add k-means layer to Keras model

I'm using a GAN to generate pixel-art images. The structure follow the Tensorflow tutorial on how to do GAN closely. My network outputs gradient-rich images, which look like down-scaled photos rather ...
0
votes
1answer
39 views

Find all possible clusterizations

I need help to find all possible clusterizations via the k-means method in Python. Let's assume for simplicity that I have the following table: height | weight | country of origin (X/Y/Z) | flag (1/0) ...
1
vote
1answer
21 views

How to avoid k-means to merge two groups of points into one cluster?

I've implemented a k-means clustering algorithm, but in some cases (~12%) a situation like that happened: In these cases, my algorithm is creating one cluster for both the yellow and blue group of ...
3
votes
1answer
47 views

Acceptable SSE (sum of squared errors) for K-means

I am developing a k-means clustering algorithm, and I have obtained the ideal number of clusters based on the elbow method. However, despite the fact that the error diminishes a lot with the number of ...
0
votes
0answers
19 views

Performing Discriminant Analysis after K-means clustering on the same data

Let's say I perform a k-means clustering analysis on my data and I find three distinct groups. Afterwards I perform a Discriminant analysis on the same data with the clustering from k-means as the ...
0
votes
1answer
14 views

How to design an algorithm for k means-like problem?

I have some observation about a random variable x and I want to estimate the parameters of its probability distribution function. For example: data = {1, 2, 3, 4, 5} and choose normal distribution as ...
1
vote
0answers
26 views

The silhouette coefficient does not increase monotonically

Recently, I have done some clustering with K-means and I use the Silhouette coefficient to estimate the right number of clusters (K). However, my Silhouette coefficient does not increase monotonously ...
0
votes
0answers
20 views

How to initialize k-means

I am working on image processing. I have to apply k-means upon them. But I am confused with the initialization of k-means that either I should use just first frame or all the frames to initialize it. ...
0
votes
1answer
29 views

KNN and K-means, very different but possible equivalency?

Why does the k-nearest neighbor algorithm and k-means clustering algorithm with $k=1$ act the same?
0
votes
0answers
10 views

Choice of clustering method following PCA?

It is common to perform PCA prior to clustering in order to reduce noise. Is there a consensus of which clustering method is more suitable following PCA? I tried hierarchical clustering and somehow ...
0
votes
0answers
13 views

K-means++ for weighted clustering

I have implemented k-means for weighted points; that is, the final clusters take into account the fact that each input point is weighted. I wanted to initialize the clusters using k-means++, and I was ...
0
votes
0answers
26 views

K-means and data set

I'm looking for data sets which might allow me to show differences between K-means, K-means++ and K-means|| (scalable K-means Bahmani et al. ’12) which I've implemented. I need different datas set (...
1
vote
0answers
15 views

Clustering - Distance Metric for Comparing Short Lists of Terms (non-repeating, no frequency)

Clustering involves using some distance or similarity metric. What is the best way to score the similarity of these small sets of words? Criteria: These are technical terms which are extracted from ...
0
votes
0answers
17 views

R: K Means Clustering vs Community Detection Algorithms (Weighted Correlation Network) Have I overcomplicated this question

I have data that looks like this: https://imgur.com/a/1hOsFpF The first dataset is a standard format dataset which contains a list of people and their financial properties. The second dataset contains ...
0
votes
0answers
14 views

K-Means transform function does not match pairwise_distances_argmin_min centar calculation

I need to be able to select first N most representative points from each cluster calculated by K-means. To do so, I am aiming to calulate the distance of each point to its own cluster center and take ...
0
votes
0answers
27 views

Is variable contribution to the top principal components a valid method to asses variable importance in a k-means clustering? [duplicate]

If the answer is no, could someone give a simple counterexample? Thank you!
0
votes
0answers
8 views

What is the advantage of cluster definition in partition-based and density-based clustering methods?

Partition-based methods consider that a cluster is homogeneous (points are similar according to error sum of squares) and has a centroid. Density-based methods consider a cluster to be a dense region. ...
3
votes
1answer
45 views

Clustering with large number of clusters

I would like to cluster tens of millions of vectors (hidden states of BERT) into something like 20k clusters. Is there a clustering method that can do this in a reasonable time? Standard K-means ...
0
votes
1answer
28 views

What does this array created by KMeans represent?

KMeans is a common clustering algorithm. However, I am not clear about the steps involved. I am using commonly used iris dataset, which has 4 numeric features and 1 Species column. ...
2
votes
1answer
192 views

KMeans clustering - can inertia increase with number of clusters

I am doing kmeans clusters on sales data and i see that inertia increases for the initial increase in the number of clusters. Can you please explain why that happens? I am doing Batched Kmeans for the ...
0
votes
0answers
19 views

Trying to Unskew data with log transformation, unable to get a somewhat normal distribution

Wannabe Data scientist here trying to do some k-means clustering, please go easy on me if there is a really obvious answer :). I'm currently at the step where I'm trying to unskew my data using log ...
1
vote
1answer
44 views

Confused between K-Means and Hierarchical Clustering for 9 different categories

I am trying to classify 9 different species of elephants into clusters using unsupervised learning. I have the following data about them: Their height Eye Colour Sound they produce in decibel (dB) I ...
1
vote
1answer
21 views

K-Means Clustering for telecom customers behavioral usage

I am trying to run K-means clustering on a dataset of 100k records and 26 columns. My problem is in the visualization or plotting clusters part. Since I have several features, I couldn't specify the x ...
1
vote
1answer
35 views

How to identify distinct classes for classification problems?

I'm working with a dataset in which we've taken audio recordings of coral reef habitat from 3 different types: healthy, degraded and restored. From each recordings I have 13 different continous ...
1
vote
1answer
142 views

Can we always get an optimal $k$-means cluster arrangement?

I am currently studying $k$-means clustering. An optimal $k$-cluster arrangement is defined as follows: Fix a distance $\Delta$ and $k < n$. Assume $\mathbb{X}$ have been partitioned into $k$ ...
0
votes
0answers
21 views

Best Way to Get Flattened Sentence Embeddings using Individual Word Embeddings - Glove/Embedding Layer Keras

Okay so basically I have a dense matrix of sentence embeddings within which each word in the sentence is embedded to a dimension of (1 x 100). Sentence embeddings with word embeddings of shape (1 x 2) ...
0
votes
0answers
23 views

Fixing K-means that produces column clusters [duplicate]

Red crosses represents the center of the cluster and the black points represent the data points. I have this hypothetical scenario where the K-means seems like is producing a bad clustering. Why would ...
1
vote
1answer
40 views

K means clustering breakup---galaxy spectrum data set

I have a spectrum data set (total 22000). Similar to an electronic wave data, two dimensional (Flux vs Wavelength). A typical set of wavelength plot looks like below Now I am doing kmeans on this ...
1
vote
2answers
28 views

Is it possible to have same result for knn classifier and kmeans?

Could we achieve similar grouping or results for a set of data, if applied with either Knn and k-means
1
vote
0answers
38 views

How to compare consistency between clustering results and list of values with different levels in R?

I found similar subjects on the website but I may have missed the relation with my own question. I'v seen questions about comparison of clustering results, but here it's more about comparing two lists ...
11
votes
4answers
2k views

In cluster analysis, how does Gaussian mixture model differ from K Means when we know the clusters are spherical?

I understand how main difference between K-mean and Gaussian mixture model (GMM) is that K-Mean only detects spherical clusters and GMM can adjust its self to elliptic shape cluster. However, how do ...
0
votes
0answers
27 views

Clustering algorithm for a coordinate-based matrix

I have $1000$ scenarios, each of which is composed of $5$ users' coordinates $(x_i,y_i), \forall i \in \{1,\dots,5\}$. Now, based on users' coordinates, I want to cluster these $1000$ scenarios into ...
0
votes
0answers
19 views

K Means feature weighting

How does one weight the various variables used in a k-means clustering analysis? By which I mean, how to force the model to be disproportionately influenced by a particular feature over others? One ...

1
2 3 4 5
19