All Questions
Tagged with clustering k-means
744 questions
0
votes
0
answers
557
views
When we use k-means clustering with Light GBM, comparing with Random Forest
I am developping the prediction model with many parameters.
As I was not satisfied by the performance of Random Forest Regression, I tried to use
k-means clustering to regroup the similar variable and ...
0
votes
0
answers
35
views
Which clustering methodologies are likely to be best for this data?
I'm using the classic "use-case" example of clustering pixels in a photograph. I've tried K-means, agglomerative clustering, and DBSCAN. When I plot the RGB coordinates in 3-D space, all 3 ...
2
votes
1
answer
793
views
Applying Dynamic Time Warping (DTW) instead of Euclidean Distance for Clustering Synchronized Time series data
I am trying to cluster members based on hourly login data. As this is mostly synchronized, I first applied Euclidean and it failed to cluster them into groups with sensible patterns. I tried DTW ...
118
votes
6
answers
176k
views
What is the relation between k-means clustering and PCA?
It is a common practice to apply PCA (principal component analysis) before a clustering algorithm (such as k-means). It is believed that it improves the clustering results in practice (noise reduction)...
5
votes
2
answers
470
views
Why did Clustering Algorithms Become so Popular Despite their Results often Being "Uninterpretable"?
I understand the clustering algorithms are usually considered as "unsupervised algorithms", which means they can function in the absence of a response variable, making them applicable in ...
1
vote
0
answers
313
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 ...
2
votes
1
answer
599
views
Confusion on why the value of SSE is lower when a cluster looks distorted on the plot
I have a dataset of shape (29088, 11). When I apply the Kmeans where K=2 I get the following plot:
Cluster C0 has 8554 points (in blue) and cluster C1 has 20534 ...
0
votes
0
answers
32
views
K-Means clustering should cluster data evenly distributed or unevenly distributed? [duplicate]
I am clustering customers using their stay time on our web sites. When I only use one variable, time, for K-Means clustering with 10 clusters, customers look unevenly distributed to each clusters.
...
8
votes
3
answers
5k
views
k-means++ algorithm and outliers
It is well known that k-means algorithm suffers in the presence of outliers. k-means++ is one effective method for cluster center initalization. I was going through the PPT by the founders of the ...
0
votes
0
answers
124
views
K means clustering on long format data
I have a dataset of customers and some of their characteristics, including the total worth of goods purchased. Essentially, I have transaction line items. My data looks something like this:
...
1
vote
2
answers
12k
views
In k-means clustering, why sum of squared errors (SSE) always decrease per iteration?
In k-means clustering, why sum of squared errors (SSE) always decrease per iteration?
How can prove it by mathematical derivation of formulas?
k : number of clusters
m : number of examples
$c_h$ : ...
1
vote
0
answers
38
views
Does it make sense to use variables' product as a new variable in a clustering procedure?
I'm trying to separate different groups based on values from width and length using k-means and hierarchical clustering. My question relates to the possibility of using the area — measured as width * ...
1
vote
0
answers
58
views
K means clustering analysis to define geological facies using 2 attributes (ERT & seismic)
dear all.
Currently I am doing a project where the goal is to define geological facies of an area by using ML. The method that we are doing is k-means (we have no labels beforehand) and we are using ...
0
votes
0
answers
157
views
How to kmeans to clustor datetime by period weakly, montly and yearly
I have a list of bills with id, merchant name and paid date, I want to cluster this data based on the period this bills are paid, meaning the outcome result of the clustering should group the bills ...
0
votes
0
answers
432
views
Select number of clusters k-means
I have a practical question. I am trying to select the number of clusters in k-means clustering and I have tried a Silhouette analysis, an elbow plot looking at the residuals, and a hierarchical ...
1
vote
1
answer
617
views
Clustering data points with multiple rows
I have 100 people with their mobile browsing records, where each record tracks the person's browsing url and duration etc., and thus each person will have multiple rows of records.
Now I want to ...
0
votes
0
answers
84
views
How to save a Higher accurate K-means Model on a unlabelled data based on Any Performance Evaluation Metrics?
I am experimenting on Iris dataset. I am not using the label. I want to save my model based on any Performance Metrics. According to Performance Metrics which model have higher score I am choosing ...
19
votes
4
answers
25k
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 ...
3
votes
0
answers
56
views
Cluster Algorithm for multidimensional data
My goal is to cluster data (20000 samples with a range from 0.0 to 1.0, and 14 dimensions/features). Since I don't know the number of clusters, I tried using MeanShift and DBSCAN.
My problem with ...
1
vote
1
answer
2k
views
K-means gives non-spherical clusters
I am trying to cluster 24 month utilization behaviors of customers using sklearn/K-means in python. When I plot the customers by clusters in a 2-D space (Principal Components 1 and 2 of my 24-point ...
0
votes
0
answers
19
views
When does K-Means give High Quality Clusters?
It's well known k-means algorithm is effective when the clusters are spherically or elliptically distributed. This data assumption is not true in many real world data examples. Are there real-world ...
40
votes
2
answers
41k
views
How to use both binary and continuous variables together in clustering?
I need to use binary variables (values 0 & 1) in k-means. But k-means only works with continuous variables. I know some people still use these binary variables in k-means ignoring the fact that k-...
0
votes
1
answer
10k
views
Calculating clusters Entropy, Python
I ran K-means++ algorithm (Python scikit-learn) to find clusters in my data (containing 5 numeric parameters).
I need to calculate the Entropy. As far as I understood, in order to calculate the ...
1
vote
0
answers
82
views
Clustering large yearly, (presence/absence) dataframe
I have a data frame of 500,000x23 dimensions. The data is binary, representing presence or absence. The data follows identified trees through time (23 years) and looks at whether the tree is present ...
1
vote
2
answers
386
views
K-Means results interpretation when we have no idea of the number of clusters
I have a dataset with 11 variables and 80 000 observations.
I know 2 techniques to find evidence of clusters in a dataset: hierarchical clustering and k-means. I can't use the hierarchical clustering ...
0
votes
0
answers
84
views
Clustering and data scaling
I have a dataset with 5 questions, which are scaled 1-10 and income variable, which is nominal.
Should I standardise all variables with min/max scaler, or convert income to 1-10 scale?
What is the ...
9
votes
2
answers
17k
views
Why is the decision boundary for K-means clustering linear?
Apparently, for K-means clustering, the decision boundary for whether a data point lies in cluster $A$ or cluster $A'$ is linear.
I don't quite understand this statement. Why is it linear? Every ...
1
vote
1
answer
477
views
What happens when $k=1$ in k-means? What's the optimized value of distance for $k=1$?
What is the optimized value of distance $V(x,c)$ when $k=1$ (number of clusters) in k-means? What is the centroid such that it is optimal?
$$V(x,c) = \sum_j \sum_{x_i \rightarrow c_j} D(x_i,c_j)^2$$
...
0
votes
0
answers
238
views
How to optimize K-means to eliminate outliers and unrelated clusters?
I clustered document embeddings with K-Means. Embeddings have 2048 dimensions. Now, i am trying to optimize clustering. There are two problems. 1- Some clusters may have outlier samples. 2- Sometimes,...
0
votes
2
answers
1k
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 ...
13
votes
4
answers
13k
views
Methods of initializing K-means clustering
I am interested in the current state of the art for selecting initial seeds (cluster centers) for K-means.
Googling leads to two popular choices:
random selection of initial seeds, and,
using the ...
-1
votes
2
answers
98
views
How to visualise kmeans clustercenters
Asking here as I can't find a tutorial anywhere, and am new to this topic.
I've run a kmeans algorithm in spark Scala on some data, and have a prediction object that contains clusterCenters, how can ...
0
votes
1
answer
856
views
K means formula in argmin
$$
\underset{m_1,m_2,\dots,m_k}{\operatorname{arg\,min}} \sum_{i=1}^n \underset{j=1,2,\dots,k}{\min} \| \mathbf{x}_i - m_j \|^2
$$
I found this equation but I forgot the source,
but what I remember is ...
19
votes
2
answers
22k
views
Clustering of very skewed, count data: any suggestions to go about (transform etc)?
Basic problem
Here is my basic problem: I am trying to cluster a dataset containing some very skewed variables with counts. The variables contain many zeros and are therefore not very informative for ...
7
votes
5
answers
10k
views
K-Means Cluster has over 50% of the points in one cluster. How to optimize it?
I am running a clustering algorithm in Spark and I have to choose between
K-Means and Bisecting-Kmeans. However the only thing that differes between the two is the runtime because the performance is ...
0
votes
0
answers
309
views
How to "characterize" clusters (e.g K means)
I ran the K-means clustering algorithm on the iris data using the R programming language:
...
0
votes
0
answers
173
views
Silhouette score: counter-intuitive results
so I was looking back at this tutorial (https://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_silhouette_analysis.html) and it struck me that the example with ...
1
vote
1
answer
999
views
Given some words and their semantic similarity matrix, how best to group them?
Say, the words are road, highway, avenue, car, bus, train. Then they should be grouped as follows: street, road, highway, avenue ...
3
votes
2
answers
6k
views
What does minimising the loss function mean in k-means clustering?
I am learning about the k-means clustering algorithm, and I have read that the algorithm is "Trying to minimise a loss function in which the goal of clustering is not met".
I understand the ...
0
votes
0
answers
1k
views
Using Silhouette Score to evaluate different clustering algorithm
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 ...
1
vote
0
answers
160
views
External loss functions for Spectral/Density-based clustering
In this article, Abou-Mustafa and Schuurmans proposed a method that makes it easy to decide what unsupervised learning algorithm generalizes 'better' to the entire dataset. In particular, this needs ...
1
vote
1
answer
155
views
Covariate shift in k-means clustering
I'm trying to build a customer segmentation framework on e-commerce data. To do this, I'm using k-means clustering on variables which quantify the purchase Recency, purchase Frequency, Monetary value ...
0
votes
1
answer
2k
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 ...
2
votes
1
answer
1k
views
K-Means Clustering of time series in R
I want to create a cluster of K-Means of time series with R but I don't know where to start.
Could you recommend some articles or tutorial?
4
votes
1
answer
3k
views
In cluster analysis, can you use Gower's coefficient of similarity with a k-means clustering method?
I am researching cluster analysis, and I am interested in variables that are both categorical and continuous, for which I have read that a Gower's similarity coefficient is a good proximity measure. I ...
5
votes
1
answer
11k
views
How to use Gower's Distance with clustering algorithms in Python
I am trying to cluster by dataset with mixed features using k-means. As a distance metric, I am using Gower's Dissimilarity. I want to ask 2 things:
-Is k-means an appropriate algorithm that can ...
69
votes
2
answers
100k
views
Are mean normalization and feature scaling needed for k-means clustering?
What are the best (recommended) pre-processing steps before performing k-means?
2
votes
2
answers
179
views
How to find the number of clusters when more than one datasets are aggregated as one?
Suppose 3 datasets has 3 ,7, 4 clusters in their respective dataset.
When I aggregated them as one dataset what's the safest number of cluster to choose as perimeter for kmeans or any supervised ...
1
vote
2
answers
394
views
Definition of local minimum in k-means algorithm
I know what a local minimum for a function $f:\mathbb{R}^n \rightarrow \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 ...
1
vote
1
answer
5k
views
The number of clusters in the K-means and the within-cluster SS
Given a collection of observatons $\{X_i\}_1^N$ and prespecify the number of clusters K. The K-means solves
$$
\underset{\{C_k\}_1^K}{\arg\min} \sum_{k=1}^K \sum_{i \in C_k}|| X_i - \mu_k||^2
$$
where ...