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
1 vote
1 answer
13 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, ...
user avatar
  • 11
0 votes
0 answers
8 views

How to get optimal number of clusters considering 1 and N clusters?

I want to create clusters using kmeans for subsets of a dataset and i created a grid search function to get the optimal amount using silhouette score, but it seems that silhouette from sklearn does ...
user avatar
2 votes
1 answer
64 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 ...
user avatar
  • 23
2 votes
1 answer
20 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 ...
user avatar
0 votes
0 answers
10 views

Calculating new centroids when the centroids are chosen at random

When given two random points which are not instances in the dataset should I include the centroids in my calculations for the new centroids? For example in this link they are using the starting ...
user avatar
  • 1
1 vote
1 answer
25 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 ...
user avatar
  • 2,215
0 votes
1 answer
23 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,...
user avatar
  • 1
0 votes
0 answers
12 views

semantic segmentation using kmeans or mean shift

i know what semantic segmentation is and i know how to do semantic segmentation using deep learning but my question here can i do semantic segmentation with a traditional way like kmeans or mean shift ...
user avatar
  • 1
0 votes
0 answers
19 views

K-Means R vs K-Means Python different cluster values generating different bar Graphs

Below are 2 sets of code that do the same thing one in Python the other in R. They both graph the Kmeans the same with respect to PCA but once I do the bar chart at the end using the cluster Center ...
user avatar
1 vote
3 answers
126 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. ...
user avatar
0 votes
1 answer
29 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 ...
user avatar
  • 187
0 votes
1 answer
52 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', '...
user avatar
0 votes
0 answers
11 views

Clustering of time series data

I have a time series data set. I want to use Dynamic time warping for distance measurement. For algorithm, I was thinking of using either K-means DTW Barycenter Averaging (DBA) or K-medoids. Data has ...
user avatar
  • 1
1 vote
1 answer
27 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 (...
user avatar
  • 238
1 vote
0 answers
54 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 ...
user avatar
  • 111
1 vote
0 answers
14 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: ...
user avatar
1 vote
0 answers
150 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 ...
user avatar
1 vote
1 answer
52 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 ...
user avatar
  • 133
1 vote
0 answers
18 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 ...
user avatar
  • 111
0 votes
1 answer
25 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 ...
user avatar
  • 111
2 votes
0 answers
42 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 ...
user avatar
  • 133
2 votes
1 answer
34 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 ...
user avatar
  • 131
1 vote
3 answers
61 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. ...
user avatar
  • 141
0 votes
0 answers
6 views

Encode record with no exemptions in clustering (standardization)

I am trying to apply clustering, k-means, to a custom dataset I have created. There are several features and most have exemptions (min/max dollar amount). There are some records, however, that do not ...
user avatar
0 votes
0 answers
11 views

How to generate a penalty matrix after KMeans clustering

Let say we have 9 observations that can be grouped into 3 groups using K-means clustering: ...
user avatar
  • 101
0 votes
0 answers
28 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 ...
user avatar
0 votes
1 answer
13 views

is using feature selection(supervised) methods after running kmeans and taking the 'cluster' variable(0,1,2 for eg.) as the labeled data correct?

Feature selection in a gist from what i understand is reducing the variables but retaining the labels as much as possible, from that pov this seems correct but i haven't found anything on this. Any ...
user avatar
  • 1
1 vote
1 answer
43 views

Clustering multiple csv files that cannot fit in RAM

I have multiple csv files each of which has at least 200MB of data across 12 columns. Each csv file possibly can fall into 4 categories or labels. I am trying to see which clusters each of these files ...
user avatar
0 votes
3 answers
30 views

choice of variable k in K means algorithm

I have a question on K-means algorithm about the choice of the k value. I read to choose the correct value of k, there are 2 methods: The Elbow Method The Silhouette Method Or the k value, can be ...
user avatar
0 votes
0 answers
15 views

Which clustering model to use when doing market segmentation with survey data

We are looking to run a survey to determine the needs of our customers. For a needs-based segmentation model, can I run a variety of max-diff, multiple-choice, likert scale questions? Also, what type ...
user avatar
  • 1
0 votes
0 answers
73 views

Feature selection with KMeans Clustering

How can I select features for K-Means Clustering based on the silhouette score? I'm looking for something similar to Recursive Feature Elimination in Python, but for unsupervised learning.
user avatar
0 votes
0 answers
54 views

is there a way to compare two k-prototype models performance?

i try to understand which of my two k-prototype models to use both models contains the same categorical features one of the models contains a bit more numerical features in other words is there a ...
user avatar
  • 1
0 votes
0 answers
19 views

Why are the Order Of Initial Centroids effecting Kmeans Clustering?

For Iris Dataset I am doing the experiment. iris_k_mean_model_vor = KMeans(n_clusters=3, init=arr_4d) this is my model. Here I am feeding an Initial array of ...
user avatar
  • 133
0 votes
0 answers
31 views

Dealing with discrete variables as continuous for K-means clustering (or not)

It is well established that k-means works best, and is designed for, continuous variables. I am considering a clustering problem where I have data like this: total spend / $ number of items in basket ...
user avatar
0 votes
1 answer
10 views

How to cluster/group these data points (using K-Mean or Hirarachal clustering)

I have genes from different species Gene A , Gene B, Gene C, ... Gene Z Some Genes are similar to each other ...
user avatar
  • 497
1 vote
1 answer
35 views

Clustering with Highly separable features

I noticed that in my dataset a particular column is highly separable where it splits the data perfectly into 5 distinct classes (re-evaluated where class2 means better than class1). I would like to ...
user avatar
  • 13
1 vote
0 answers
37 views

How to use k_means algorithms on likert dataset?

I have a dataset of 10,000 customers with ten features all of which are Likert type. Like this: customer feature1 feature2 feature3 ID1 3 1 5 ID2 4 5 4 ID3 3 5 1 ID4 1 3 2 ID5 2 5 1 ID6 1 3 4 ...
user avatar
  • 111
1 vote
0 answers
23 views

Is there any library to perform robust clustering given two probability distribution with noise?

Given a dataset $X$ consisted with $w|X|$ samples drawn from a mixture of multivariate Gaussian distributions (say in two dimensions) and $(1-w)|X|$ samples of noise, is there any ...
user avatar
  • 133
0 votes
0 answers
17 views

kMeans on graph Laplacian to cluster nodes based on their distance

I have a connected weighted graph and I want to use kMeans to cluster the points based on their distance (smaller distances indicate that the nodes are more likely to be in the same cluster). I ...
user avatar
0 votes
0 answers
38 views

Constrained clustering technique with an upper limit of weight

I need to cluster some points where each point has a pre-defined weight. I want to apply a constraint that the sum of weights of a cluster should not exceed an upper bound. Is there any technique (...
user avatar
4 votes
1 answer
353 views

How to create a confusion matrix for k-means with two features?

I have the need to do a confusion matrix for data run through k-means with two features. I am aware that this is a clustering algorithm and not a classification algorithm but I have seen some ...
user avatar
0 votes
1 answer
178 views

Find most important and least important features for clustering algorithm

I am experimenting with clustering algorithms, like K-Means. Right now, I use all variables as input for the clustering algorithm. I am wondering if it is appropriate to do feature selection for ...
user avatar
  • 101
1 vote
1 answer
31 views

How do you select the appropriate features and plot the data it so that a k-means algorithm can cluster it?

I am still just dabbling in the shallower waters of machine learning and I am looking to compare the results of a Supervised algorithm (KNN) and Unsupervised algorithm (k-means) when it comes to ...
user avatar
1 vote
1 answer
47 views

Topic modelling on long documents: intra document clustering first

I have a collection (around 1000) of very noisy, similar documents, that are each very long (>10 pages - 600 paragraphs) with multiple subsections - I want to perform topic modelling across the ...
user avatar
0 votes
0 answers
55 views

Silhouette Score for different Clustering algorithms

I am trying to compare different clustering algorithms on a dataset and compare the model performance. Since the dataset is quite big (56 features), I applied PCA to reduce the number of features to ...
user avatar
  • 45
1 vote
0 answers
19 views

How can I calculate the level of agreement between my K-Means cluster labels and my ground truth labels in R?

I have made a K-Means clustering from 3 rasters with various values of k (k=2, k=4, k=7) and would like to know which values of k explains the most variance in my ground-truth data or the value of k ...
user avatar
  • 11
0 votes
0 answers
30 views

Hierarchical and fuzzy C-means clustering

I computed hierarchical clustering and the best classification requires k=8 clusters. I wanted to find the probability of belonging to a cluster for each unit so I used fuzzy C-means clustering with k=...
user avatar
  • 13
0 votes
0 answers
18 views

Aggregating Silhouette values to Silhouette coefficient

Since there is no Silhouette calculation for mixed data types in Python k-prototypes packages that I know of (e.g. this one), I wrote my own code to obtain the Silhouette values. I need to aggregate ...
user avatar
  • 13
0 votes
0 answers
50 views

How to evaluate unsupervised Anomaly Detection using k-means

I'm trying out different anomaly detection models and would love to hear opinion on my idea from somebody experienced. My goal is to perform anomaly detection with different models and to give each ...
user avatar
  • 1
1 vote
1 answer
33 views

One predictor variable and 3 response variable (categorical and continuous) [closed]

If I have predictor variables which are a mixture of continuous and categorical, and a response variable that is continuous. What approach should I apply? Linear regression, logistic regression or k ...
user avatar

1
2 3 4 5
9