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
56 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
35 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 vote
1 answer
145 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 ...
user avatar
  • 1,881
1 vote
1 answer
45 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 ...
user avatar
0 votes
0 answers
38 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 ...
user avatar
  • 1
0 votes
0 answers
16 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 ...
user avatar
  • 101
0 votes
1 answer
54 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, ...
user avatar
0 votes
1 answer
76 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 ...
user avatar
  • 31
0 votes
1 answer
32 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 ...
user avatar
  • 1,881
3 votes
1 answer
146 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. ...
user avatar
0 votes
2 answers
439 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) ...
user avatar
0 votes
2 answers
175 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 ...
user avatar
  • 3
1 vote
0 answers
111 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 ...
user avatar
  • 111
1 vote
0 answers
16 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-...
user avatar
1 vote
1 answer
326 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.
user avatar
1 vote
0 answers
25 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 ...
user avatar
1 vote
1 answer
32 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" ...
user avatar
0 votes
1 answer
27 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 ...
user avatar
  • 101
0 votes
1 answer
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?
user avatar
1 vote
0 answers
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 ...
user avatar
1 vote
0 answers
224 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 ...
user avatar
0 votes
1 answer
24 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 ...
user avatar
  • 1
0 votes
1 answer
19 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 ...
user avatar
0 votes
1 answer
58 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. ...
user avatar
  • 466
1 vote
2 answers
1k 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 ...
user avatar
3 votes
1 answer
280 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 ...
user avatar
0 votes
1 answer
18 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 ...
user avatar
  • 241
0 votes
1 answer
112 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 ...
user avatar
  • 101
2 votes
2 answers
2k views

When should we choose agglomerative clustering over K-means clustering?

I was working on a clustering based model and I read about hierarchical clustering and K-Means clustering. Under what conditions should I choose agglomerative over K-means clustering?
user avatar
1 vote
1 answer
37 views

Which algorithm would be suitable for clustering a billion datapoints?

I am running a K-means algorithm (using the sklearn implementation) on an aggregated dataset of ~350k datapoints on a 6 dimension hyper-plane (using 6 features). I ...
user avatar
  • 343
2 votes
1 answer
43 views

How does the inertia cython implementation in scikit-learn for kmeans work? [closed]

Specifically, what do the & symbol stand for? and why is the column index always 0? ...
user avatar
1 vote
0 answers
20 views

Compute similiarty between labels

I have a labeled dataset and I created a duplicate of this dataset and removed the labels and applied K-means clustering with k= the number of labels in the original data set I want to compute ...
user avatar
1 vote
1 answer
436 views

Unsupervised Text Classification with Python: Kmeans

I am working on a project to build a text classifier of questions being asked. There are no labels provided in my data so I have chosen to go with an unsupervised approach. This solution needs to read ...
user avatar
  • 31
1 vote
0 answers
34 views

What is the optimal method to evaluate clusters further?

Supervised learning is straightforward on medical data using Orange, but unsupervised learning is more challenging. I selected a data set based on Florida County Health Ratings where individuals rated ...
user avatar
1 vote
1 answer
694 views

Can distortion be derived from inertia rather than recalculating it from scratch in case of kmeans?

I got this definitional difference between distortion and inertia from here: Two values are of importance here — distortion and inertia. Distortion is the average of the euclidean squared distance ...
user avatar
  • 11
1 vote
0 answers
34 views

Considerations to take into account when clustering

My idea is to use clustering to perform stock segmentation based on risk, building different risk levels that might adapt better to different kind of users. Hence I have computed different risk ...
user avatar
1 vote
2 answers
41 views

Clusterize item set with items as vectors of features

I have to clusterize this dataset in which I have houses and water consumption in this form: $$ House1 = (x_{1},x_{2}... x_{n});\\ House2 = (y_{1},y_{2}... y_{n});\\ House3 = (z_{1},z_{2}... z_{n});\\ ...
user avatar
  • 11
1 vote
2 answers
2k views

How do I calculate distance of test data point from centroids in KMeans scikit-learn?

I am using Kmeans clustering on my data After training the model, I want to calculate the distance between Test Data points and CLuster centers. How do I do it? ...
user avatar
  • 1,133
1 vote
0 answers
90 views

How is k-means implemented in CNN?

I am new to CNN and want to try implementing YOLOv4 with a custom dataset for vehicles. As I understand it, k-means clustering is done to give labels to a set of data. I was going through some papers ...
user avatar
0 votes
0 answers
24 views

What's the best way to detect crowds?

I have a dictionary containing people and the distance between each pair in the following format: ...
user avatar
  • 125
1 vote
1 answer
182 views

How to interpret results of a Clustering Heart Failure Dataset?

I am doing an analysis about this dataset: click In this dataset there are 13 features, 12 of input and 1 is the target variable, called "DEATH_EVENT". I tried to predict the survival of the ...
user avatar
1 vote
1 answer
595 views

Why the Silhouette Score and optimal number of Cluster changes when using 2D and 3D data?

I am experimenting with Kmeans clustering. My data (vectors) was in 300 dimensions which I am converting into 2D and 3D using PCA. Now, to find the optimal number of clusters, I used the Silhouette ...
user avatar
1 vote
1 answer
28 views

Is knn similar to this version of k-means?

If we use k-means in a dataset where k is equal to the number of points in the dataset, and each cluster is made out of only a point. Considering that we have given a distance method, we can classify ...
user avatar
  • 159
1 vote
3 answers
159 views

Can we automatically chose k value in k-means algorithm?

Can we choose automatically the K value, trying every possible values (k=1,.., n) where n is the number of instances to be clustered. We then keep the value of K for which we obtained the minimum ...
user avatar
  • 159
0 votes
1 answer
870 views

how to compare between kmeans and hierarchical clustering results

I am using 2 types of clustering algorithm I apply hierarchical clustering the K-means clustering using python sklearn library Now the results are a little bit different so how can I compare the ...
user avatar
0 votes
1 answer
838 views

How to interpret the sample_weight parameter in MiniBatchKMeans?

I am using scikit-learn MiniBatchKMeans to do text clustering. In the fit() function there is a parameter sample_weight described as follows: The weights for each ...
user avatar
0 votes
0 answers
52 views

k-means for customer review analysis

I have a dataset of amazon Alexa reviews and want to group negative and positive reviews in separate groups. Is k-means a good approach to it? The dataset is unlabeled so how will my model know which ...
user avatar
2 votes
2 answers
466 views

Differentiate between positive and negative clusters

I have applied k-means clustering on my dataset of Amazon Alexa reviews. ...
user avatar
2 votes
1 answer
308 views

Understanding and find the best eps value for DBSCAN

I'm trying to run the DBSCAN algorithm on this .csv. In the first part of my program I load it and plot the data inside it to check its distribution. This is the first part of the code: ...
user avatar
1 vote
1 answer
178 views

Visualising K-Means clusters for 3D data in R

I have an excel file that contains 485k rows x 3 columns of integer values. Sample data: ...
user avatar
  • 11

1
2
3 4 5
9