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
1answer
18 views

Why compressed image size is greater than original one in kmeans algorithm?

I have a png image as shown below. And I use kmeans algorithm to compress the image by color quantization. I compressed the ...
0
votes
1answer
6 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 ...
-1
votes
1answer
16 views

How to plot datasets 1 factors for K mean clustering python

I'm unable to plot the data for K mean clusering algo usingsklearn as it throws this error : TypeError: scatter() missing 1 required positional argument: 'y' Here is the function I have written to ...
-1
votes
1answer
33 views

Apply a clustering algorithm on categorical data with features of multiple values [duplicate]

Let us I have a people data like gender, age, marital status, education, employment, hobbies. I want to make clusters of those people, having some similarity/common among them (for example they have ...
0
votes
2answers
35 views

Question about Similarity vs Dissimilarity Matrix

Right now, I'm working on a coming up with a similarity vs dissimilarity matrix for a set of data points for a clustering algorithm. My question is, if I want to use one of the many clustering ...
0
votes
2answers
28 views

Question About Coming Up With Own Function for Distance Matrix (For Clustering)

Right now, I am currently working on implementing a clustering algorithm with millions data entries with regards to game users for a mobile game. A lot of the features I plan on using are unique to ...
2
votes
0answers
17 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 ...
0
votes
0answers
13 views

How to plot k-means scatter plot on Standardize Data for 16 features in python? Is it even possible?

I have 16 features in my dataset:['age','job', 'marital', 'education', 'default','balance','housing','loan','contact','day','month','duration','campaign','pdays','previous','poutcome']. And result as :...
0
votes
1answer
13 views

Scaling of ordinal data before both hierarchical and KMeans clustering

I am new to data analytics. As part of my assignment I have to perform both hierarchical and Kmeans clustering on a data set wherein all applicable variables are ordinal (1-5 rating scale). Do I need ...
0
votes
1answer
31 views

trade offs between number of features with its score

I am running k-mean clustering on ~200000 samples. The dataset has in total 14 features. One feature is id and the rest are categorical. I have been playing with ...
0
votes
1answer
32 views

Clustering (unsupervised learning) for uneven classes

I am looking for an unsupervised method that can see also the points that start to look different from the majority. Which clustering techniques (I use python) can be used for such data sets? I have ...
0
votes
2answers
50 views

Applying and Visualizing k means clustering on a data set that has 9 features

I had a data set of images that I have extracted 9 numerical features that I want to apply k means clustering or hierarchical clustering to. I'm just not sure how to go about it. The tutorials I have ...
6
votes
2answers
67 views

How to compare different similarity measurements in text clustering?

I have a dataset which contains vectors generated from subtitles (each column represents a genre, each row is a movie name), my purpose is to find the most similar movie titles, I want to use ...
0
votes
0answers
235 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 ...
2
votes
1answer
19 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. ...
0
votes
3answers
33 views

If I have to recommend 10 movies to the users

Let's say I have some information about a user and movie data similar to the following: ...
2
votes
2answers
49 views

Is there a real life meaning about KMeans error?

I am trying to understand the meaning of error in sklearn KMeans. In the context of house pricing prediction, the error linear regression could be considered as the money difference per square foot. ...
0
votes
1answer
44 views

Can Anyone Explain this code piece by piece? [closed]

Function that creates a DataFrame with a column for Cluster Number ...
1
vote
0answers
87 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 ...
0
votes
2answers
40 views

good algorithm for outliers detection

I have 2 independent data sets (1. 300 rows and 2.3000 rows) with 6 months trades observations for 50 traders. In both datasets I have: trader id, stock title, buy/sell volume, date of trade, sector ...
0
votes
2answers
45 views

Would K-means be Appropriate to Use with Four or More Variables?

Just a general question that I'm trying to mentally visualize. I'm fairly new to using k-means clustering and have used it before on two variables, which creates a 2-D plot of points. I also know, ...
0
votes
2answers
41 views

Why does changing the cluster number change the plot in Kmeans?

This might be a dumb questions but I can't find the answer to it. I don't have the perfect mathematical understanding of kmeans, so apologies if it is. I'm just wondering why I see a different plot ...
0
votes
1answer
11 views

Product Prediction to group of customers

I have multiple groups of customer, say for segment 1 as shown in the pictures, I have a list of products that I can choose the cross-sell to that group. Consider ...
0
votes
1answer
44 views

Stationary time series for clustering algorithms

I have a set of time series data that I would like to feed into a clustering algorithm (like k-means, using dynamic time warping as the distance function). After standardizing the data with mean 0 and ...
-1
votes
2answers
142 views

Anomaly detection k-means in Time Series

I'm trying to use k-means to detect anomalies in the Amount column. I have the following part of my dataset: ...
1
vote
2answers
67 views

Standardization After PCA for Kmean clustering

I want to apply Kmean for clustering after PCA dimensionality reduction. I have standardized data with StandardScaler before the PCA, then I want to train Kmeans for finding clusters. However, the ...
0
votes
1answer
28 views

k means clustering when k = n

I want to find the minimum value of the objective function if we set K equal to the number of samples. I know the objective function is $J=\Sigma_{n=1}^{N}\Sigma_{k=1}^{K}r_{nk}||x_n-\mu_k||^2$ And ...
0
votes
0answers
113 views

Implementation of Bhattacharyya distance for filtering images that are far off from their cluster

I need assistance with the python implementation of Bhattacharyya-distance for the below use case: Here, the polygons P1, P2..Pn refer to the different images where each pixel is represented by 'n' ...
3
votes
3answers
63 views

k-means classifies one data point as a group

I have 1000 sets of one dimensional data (360 each in length), and I want k means to classify what is a small/medium/large value (n_clusters=3) for each set of data, but I'm getting a lot of instances ...
2
votes
1answer
68 views

Clustering of Weekday Weekend Time Series Data

I have a dataset of the number of steps people take throughout a day over a period of months. I aggregated them so that each person will have an average weekday and weekend time series of steps. An ...
0
votes
1answer
48 views

Creating better features for clustering

I am trying clustering for the first time trying to separate my user into three categories (or the categories I though that they will should fall in). First of all I have two tables that describe ...
1
vote
0answers
241 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
29 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
1answer
224 views

K-means clustering for one class classification

I want to know if I can use the k-means clustering algorithm for a one class classification (as in the case of one class SVM), which means I have data for 2 classes, and I labelled only the one class ...
0
votes
1answer
34 views

Preparing dataframe to carry k-means clustering [closed]

Im trying to apply 3 different algorithms of clustering on my dataset. to check which one fits the best. I'm confused how should I convert my dataframe -k-means -DBSCAN -hierarchical clustering ...
0
votes
0answers
24 views

Is the mean shift algorithm adapted to my problem?

I'm currently building a model that can detect abnormalities in a timeserie. First, we predict the next steps and then we compare the prediction with what we measure in real time. We want to see if ...
1
vote
1answer
195 views

what could this mean if your “elbow curve” looks like this?

This is from running kmeans clustering with k on the x-axis (ranging from 2 to 10) and the silhouette distance on the y-axis. Clearly there's peaks at k=3, k=4 and it seems to decline from there. It ...
0
votes
0answers
12 views

How to analyze similarity of static K-Means Nodes?

I have performed K-Means(40) clustering on customer product purchases. I am pairing this data with Association Analysis (sometimes called market basket analysis) results to motivate cross-selling ...
0
votes
1answer
16 views

Will the features in the image (edge, color, etc.. ) impacts on the performance of the spherical k-means?

I am very new in Machine learning, I recently implemented the spherical k-means, but finally I found a interesting point from the result. I used four datasets, they are minst, cifar-10, fashion-minst, ...
2
votes
1answer
354 views

How to measure the similarity between two images?

I have two group images for cat and dog. And each group contain 2000 images for cat and dog respectively. My goal is try to cluster the images by using k-means. Assume image1 is ...
0
votes
1answer
204 views

Kmeans clustering with multiple columns containing strings

I have the following dataset: https://www.kaggle.com/carolzhangdc/imdb-5000-movie-dataset What I want to find is clusters based on imdb score per genre per country. I have created a pandas data frame ...
1
vote
1answer
53 views
2
votes
0answers
148 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
1answer
111 views

Randomstate and kmeans issues

I try to cluster a dataframe of 227 rows in 5 clusters using kmeans algorithm. Each time I run my code I got different labels and different clusters which make my analysis afterwards a bit tricky. ...
2
votes
1answer
39 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
185 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
67 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
224 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 ...
1
vote
2answers
206 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
68 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 ...