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
0 votes
0 answers
10 views

Does scikit learns implementation of silhouette score support parallelization and will benefit from multiple CPUs?

I wish to use the silhuette score to get the optimum number of clusters. I know kmeans implementation in scikit learn supports parallelization. But I am unsure whether the same is true for silhouette ...
Ali Raheel's user avatar
0 votes
0 answers
9 views

Is there a way to artificially manipulate a dataset in order to replace it for one that gives good predictions?

I'm trying to artificially create a dataset for pure educative reasons but I want it to be based in one particular dataset, the problem is that this original dataset don't make good predictions even ...
CinfaCinfa's user avatar
0 votes
3 answers
138 views

Clusterise a group of answers taking the question as relevant information

I am solving a problem where I group answers to a given question into clusters using k-means algorithm. The steps I follow are: For every answer I get the corresponding vector. Reduce the vector ...
jesantana's user avatar
0 votes
1 answer
23 views

Plot Clustered Data by kmeans with colors for clusters and shapes for external labels

I wrote some Python code that uses the output from a principal component analysis to perform k-means on. The output to my script below is Cluster 1: Data Points: [[ 1.87192346 -1.12568277] [ 1....
Squirtle's user avatar
  • 103
1 vote
1 answer
48 views

Why is accuracy score suddenly becoming 1 on using XGBoost?

I am developing a music classification system based on a kaggle dataset: https://www.kaggle.com/datasets/vatsalmavani/spotify-dataset I tried using K means classifier to classify the songs into 4 ...
Priyanshu's user avatar
0 votes
1 answer
10 views

Method to Compare the Fit of of k-Medoids and GMM to my Dataset

I'm looking for a method(s) to compare the fit of k-Medoids and a GMM. Currently, I'm looking at the distance between the max-min means of the GMM clusters and comparing that to the max-min medoid ...
Andrew Feenan's user avatar
0 votes
0 answers
17 views

PySpark KMeans model has negative training cost

I am fitting a KMeans model for clustering using cosine distance measure. After model fitting, when I check the training cost of the model as below, ...
hypothesisusable's user avatar
0 votes
0 answers
25 views

Equivalence between K-Means objective functions proof

I am working on a project involving the K-Means clustering algorithm, and I am trying to prove the equivalence between different formulations of the objective function. Specifically, I want to show ...
Oren Ben Eliyahu's user avatar
0 votes
0 answers
6 views

Understanding differentiation via chain rule in M-Step K-Means clustering

The following slide is from Erik Bekkers's excellent courselesson 9.2 How is it that we can re-write the following? $||x_n-\mu_k||^2$ as $(X_n-\mu_k)^T(X_n-\mu_K)$ Also I understand how we get the -2 ...
Kirsten's user avatar
  • 57
0 votes
0 answers
14 views

Common properties of a clusture

After doing kmeans clustering how to find out the common properties of each cluster. Shall we go for feature importance of each cluster?
Banalata Das's user avatar
0 votes
0 answers
14 views

Numerical instabilety with kmeans

If i understand the math right a kmeans iteration should always improve cosine similarity. So if the data is z-normalized it should always improve corelation Well it seemed to be the case for a small ...
Nevo Krien's user avatar
1 vote
1 answer
209 views

best algorithms for clustering customers, customer segmentation

I have a dataset mixture of categorical and numerical variable, I was wonder what are the best algorithms to cluster customers? how to find the underlying patterns that segments a customer??
F.Hazratian's user avatar
0 votes
1 answer
40 views

Efficient ways of clustering for big data

I have a task which is customer segmentation with 120k users and a record of their purchases which is +3 million records of data, the approach I want to use is to use clustering algorithms like kmeans ...
F.Hazratian's user avatar
0 votes
0 answers
13 views

K-means and cluster formation

I'm using K-means method on data sets where often times the data points form horizontal formations as per screenshot. When that is the case, I would like to change the model or adjust it so that ...
mattK's user avatar
  • 1
0 votes
1 answer
42 views

Maximum categories for categorical variables in K-Means clustering

I am trying to perform K-means clustering on a dataset, and one of my categorical features has 96 possible options. Would this be too many features for one variable to have? The alternative would be ...
imad97's user avatar
  • 101
1 vote
1 answer
76 views

Determining threshold for KMeans anomaly detection

I'm trying to use KMeans for anomaly detection, and I know that a threshold is needed to determine the anomalies. I've seen many articles talking about how to choose K, but none talks about how to ...
Rayne's user avatar
  • 131
1 vote
0 answers
39 views

Modified kmeans algorithm returns the wrong answer

I am trying to create a kmeans algorithm that is based on the Earth Movers Distance instead of the Euclidean distance. However, when I run it, it just returns the same value for all data points. The ...
Ozzy08's user avatar
  • 11
0 votes
1 answer
36 views

Best way to compare classification output between different locations

I ran a neural network for 20+ different locations across the United States. At each location I have a list of their predictions in an array. This looks something like this... ...
Jack Cahill's user avatar
0 votes
0 answers
14 views

Finding centroids with less difference but high variability

I have a data set including lat , lon and id's for some places. Also I have another table which has features for each id's. I wanted to find cluster centroids for those places. Using lat and lot ...
datatech's user avatar
0 votes
1 answer
74 views

KMeans is not predicting the correct cluster

k-means clustering is done and created 5 optimal number of clusters. (Clustering is done unevenly). While using them in my model, the model is not choosing the exact cluster which has the exact data. ...
sai_0033's user avatar
0 votes
1 answer
40 views

What can be the reasons for 95% of samples belong to one cluster when there is 5 clusters?

'''I used the k-means algorithm to clustering set of documents which are textual data only. The document has 2lack records. Surprisingly the result for the clustering is 90% of records is storing in 1 ...
sai_0033's user avatar
0 votes
1 answer
144 views

how to evaluate the combination of tfidf and kmeans

For my nlp problem I'm using a combination of TFIDF and KMeans from the sklearn package. The tfidf gets the vectors and then I use Kmeans to cluster the texts based on the vectors. I have a few ...
james pow's user avatar
  • 167
0 votes
0 answers
10 views

Understanding model behavior

I am checking the accuracy of a new model (Kmeans with Iterative RF) over SICE (Single Imputation Of Chained Equation) for missing data imputation. For 5-10% SICE is performing well thereafter our ...
Vishnu's user avatar
  • 1
0 votes
0 answers
9 views

Separating assignment from centers update k-means sklearn

Is there a way to execute separately the assignment and the update of centroids using sklearn implementation of k-means? I would like to measure the execution time of these two steps, and I would like ...
holo gram's user avatar
0 votes
0 answers
86 views

Dendrogram, kmeans, centroids, labels

I have to execute the following tasks (excuse me for the easy questions) but I am time pressured: Apply the KMeans with 50 clusters From the barycenters and labels obtained for each cluster, a ...
user141430's user avatar
1 vote
0 answers
79 views

Jenks goodness of variance fit - Interpretation

I am working on clustering/grouping 1D data. I am trying to find bins of multiple variables seperately. So, I tried the jenks natural breaks algorithm. Based on the ...
The Great's user avatar
  • 2,535
0 votes
1 answer
516 views

Perform k-means clustering over multiple columns and get the cluster center values?

I read here how to show the number of clusters over $n$ columns. I would like to know how to get in a table, the values of the clusters centers. Could someone help me with this?
boxertrain's user avatar
2 votes
3 answers
61 views

Differentiate between two set of points

Consider two sets of points (in the pictures below), whose "center of gravity" is same. What measure can differentiate between the two sets? e.g. Image 1 ...
s510's user avatar
  • 121
0 votes
1 answer
567 views

Clustering latitude, longitude along with numeric and categorical data

I am working on clustering the customer base of a business-to-business company. I have data on customers that consists of both numerical (e.g. # of purchases made, avg. spend per purchase) and ...
Ultralite's user avatar
  • 101
0 votes
1 answer
37 views

Do 0-columns affect the results of time series clustering when using k-means and Ward's method?

I would like to cluster multidimensional time series using k-means and Ward's method. My base dataset has 4 columns (features) and each of them is a time series of 288 values. So one "datapoint&...
PeterBe's user avatar
  • 71
1 vote
2 answers
67 views

Automate Clustering predictions and RFM metrics

We did a POC for customer segmentation and followed the below approach a) extract data from source system (SAP business objects) b) Use python jupyter notebook to manipulate, merge and group data (...
The Great's user avatar
  • 2,535
1 vote
1 answer
91 views

Should K-modes or K-means be used?

I have data obtained from a survey and I would like to make a grouping of the individuals who responded to the survey according to the questions they answered. The range of answers is: strongly agree, ...
MSmith's user avatar
  • 11
2 votes
1 answer
97 views

Using k-means to create labels for supervised learning

I want to know if the following is a valid approach to create labels, if I have measurements under some conditions, and the conditions are similar but never exactly the same. This doesn't correspond ...
Seb001's user avatar
  • 23
2 votes
1 answer
29 views

I need help with which features to use for clustering

I am using this dataset: https://www.kaggle.com/datasets/sobhanmoosavi/us-accidents and so far I have successfully cleaned the dataset as well as reduced the size of the features and records. I have ...
Giannhs Meh's user avatar
1 vote
1 answer
34 views

Interpreting cluster variables - raw vs scaled

I already referred these posts here and here. I also posted here but since there is no response, am posting here. Currently, I am working on customer segmentation using their purchase data. So, my ...
The Great's user avatar
  • 2,535
0 votes
1 answer
44 views

How to improve the result? Should I remove the columns?

I am using this dataset, the target column is the last one which is 'DEATH_EVENT', I have separated this last one. I am using KMeans to calculate the number of hits and misses. The result is quite bad,...
Agat0's user avatar
  • 1
1 vote
3 answers
294 views

How To Develop Cluster Models Where the Clusters Occur Along Subsets of Dimensions in Multidimensional Data?

I have been exploring clustering algorithms (K-Means, K-Medoids, Ward Agglomerative, Gaussian Mixture Modeling, BIRCH, DBSCAN, OPTICS, Common Nearest-Neighbour Clustering) with multidimensional data. ...
from keras import michael's user avatar
0 votes
1 answer
38 views

Optimal clusters for K-means not clear - any ideas?

I have a toy dataset of 10,000 strings of people's names, addresses and birthdays. As a quirk of the data collection process it is highly likely there are duplicate people caused by typos and I am ...
Sandy Lee's user avatar
  • 227
2 votes
1 answer
1k views

Kmeans clustering in python - Giving original labels to predicted clusters

I have a dataset with 7 labels in the target variable. X = data.drop('target', axis=1) Y = data['target'] Y.unique() array(['Normal_Weight', 'Overweight_Level_I', '...
Usama2298's user avatar
1 vote
1 answer
43 views

Confusion about the value of within-cluster SSE

I have a dataset of shape (29088, 11). When I apply the Kmeans where K=2 I get the following plot: I am surprised that the value of Sum Squared Error (SSE) for C0 (...
Dave's user avatar
  • 238
1 vote
0 answers
363 views

How to calculate the purity of K-Means clustering

I am trying to work out how to I have a labelled dataset that I want to cluster with scikit-learn k-means. The label's column name is "Classes" I don't want the labels to interfere with the ...
Bryon's user avatar
  • 111
1 vote
0 answers
46 views

Interpretation of the results of the Elbow and K-means

I have the following dataset (after scaling) which contains 5 features: : My objective is to cluster this data using an unsupervised ML model. After using the Elbow method, I get 2 clusters as below: ...
Abdessamad139's user avatar
1 vote
0 answers
543 views

K-Means time series clustering with multiple time series for each data point

I have been trying to cluster my data through K-Means. However, for each datapoint that I have, there is 4 different time series (In, Out for Weekend/Wekeday). I have been looking to do multivariate ...
vernal123's user avatar
1 vote
1 answer
158 views

What are the benefits of using spectral k-means over simple k-means?

I have understood why k-means can get stuck in local minima. Now, I am curious to know how the spectral k-means helps to avoid this local minima problem. According to this paper A tutorial on ...
Amartya's user avatar
  • 133
1 vote
0 answers
39 views

Clustering days based on features

I am trying to perform a inner-clustering of a time-serie constisting of days (i.e, clustering similar days) using a set of features $x_i = [f_1, f_2, ..., f_n], i \in D$ set of days. I can choose ...
King Powa's user avatar
  • 111
0 votes
1 answer
182 views

Clustering a set of matrices with kmeans/other approaches

I am posting here as overflow community told me it was better to ask it here. I was trying to cluster a set of matrices in order to obtain $n$ clusters based on matrix similarity. In practice, my ...
King Powa's user avatar
  • 111
2 votes
0 answers
366 views

why the K-means optimization problem is non-convex?

K-means algorithm uses a residual sum of squares (RSS) where $RSS_{K} = \sum_{d \in s}|{d-c(s)}|^2$, $RSS = \sum_{k= 1}^{K}{RSS_{K}}$ is the convergence criterion. RSS is the objective ...
Amartya's user avatar
  • 133
2 votes
1 answer
70 views

Why and how can K-means get trapped in local minimum?

I have studied K-means. I have understood this algorithm uses a residual sum of squares (RSS) where $RSS_{K} = \sum_{p \in s}|{p-m(s)}|^2$, $RSS = \sum_{k= 1}^{K}{RSS_{K}}$ is the ...
XYZ's user avatar
  • 121
1 vote
3 answers
321 views

How to approach a clustering problem with high cardinality, high number of expected clusters, and high sparsity without dimensionality reduction?

I need to to group n widgets into a unknown number of groups k based on their propensity towards a large number of features. ...
Josh's user avatar
  • 141
0 votes
0 answers
221 views

How do work around Kmeans value error?

I am working on a social network analysis project. My data comes from twitter. Before I run the analysis, I intend to apply clustering- specifically Kmeans to determine how to seperate tweets in ...
Falah Amro's user avatar

1
2 3 4 5
9