# 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.

408 questions
Filter by
Sorted by
Tagged with
5 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 ...
24 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 ...
19 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 ...
15 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 ...
11 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 ...
12 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 (...
167 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 ...
53 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 ...
30 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 ...
22 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 ...
27 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 ...
12 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 ...
25 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=...
9 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 ...
33 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 ...
22 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 ...
18 views

### Choosing your own initialisation points for kmeans

Kmeans clustering will randomly select the initialisation points and then run the algorithm until convergence is reached. Is there a way I can choose my own initialisation points and pass them into ...
30 views

### K-means++ with cosine distance

I am wondering how to implement k-means++ with cosine distance, acording to quote below (wikipedia), which says, that distance needs to be squared. But with square is lost direction of distance which ...
14 views

### Clustering: How to find which point in a cluster in the closest to the cluster centroid while using kprototype

I have a dataset which contains both numeric and categorical data. In order to carry out clustering in python I have applied kprototype which is the mixed form of kmeans to be used in such cases. I ...
10 views

### Definition of local minimum in k-means algorithm

I know what a local minimum for a function $f:\mathbb{R}^n→\mathbb{R}$ is. The error function in a k-means algorithm gets a vector of assignments and a vector of centers. How does the term local ...
16 views

### Problems with low silhouette coefficients in unsupervised learning

I created two clustering using k-means clustering. However, two silhouette coefficients are judged to be low. The average silhouette coefficient was about 0.2, the silhouette coefficient for Group A ...
20 views

### 2 Most probable labels with Gaussian Mixture Model Clustering

I want to get the two most probable labels for each sample in my X. A little context: I am working on a clustering project where I have 1.6M samples that have to be clustered into 12 clusters. First, ...
26 views

### Visualise KMeans clusters in 2d, when number of input features is greater than 2

I am using KMeans clustering in Python (Scikit-learn) with around 70 input features per sample and a little over 1,000 samples. It is performing rather well, which is good. However, I would quite like ...
24 views

### How do you describe the clusters created by k-means?

I understand how the clustering algorithm k-means works and I can map any new point to any of the lusters using the predict function. What I want to understand is: how can I describe the clusters? For ...
75 views

### How to do clustering assuring more than one class per cluster?

I have a dataset with 4 classes and i'm trying to use an ensemble model where each base classifier trains with a portion of data. To distribute data along the classifiers, i am using KMeans algorithm. ...
17 views

### What type of clustering algorithm to use to determine what accounts belong to a family?

I have both categorical (Name, address, etc.) and numerical data (similarity scores between two parameters) and I can't figure out what kind of clustering ML algorithm would be appropriate since most ...
141 views

### K-means clustering with categorical data

I am doing a clustering analysis using K-means and I have around 6 categorical variables that I want to consider in the model. When I transform these variables as dummy variables (binary values 1 - 0) ...
32 views

### In clustering, sequence number such as customer ID and dates such as purchase date should be dropped?

I am learning K-means clustering and found that in most datasets, there are sequence number such as customer ID and dates such as purchase date. I don't see any use in them for clustering. Should I ...
22 views

### what is the best distance measure to use for clustering high dimensional binary data?

I have a dataset where the input is a dataset for ICU patients where each ICU stay has 40 features (20 vitals, 20 numerical lab values) and multiple time steps (the stays' length is between 6 and 19-...
26 views

### Implementing k-means algorithm for cluster analysis on multivariate and multidimensional data

I have a set of 1000 models. Each model is a (72 x 4) matrix, where 72 are the values associated to each of the 4 variables. The goal is to perform cluster analysis on these models, i.e. to group them ...
12 views

### Two datasets and two separate objectives: Is it okay to combine datasets to train for different classifications?

Some background: I'm currently working on a research project where we have a given training set of ~6k records of economic published papers from a different research group and a separately data-...
68 views

### Should I scale or normalise my dataset before clustering? [closed]

So i have a dataset with variables with unit of measurement as milligrams, kgs and quintals. Should i use standard scaler or minmaxscaler to scale the dataset.
15 views

### Low Silhoutte Score on Scaled Data

I have built one segmentation model using KMeans ,I am getting average Silhoutte score of 0.4 in scaled data . But when I do the clustering on Unscaled data Silhoutte scoring improved to 0.80. Why I ...
22 views

### How can I apply K means algorithm to detect a pattern? [closed]

I have a dataset: How can I apply kmeans algorithm to find clusters based on "date" column . So that I can retrieve tweeting/retweeting activity every hour and generate a pattern. It would ...
6 views

### Tier Splitting for Time Series Analysis K means

I am currently trying to expand upon some results from the paper "Time Warping Clustering for the Forecast and Analysis of COVID-19" by Qixuan Jin out of Cal Tech, because when it was ...
23 views

### Human readable format for clusters of word vectors

Let's say I have pretrained word2vec model and apply it to dataset consisting of article titles from "The Guardian". It seems pretty obvious that titles coming from "Science" ...
24 views

### Clustering method for 2-D data that self-detects number of clusters and takes care of outliers

Assuming I have data that looks something like that: I'm looking for a method or algorithm that can perform the clustering (e.g. as shown in the picture), that automatically determines the optimal ...
8 views

### Why do the arrange of clusters change when change the unit

I did k-means clustering with 2d data. The x axis represent depth (km). And result was :. But when I converted km to metr, I got it Could you give explanation why do this happens?
15 views

### Ant colony optimization for clustering [closed]

What do you mean by applying ant colony optimization (ACO) to clustering? What is the output one would get after it? Could you explain it using a two dimesional data set which is clustered into 3 ...
91 views

### ARI (Adjusted Rand Index) result meaning

I am using K-Means for a binary classification problem in labelled data. I think that K-Means used opposite labels to mine for the output variable. I calculated the ARI to better understand if the ...
20 views

### How to add 'other' as one group to clustering algorithm inference pipeline

I have few clustering algorithms tuned having 5 cluster. I want 6th cluster if new data does not belong initial 5 cluster fall in 6th cluster. 6th cluster [ say other category] consist of all data ...
17 views

### I know which forums specific user read - how to cluster the data?

I have a dataset as follows. For each user, I have a separate row with the forum he reads. There is up to 100 different forums. I would like to cluster this data, so each user will be assigned to one ...
28 views

### Understanding clusters after applying PCA then K-means

I have a dataset grouped by customer level, and the rows are sum_mexico, sum_uk, ... etc to indicate if the customer has spent money at stores in those countries..similarily counts for these as well. ...
316 views

### Perform clustering from a similarity matrix

I have a list of songs for each of which I have extracted a feature vector. I calculated a similarity score between each vector and stored this in a similarity matrix. I would like to cluster the ...
70 views

### Original k-Means Research Paper

I'm having difficulty searching for the original published paper proposing k-Means as an algorithm. I have been inspired to find it as reference for similar work, inspired by this TowardsDataScience ...
16 views

### Explaining the similarities between instances in a cluster with KMeans

If I create clusters using the KMeans clustering algorithm in Python, is there any way I can find which attributes were used to group those instances in clusters? Example: I have a dataset of cars ...
13 views

### K-means related question

I am a new user to Matlab kmeans and have the following question: I would like to use the following call from a Python application which is listed in this URL. ...
42 views

### Create clusters based on specific keywords

I am working on raw text data. I am using clustering to put together common words in the documents. My requirement is to create clusters based on a specific list of words i.e I want to get a group of ...