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.

1
vote
0answers
10 views

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

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 ...
0
votes
0answers
9 views

Determining Data Homogeneity/Heterogeneity Using Clustering [on hold]

I have a sequential data (i.e., that comes one instance per time). I want to determine for an amount of instances accumulated (after a while), if they are stochastic (i.e., sparse), or homogeneous (i....
2
votes
2answers
37 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
18 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
2answers
39 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
32 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
14 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
32 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
20 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
28 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
32 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 ...
1
vote
2answers
59 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
1answer
23 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
48 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
21 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
34 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
20 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 ...
0
votes
2answers
95 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
55 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
94 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
36 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
30 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 ...
2
votes
3answers
40 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 ...
1
vote
1answer
223 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
76 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
33 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
84 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
35 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
19 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
174 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: ...
5
votes
0answers
291 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 ...
2
votes
2answers
134 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
100 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
99 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? ...
0
votes
2answers
37 views

Should I seperate the data for a k-means model?

I would like to cluster some user reviews and I'm doing this with k-means. In my dataset I have English and German reviews. Is this manipulating the cluster result if I don't seperate them? Or should ...
0
votes
2answers
44 views

How to select features for clustering to detect the number of different unique products in a search result?

I am trying to use clustering to determine the number of products in a search of products. So far I am using kmeans clustering. I have run into a problem where I cannot determine good features to use. ...
1
vote
2answers
55 views

How does ML Clustering put to a practical real-world use?

Newbie alert to data science and ML. I'm learning Supervised and Unsupervised learning at the moment and Supervised learning is easy to digest and I can relate to a lot of practical use cases. ...
0
votes
0answers
37 views

How to overwrite a function in R?

I want to customize pam function of cluster package in R. I have copy pasted the source code of this function and asigned it to a new object pam_plus. when I try to run this new pam_plust function,I ...
0
votes
0answers
26 views

Clustering dilemma: Strange behaviour of K-Means

K-Means (k = 5) clustering was run in 3 different cases, Case-a: Jan-Dec months of data Case-b: Jun-Dec data of the same year Case-c: Dec of the same year. The distribution of the data, it is ...
0
votes
0answers
15 views

How would clustering results differ if one clustered twice, each time using $n$ clusters, or once using $n^2$ clusters?

As in the title, I am interested in any reasons, a priori, why one could expect different results from iterative clustering using a smaller number of clusters, versus a single run of the algorithm ($k$...
-1
votes
1answer
31 views

How to find data that is the maximum distance from cluster center or stayed border of the cluster

After applying k-means clustering we can easily find the closest index of the cluster. Now if I want to find the distance index from cluster center / index that is staying border of the cluster, how ...
0
votes
0answers
13 views

assignment text corpus to its cluster in R

i asked this question on stackoverflow https://stackoverflow.com/questions/49259584/assignment-text-corpus-to-its-cluster-in-r?noredirect=1#comment85522736_49259584 but i was recommended ask it here ...
0
votes
2answers
40 views

Testing unsupervised clustering

Assume we train a KMeans model using data X. This will give a set of centroids that can be used to cluster data X* using a Nearest Centroid Classifier. If we use a density-based model such as DBSCAN ...
1
vote
1answer
40 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 ?
0
votes
1answer
32 views

Interpreting the C-Index

I have some problems understanding/interpreting the C-Index cluster quality measure. So, if we have $c(x_i, x_j) = 1 $ if $ x_i, x_j $ in the same cluster; $0$ else $\Gamma = \sum_ {i=1}^{n-1}\sum_ {...
0
votes
2answers
45 views

Clustering algorithm prior to model building?

I would like to understand, how a clustering algorithm can be used (if possible) to identify naturally occurring groups within a data set, prior to building predictive models/model, and to hence ...
0
votes
2answers
89 views

Does K-Means' objective function imply distance metric is Euclidean

The objective/loss function of K-Means algorithm is to minimize the sum of squared distances, written in a math form, it looks like this: $$J(X,Z) = min\ \sum_{z\in Clusters}\sum_{x \in data}||x-z||^2$...
1
vote
1answer
49 views

k-means with one cluster

K-means may give different results, because the initial choice of centroids is random. However, if I were to choose k=1, will the algorithm always provide the same answer equal to the "barycentre" ...