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.

102 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
0answers
78 views

What are practical differences between kernel k-means and spectral clustering?

I've been lately wondering about kernel k-means and spectral clustering algorithms and their differences. I know that spectral clustering is a more broad term and different settings can affect the ...
4
votes
2answers
2k views

Constrained k-means algorithms in R (must-link constraints)

I currently face an unsupervised learning task that is to be approaches using clustering. More specifically, it is a segementation task and hence there is some prior knowledge about a) the number of ...
3
votes
0answers
45 views

What are the data preprocessing steps required before running K-Modes?

I have a clustering task at hand. The data that I have contains only categorical variables. So, k-modes seemed like the best option. But I am not sure what are the data pre processing steps required ...
3
votes
1answer
89 views

What value can I gain by doing exploratory data analysis on features (and thus data) before doing clustering?

This might not be a very good question, but I would still ask if it's beneficial to do EDA before running a clustering algorithm? I understand that EDA helps us generate good and helpful insights ...
3
votes
2answers
82 views

KMeans clusterization on documents

Whether correct or not, I'm not able to judge being myself in the early days of the Data Science. However, I have applied a Kmeans on a corpus where some random documents (very short sentences) have ...
3
votes
2answers
62 views

Cluster evolution over time

I have a dataset of transactional data with customer ID and I want to segment the dataset into groups using cluster analysis. I'm interested in following the evolution of each cluster over time, but ...
3
votes
0answers
2k views

Anomaly detection using k-means clustering in Python

I'm working on an anomaly detection task in Python. Datasets regard a collection of time series coming from a sensor, so data are timestamps and the relative values. In order to find anomalies, I'm ...
3
votes
3answers
519 views

clustering 2-dimensional euclidean vectors - appropriate dissimilarity measure

I've got a set of approx. 50 000 2-dimensional euclidean vectors which are connected with 20 groups, i.e. each group has approx. 2500 2-dimensional euclidean vectors. My data includes endpoints ...
3
votes
0answers
56 views

Determine the most important documents for supervised learning

I have somewhat of a general/high level question. Assume I'm doing supervised machine learning on some text data (tweets for example) and categorizing the documents to a certain taxonomy (multi-class ...
3
votes
0answers
73 views

Various algorithms performance in a problem and what can be deduced about data and problem?

HI I am currently trying to apply various algorithms to a classification problem to assess which could be better and then try to fine tune the bests of the first approach. I am a beginner so I use ...
2
votes
1answer
24 views

Clustering mixed data types - numeric, categorical, arrays, and text

I have a dataset with 4 types of data columns: ...
2
votes
0answers
72 views

K-Means Clustering Profile Plot & Data Normalization

I am new to k-means clustering and I am working on a project on cryptoanalysis. I have a few questions and I hope to get some help here. I have four variables and my variables data values can range ...
2
votes
0answers
61 views

Will flattening multivariate time series data before clustering make the results meaningless?

I have a large number of financial time series that I wish to do cluster analysis on. Each time series has the same length and spans multiple years of daily data (returns, volatility, etc.). As part ...
2
votes
2answers
72 views

Is k-means with Mahalanobis a valid option for clustering?

I want more info into if k-means with Mahalanobis distance is a mathematically/methodologically correct option for datasets with different variance clusters. The steps are: Create aggregate datasets (...
2
votes
1answer
28 views

How to retrain a K-Modes model based on daily data?

I have read that retraining a model depends highly on what you are trying to achieve. I am conscious that maybe I need to retrain my model daily and after a certain time I have to train the model ...
2
votes
0answers
34 views

Using a KMeans to classify URLs: validate the number of cluster and visualise

I'm relatively new to the NLP and DataScience, so apologies for omission or things like this. I've been trying to use the KMeans to classify a list of 1000 of unique URLs containing several keywords ...
2
votes
1answer
35 views

Find shared properties of a cluster samples

I have a dataset which contains ~15 features. With the elbow method, I found out that the optimal number of clusters is probably four. Therefore, I applied the K-means algorithm with four clusters. ...
2
votes
0answers
261 views

Overfitting in K-means

How do you test your results for overfitting in a k-means run? Some people have said use a training set. I have about 1500 records and about 20 fields.
2
votes
2answers
598 views

K-modes implementation in pyspark

I'm looking for an implementation of k-modes in pyspark. I found this and this as implementations. First, I tried implementing k-modes using the first link and faced issues. So I went ahead and tried ...
2
votes
0answers
138 views

Clustering credit card accounts based on their balance trajectories

I am trying to cluster credit accounts based on the shape of their balance trajectories over the next 36 months, to identify the different types of shapes possible in the portfolio. Here is how I am ...
2
votes
1answer
39 views

How to deal with Missing Not at Random Data for k-means clustering?

I am running k-means clustering on a customer dataset. One of the available demographic fields is inferred homevalue, represented as an integer. This field has value 0 when it's inferred that the ...
2
votes
1answer
1k views

Low silhouette coefficient

I am doing a kmeans clustering on a dataset of selling values of articles. Each article has 52 selling values (one per week). I am trying to automatically calculate the optimum amount of clusters ...
2
votes
0answers
68 views

PCA huge parts of missing data filling

I’m performing PCA on different time series’ and then using K Means clustering to try and group together common factors. The issue I’m facing is that some of the factors come in and out of the time ...
2
votes
0answers
1k views

How to choose the optimal k in k-protoypes?

To analyze a dataset from banking I have both numerical and categorical values. I transform them to analyze with k-prototypes. The original dataset: The modified dataset: E.g.: Job (for 1 to 12 '...
2
votes
0answers
94 views

Finding dominating attributes with in the clusters generated

I am having a dataset of customers where each customer is represented as some feature vector and I am applying K-means algorithm to this dataset. On the basis of those features, I can abstract and ...
2
votes
3answers
84 views

What best/correct algorithm/procedure to cluster a dataset with a lot 0's?

I'm new to statistics so sorry any major lack of knowledge in the topic, just doing a project for graduation. I'm trying to cluster a Health dataset containing Diseases(3456) and Symptoms(25) ...
1
vote
1answer
25 views

How come same cluster category be separated?

I have these 200 vectors which were clustered using K-means clustering based on keywords weight similarity that was given by TF-IDF (Term Frequency - Inverse Document Frequency). The vectors were ...
1
vote
1answer
21 views

Decision boundary for KMeans clustering algorithm

Below code is used for plotting decision boundary for KMeans clustering. I understand contour in general, my question is, how does plot (contour method) know where to draw decision boundary based on ...
1
vote
1answer
20 views

How to find slope of curve at certain points

how to find slope at certain points circled in blue in below curve ? Are these below 2 approaches valid ? though they give different results . How to automatically find the points where the slope ...
1
vote
0answers
12 views

Why KMeans.score() gives very high value?

I'm working on Udacity's Identify Customer segments project. My problem now is that after applying StandardScaler on the dataset after procedures of cleaning, I used PCA(n_components=36).fit_transform(...
1
vote
1answer
28 views

How to get the probability/closeness of a sample belonging to a specific cluster?

I'm new to this so please let me know if my logic of comparing cosine similarity and k-means is incorrect I got a set of ...
1
vote
0answers
13 views

clustering more than optimal k and Overfitting in k-means

In my data by using elbow method. i got optimal k to be 3. but , i clustered them into 5 clusters.and the patterns in the cluster are as i wanted them . But, does using k more than optimal k decreases ...
1
vote
2answers
19 views

Will one hot encoding / unbalanced columns cause bias to Clustering Analysis?

I'm wondering if having too many columns about one certain feature is gonna cause bias to the clustering analysis. For example, if my dataset has columns = ['incoming calls', 'outgoing calls', '...
1
vote
1answer
40 views

Clustering after PCA: Use the standardized data, or take into account the variation explained at each PC?

I am interested in clustering daily gridded data. Because of the many dimensions (gridpoints), I first perform PCA to reduce the dimensionality and keep the n-first PCs that account for at least 85% ...
1
vote
0answers
32 views

End to end k-means clustering - python

i'd like to share with you my path in a clustering exercise (via K-means using python), in order to understand if i made some errors or if there is something more that can i do. General Overview My ...
1
vote
1answer
38 views

Clustering with Only Categorical Features

I am trying to do clustering with a bunch (24) of categorical features. I have done some research and found a lot of people recommending something such as K-Modes. I tried running K-Modes on my data ...
1
vote
1answer
101 views

Clustering with 0 or Null values

I want to do some clustering for a dataset where I am looking at 10,000 peoples usage of certain electronic devices. I have 11 columns; the first column is simply a URN representing each person in the ...
1
vote
0answers
496 views

Scaling negative and positive variables when performing a k-means cluster analysis

I'm looking to perform a k-means cluster analysis on a set of data that contains variable ranges that contain both positive and negative values. Given the rangers vary so much the data will need to be ...
1
vote
0answers
449 views

“Memory Error” - Kmeans in python using pandas DataFrame

I am trying to predict on my "dataset_to_predict" having size of (297000 x 5120). While Memory usage is under 50%. No Specific Error message. I'm trying to find # of k using elbow method - Got ...
1
vote
0answers
45 views

How to find anomalies/outliers in Panel Data?

I have panel data based on 900000 different entities with 384 time steps and the data is not normally distributed. I am looking for outliers/anomalies, this is unsupervised as I have no examples of ...
1
vote
0answers
69 views

Best classification technique for following kind of data set

I have a large table where each record or row represents a single salesperson, and there are 50 columns or dimensions where each column represents one of 50 products potentially sold by any given ...
1
vote
2answers
35 views

Theoretical work on validity of restricting movement of Centroid of K-Mean

I recently received a manuscript for review in which author used ~1000 "fake" data points, so that the final centroid of K-mean stays within the required range. Neither me nor the author seems to have ...
1
vote
0answers
43 views

output of k-mean cluster as collection of tweets

I want to cluster some 1000 tweets using k-mean algorithm. But I don't want the correct output, I just want clustering of tweets. Suppose 1 cluster contain 300 tweets than all the contain of 300 ...
1
vote
0answers
204 views

How to find coreset of a given dataset in python?

I am trying to implement the core-means algorithm, which is basically k-means using coreset. I have searched up and down but could not find any libraries or modules which could help me with this. ...
1
vote
1answer
359 views

Using PCA to cluster multidimensional data (RFM variables)

So i am performing k-means clustering on RFM variables (Recency, Frequency, Monetary). The RFM variables are in the form of quantiles (1-4). I used PCA and found the PCA components. I then used the ...
1
vote
0answers
23 views

What is the difference between K-Means & Self Organized Maps?

It seems they both perform clustering. They both reduce the dimensionality of the input data and classify further inputs based upon their distance/similarity to the center points. These points then ...
1
vote
0answers
748 views

plot the results from kmeans

I am trying to plot results from document (data source: twitter) clustering using python's sklearn. Below is 10-words of words belonging to each cluster: ...
1
vote
0answers
670 views

Correct calculation of BIC (Bayesian Information Criterion) to determine K for K-Means

I am trying to calculate BIC in python. In python, there is no inbuilt library for computing BIC. I referenced the following link to compute variance and BIC further:- https://stats.stackexchange.com/...
1
vote
1answer
181 views

Should Principal components be normalized before applying K means on them?

I want to get the Principal components of a dataset and apply K mean clustering on them. Do I need to Normalized the PCA output before applying Kmeans on them ?
1
vote
0answers
612 views

k-means python implementation: unclear\wrong result

I have implemented two type of clustering in python, using SciPy: one with hierarchical approach, and the other one with k-means. In each cases I have used as input a two dimensional array X (...