Stack Exchange Network

Stack Exchange network consists of 175 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
1answer
16 views

Difference between cluster centers and means

The following is the output of the cluster centers I got from a cluster model (kmeans - 6 clusters) 3.371069, 3.920354, 3.629747, 3.700000, 3.988506, 3.740385 However, after segmenting the data ...
0
votes
2answers
34 views

k modes: optimal k

I have categorical data and I'm trying to implement k-modes using the GitHub package available here. I am trying to create clusters in my (large) dataset of say, 5-7 records, each of most similar ...
1
vote
1answer
18 views

What does Make Density Based Clusterer in Weka do?

In Weka, there is a clustering algorithm with the name as Make Density Based Clusterer. When going through its properties, it takes a clusterer as base clusterer(I took it as K-means with k=3). It ...
0
votes
1answer
26 views

How to calculate mean and standard deviation of all features in a class identified by k-nearest neighbors?

I have classified my data into several neighborhoods using k nearest neighbors. I need to efficiently calculate the mean and standard deviation for all features of data points belonging to a ...
0
votes
1answer
16 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 ...
1
vote
0answers
46 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 ...
0
votes
1answer
17 views

Use output of K-Mean for Logistics regression

I've created a binary classifier using K Mean, which predicts fraud and legitimate accounts, 0 and 1. This uses two features, let's say, A and B. Now, I want to use other features like C and D, to ...
0
votes
1answer
14 views

Scikit learn kmeans with custom definition of inertia?

I've coded a small clustering algorithm for time signals using kmeans, which works ok (gives acceptable results). However, kmeans uses the sum of squared differences. I would like to be able to input ...
0
votes
1answer
16 views

where does kmeans store its trained model parameters in scikit learn?

Like in linear regression, there is model.intercept_ and model.coef_ but in kmeans i found ...
0
votes
1answer
22 views

Categorical data into numeric in excel

I have a large dataset and I would like to convert these categorical data into numeric in binary form to perform k means clustering in R. However, I get an error in value. This is the formula that I ...
0
votes
4answers
45 views

After running K-means on 12 features, I get an array containing clusters for each row. What is the next step after this?

So I used the elbow method to identify the optimal number of clusters, i.e. 4 in this case. After running K-means on dataset with 12 features, I get an array with the cluster number each row belongs ...
0
votes
1answer
19 views

KMeans vs. DBSCAN

I am trying to understand some basic clustering techniques. What is the main difference between KMeans and DBSCAN? Can we use both techniques for the same problem?
1
vote
1answer
59 views

Kmean clustering on text data

I have a large raw dataset on crime and I want to cluster the data using k-mean, However, I get this Error when I enter this code ...
1
vote
1answer
41 views

K-Means visualisation problem 8 numerical feutres [closed]

Hello im looking for exemple with python for K-Means clustering when i have data set with more than 6 feutres. thanks
1
vote
2answers
115 views

K-Means clustering - What to do if a cluster has 0 elements?

I'm writing code for k-means clustering. I have around 100000 vectors of size 128x1 (SIFT descriptors). I'm trying different initialization methods such as Forgy and Random Partition. What if suppose, ...
1
vote
1answer
28 views

Should unique vectors (SIFT descriptors) be used in K-Means Clustering?

I'm doing image classification by extracting SIFT features, clustering them and then finding BOVW histogram and classifying. I have around 180 training images from which I'm extracting SIFT ...
0
votes
1answer
31 views

Fuzzy Clustering for Categorical Data

I have a dataset in which each feature is either 0 or 1 (like BBOW). I want to cluster the data such that one point can belong to more than one cluster(soft assignment). I searched about this and I ...
0
votes
3answers
47 views

Kmeans large dataset

we are currently performing a K-MEANS under scikit-learn on a data set containing 236027 observations with 6 variables in double format (64 bits). According to our calculations, the complexity of the ...
0
votes
0answers
21 views

Unsupervised approach to News website pages classification in 3 classes

I'm working on a project in which we have to classify web pages, coming from a news website, into 3 main classes: Sections (or Categories), News and Others (like contact pages, "about us" etc.). We ...
0
votes
0answers
45 views

Clustering geodata into same size group with K-means in Python

I have the following sample geo-data which have 100 rows, and I want to cluster those POIs to 10 groups and 10 points in each group, also, if possible data in each group from same areas. ...
0
votes
1answer
49 views

k-mean without label [closed]

i m try to apply k-means with Python 3 to my dataset (Amazon review) for classify similar user (from review). I just have a TF and TF-IDF matrix (and i have a row(user) and columns(words) value in ...
1
vote
1answer
56 views

How to plot data points and not centroids using sklearn k-means?

I have issues finding a way to plot data points colored by cluster with k-means. I have a very long list of strings.I managed to plot the centroids but not the data points; ...
-1
votes
0answers
16 views

MeanShift “close-cluster” question

I have tons of experience doing Threat Hunting and now I'm studying how to use Machine Learning to enhance my hunts, and I'm having tons of fun learning Machine Learning. Since I wanted to give it a ...
0
votes
1answer
30 views

Kmeans cluster validation when I have labeled test data

I'm trying to implement the unsupervised k-means algorithm for sentiment analysis of imdb movie dataset created by stanford. The steps that I followed is : 1) Load the comments 2) Apply tokenization ...
2
votes
2answers
48 views

Clustering 1-d array with constraints?

I have following kind of 1-d array data to cluster with a few constraints: The array has length from 50 to 300, floating, some of them close to 0 and some far away. Goal: divide the array into n ...
0
votes
1answer
33 views

How can i use Hellinger Distance on array of different length?

I have to use Hellinger distance to compare arrays that are not of the same length. Is there a way to do it correctly? Put zero in the missing fields of the shorter array doesn't sound that good to me ...
0
votes
1answer
39 views

RGB Image Segmentation using Clustering

I want to apply some segmentation on a dataset for preprocessing purposes. I have tried the "otsu thresholding" approach in order to segment the image. It's a good method, however, I think a ...
-1
votes
1answer
27 views

Clustering Customers on transactional behavior

Objective: Segment the accounts on their transactional behavior and find the accounts which are more likely to subscribe for loans. Dataset: 1) Account_Number 2-91) Transaction amount ...
1
vote
0answers
13 views

How to preprocessing data of a game [closed]

I have a table of users' scores like this: ...
0
votes
1answer
679 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
30 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
1answer
29 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
28 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
55 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
34 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
25 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
2answers
1k 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
8 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
37 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
49 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
56 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
27 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
84 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
59 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
57 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
44 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
53 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
37 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
24 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
211 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 ...