Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
21 views

Accuracy for Kmeans clustering

I am looking for accuracy python code for kmeans clustering with no labels. Is there anyone who knows about it? it is ok that is not built-in function. Manually made is also ok
0
votes
3answers
17 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) ...
0
votes
0answers
15 views

How do I name clusters in kmeans?

I am working on canvas course data-set. I am trying to cluster similar courses. I have around 15 average metrics like: announcements, Assignments ( graded & non-graded), course sections, ta ...
-1
votes
0answers
18 views

How to apply Kmeans clustering to find frequency of users

My data is in a csv file which contains user ids against their number of days since their last login. I have used the following code which i found in this website. My main goal is to plot the users ...
0
votes
1answer
22 views

confusing regarding to kmeans clulstering for data correlation

I am trying to think through my process before doing any real coding. However, got really confused easily. Say I have 100 instruments and I know their price movements every day for a year. So I can ...
1
vote
1answer
25 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
2answers
46 views

Differences between applying KMeans over PCA and applying PCA over KMeans

Short question: As stated in the title, I'm interested in the differences between applying KMeans over PCA-ed vectors and applying PCA over KMean-ed vectors. Long question: Let's suppose we have a ...
0
votes
2answers
16 views

Confused about how to graph my high dimensional dataset with Kmeans

PLEASE NO SKLEARN ANSWERS So I have a dataset that is very high dimensional, and I am very confused about to convert it into a form that can be used to plot with Kmeans. Here is an example of what my ...
1
vote
0answers
17 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 ...
0
votes
0answers
27 views

Using Silhouette Measures and Dunn Index (DI) in WEKA

How do I use Silhouette Measures and Dunn Index (DI) in Weka software to compare clustering approaches in data mining? Actually I have to apply three clustering approaches (K-means, DBSCAN and EM) to ...
0
votes
2answers
88 views

How to create a simple K-Means Cluster Algorithm in Python? [closed]

Hi I am new to Data Science and Python. I want to implement K-Means Cluster Algorithm. I am successfully implemented K-means algorithm on Array of elements. For this I did like # K-Means.py ...
1
vote
0answers
6 views

Scala mllib 2.2.0 k means. Number of runs

As per the documentation here , the runs parameter does nothing. I have looked at the actual scala code for k means and it appears that the ...
0
votes
2answers
34 views

K-means sensitivity to outliers?

I'm studying K-means, and one important drawback of K-means is the lack of robustness to outliers. My question is: are there any cases when the lack of robustness to outliers may be considered not as ...
-1
votes
1answer
30 views

How to use K-Means to detect users anomaly in Access Control

I'm currently working on access control project, Smart Lock to be more spesific. Like the other smart lock system, the system required user's authentication to open the door. I'm using RFID as ...
2
votes
4answers
46 views

i"m confused that how to apply k means in my dataset

I have to detect anomalies from my data-set. The anomaly is about in which area and in which time of network usage(total_activity in my data) drastically improved. Help me to know how to apply k-means ...
1
vote
0answers
16 views

k-means cluster analysis for pitch curves in r [closed]

so I have many pitch curves time normalized. I though of using k-means as tool for automatically cluster these. I have the hypothesis that they correlate to three patterns but I want to go for an ...
2
votes
2answers
45 views

Meaning of axes in a clustering plot

If you have n time series of rainfall measurements every hour (x=time, y=amount of rain), and compute the distance matrix between each pair of time series based on Dynamic Time Warping, and then plot ...
2
votes
0answers
30 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 ...
3
votes
3answers
55 views

k-means clustering or classification?

Why is choosing the k in the k-means clustering method based on a feature (take a dead or alive patients scenario as an example, k will be 2) considered clustering rather than classification?
-1
votes
2answers
37 views

How to plot High Dimensional supervised K-means on a 2D plot chart

I'm Having a ML problem where my data set contains 80 features labelled into 3 groups (0, 1, -1). I want to plot the data on a 2D surface to see how "close" (similar) data with ...
2
votes
0answers
32 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
2answers
35 views

Evaluating clusters (e.g. built by kmean) using Random Forest

I have made clusters for my data set (1.5 million samples and 800 features) using k-mean. I am aware of internal indices for evaluating clusters. However, I was thinking about training a supervised ...
3
votes
1answer
22 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
58 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 ...
1
vote
2answers
39 views

Finding best cluster after running K-Means clustering

I have bunch of text which I want to segregate based on semantic similarity. Running through K-Means, I was able to divide the complete text into different clusters. However, I still need to find ...
2
votes
3answers
86 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
2answers
38 views

k-means|| in PySpark

I'm trying to apply k-means$\|$ clustering in PySpark. According to this paper, there is an oversampling factor, $l$, that would affect the model's cost. I couldn't find any parameter regarding ...
3
votes
1answer
163 views

Sklearn: unsupervised knn vs k-means

Sklearn has an unsupervised version of knn and also it provides an implementation of k-means. If I am right, kmeans is done exactly by identifying "neighbors" (at ...
-1
votes
1answer
35 views

How to solve online clustering problem

Suppose we have a clustering problem where data sample is of multi-dimension with a mix of numeric and categorical type. If the ...
1
vote
1answer
61 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
21 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
2answers
214 views

What approach other than Tf-Idf could I use for text-clustering using K-Means?

I am working on a text-clustering problem. My goal is to create clusters with similar context, similar talk. I have around 40 million posts from social media. To start with I have written clustering ...
3
votes
2answers
57 views

Extracting useful features for k-means clustering

So say suppose I have a data-set with features being either present or not i.e. 0or 1. Now I want to identify the features which ...
0
votes
2answers
169 views

How to cluster histograms or density distributions?

I have exactely no idea of where to start when it come to cluster distribution and find out similar the similar one. is there a package in R that do the job ?
0
votes
1answer
37 views

Clustering with groups in data related to cluster label

I want to predict which device got used in which room. Therefore I've got device and sensor data. My idea was to create a feature vector lie this: ...
3
votes
0answers
36 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
3answers
50 views

Clarification on K Means Clustering Algorithm and its Analysis

I fail to understand how the circled point is assigned to cluster c2 and not c1. From what I have understood, the points are assigned to the (nearest?) centroid in order to minimise the squared ...
2
votes
1answer
546 views

How to calculate the silhouette coefficient?

Calculate the silhouette coefficient of point Pi from the above image. To apply the given formula, how to know which is a(i) and b(i)?
1
vote
1answer
22 views

Predicting which apps users may be interested in

I am building a mobile app that can predict what apps users may be interested in downloading from the play store, based on what apps the user has already installed on their device and how much time ...
4
votes
1answer
111 views

What's the difference between finding the average Euclidean distance and using inertia_ in KMeans in sklearn?

I've found two different approaches online when using the Elbow Method to determine the optimal number of clusters for K-Means. One approach is to use the following code: ...
0
votes
1answer
50 views

What's the difference between finding the average Euclidean distance and using inertia_ in KMeans in sklearn?

I've found two different approaches online when using the Elbow Method to determine the optimal number of clusters for K-Means. One approach is to use the following code: ...
1
vote
1answer
174 views

Clustering a labeled data set

I have a large labeled dataset with 29 classes. Is is possible to use a clustering algorithm (like k-means) in this dataset, or it's not possible since clustering algorithms are unsupervised ?
1
vote
1answer
80 views

How to get data back into two separate audio files after successfully applying kmeans clustering on an audio file?

Okay so I wrote a very simple python code to read a wav file, get the mfcc features and then use kmeans clustering on the features. The hello.wav file has two different people saying hello at the same ...
2
votes
0answers
24 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 ...
0
votes
0answers
257 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: ...
7
votes
0answers
494 views

Bag of Visual Words

What I am trying to do: I am trying to classify some images using local and global features. What I have done so far: I have extracted sift descriptors for each image and I am using this as my ...
3
votes
2answers
261 views

Plots with shaded standard deviation

What tools can I use to make a visualization similar to this one? I want to have the mean be bolded and the standard deviation be shaded.
1
vote
1answer
26 views

Problem faced when collect data randomly from cluster [closed]

I have a semi structured data set. I need to collect some data (unlabeled) randomly for labeling. As initiative at first I separated labeled and unlabeled data. Then I convert those data from string ...
1
vote
0answers
154 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/...
0
votes
3answers
212 views

k-means: Only one-dimensional cluster predictions in two-dimensional space

For this dataset, it seems that the predictions of my k-means model only consider the horizontal axis, although the cluster centers seem reasonable. Is something wrong with this classification? ...