Questions tagged [cluster-analysis]

Cluster analysis is the process of grouping "similar" objects into groups known as "clusters", along with the analysis of these results.

cluster-analysis
Filter by
Sorted by
Tagged with
0 votes
0 answers
1k views

Octave: "error: matrix cannot be indexed with . error: called from fitgmdist at line 486 column 14"

I am trying to use the Gaussian mixture model to cluster my data in octave. As a start, I am trying to fit the data to a Gaussian distribution using the fitgmdist function in octave. However, I am ...
Amr Amer's user avatar
0 votes
1 answer
78 views

Time Series Clustering of Numpy Objects

Every idea or suggestion would be appreciated! I have several "the same style" numpy objects(u1,u2,u3...) each of them is : Object 1: [[Timestamp('2004-02-28 00:59:16'), 19.9884], [...
user avatar
1 vote
0 answers
931 views

How can I compute the silhouette score of a clustering using a custom distance metric?

I'm working with network analysis and I performed spectral clustering in a graph and I'd like to evaluate my clustering using silhouette score, but I'm getting an error which makes me question if I'm ...
Vinicius Silva's user avatar
0 votes
0 answers
62 views

Trouble with unsupervised clustering method of dataframe

I'm working on some Python ML exercises and I'm stuck on a question. I have a dataframe with 7 columns and almost 10k lines. 6 of those column/variables are objects and 1 is a float. The 7 variables ...
rifraf_01's user avatar
1 vote
2 answers
2k views

How to evaluate K-Means Clustering since automatic indexes of clusters don't match true labels?

How do we measure the accuracy of a K-Means clustering algorithm (say, generate a confusion matrix) since the automatic indexes of cluster is probably a permutation of the original labels?
Paw in Data's user avatar
  • 1,382
0 votes
1 answer
44 views

Extraction of N most frequent keywords per cluster in Hierarchical Clustering NLP

I want to extract n most frequent keywords per cluster from the results of Agglomerative hiearchichal clustering. def agglomerative_clustering(tfidf_matrix): cluster = AgglomerativeClustering(...
Rawia Hemdan's user avatar
0 votes
1 answer
169 views

K-means performance

I have a large dataset that each sample has a specific class number from 0 to 8. I used K-means algorithm from sklearn python package. The output of K-means is different when I run codes for several ...
Mohammad's user avatar
  • 163
2 votes
1 answer
978 views

Clustering with Mclust results in an empty cluster

I am trying to cluster my empirical data using Mclust. When using the following, very simple code: library(reshape2) library(mclust) data <- read.csv(file.choose(), header=TRUE, check.names = ...
Jara's user avatar
  • 57
1 vote
2 answers
1k views

Changing marker style in Matplotlib 2D scatter plot with colorbar according to cluster data

I am carrying out clustering and try to plot the result with the scatter plot function of matplotlib. A dummy data set is : x = [48.959 49.758 49.887 50.593 50.683 ] y = [122.310 121.29 120.525 120....
Fahad Haneef's user avatar
2 votes
2 answers
2k views

Agglomerative clustering from custom pairwise distance function

thanks to insightful comments on this thread: Pairwise Wasserstein distance on 2 arrays, I was able to come up with a custom function to find a distance metric between a set of 2 dimensional arrays (...
m1gnoc's user avatar
  • 31
0 votes
1 answer
386 views

How to remove individual attributes within cluster plots

I would like a fairly plain, publication-quality cluster plot. I have created the plot and removed the title, legend and adjusted the axis titles, with the script provided. However, I would also like ...
Angela's user avatar
  • 23
0 votes
1 answer
2k views

Seaborn.clustermap : cluster rows and columns using different metrics

I was trying to generate a clustermap using one of the Seaborn functions. Currently, it allows me to use the same metric (Pearson, Euclidean etc.) for rows and columns, but remains difficult for using ...
Code42's user avatar
  • 2,392
1 vote
1 answer
1k views

Is KMeans Clustering with higher dimensions possible?

I have a few hundred 3d arrays that I would like to do some clustering analysis with however sklearn.cluster.KMeans will only do a 2D array. Each of my arrays are size (56,88,56) and I have 300. when ...
rzaratx's user avatar
  • 796
1 vote
1 answer
1k views

Pairwise Wasserstein distance on 2 arrays

I try to compare sports formations and therefore need to compare how similar distributions of points (x, y) coordinates are to eventually cluster them. I am working with a 3D array of the following ...
m1gnoc's user avatar
  • 31
1 vote
1 answer
207 views

R n most similar time series - dwt clustering / nearest neighbour

The data attached is a simplified example, as in reality I have hundreds of people and hundreds of points in time. I am looking for a way to determine similar time series. I have some code here to ...
Aaron Walton's user avatar
2 votes
1 answer
319 views

Kmeans with initial centroids give different outputs in Matlab and Python environment

The input to the Kmeans in both the Matlab and Python environments is the following list: input = [1.11, 0.81, 0.61, 0.62, 0.62, 1.03, 1.16, 0.44, 0.42, 0.73, 0.74, 0.65, 0.59, 0.64, 0.98, 0.89, 0.62, ...
piyush's user avatar
  • 23
0 votes
1 answer
30 views

can I use a clustering model written in python in an iOS application?

I wrote a code with python that uses clustering to detect colours in an image, is there any API's or techniques that I can use the code in my ios application that I want to publish?
Dan's user avatar
  • 25
1 vote
1 answer
95 views

How to identify standalone spheres in Julia?

How is it possible to get rid of standalone spheres? Or how can I manipulate the data set, that I don't plot spheres, which are not connected together? (Means the surface of a sphere does't touch ...
Tom's user avatar
  • 110
2 votes
3 answers
5k views

how to save a scikit-learn k-means clustering model?

Currently The K-means CLustring code is written like this in a method: def predict(image_path): image = cv2.imread(image_path) image = image.reshape((image.shape[0] * image.shape[1], 3)) clt = KMeans(...
Dan's user avatar
  • 25
0 votes
1 answer
91 views

separate clusters observable in ggplot through a vector? R

df <- data.frame(samples = c('A1','B1','C1','K3','L4','M5','N5','O5'),var1 = c('12','34','54','54','0.1','0.45','0.99','5'),var2 = c('16.5','26.5','21.2','19.8','2.98','3','1.99','2.65')) ggplot(...
JORIS's user avatar
  • 59
0 votes
1 answer
509 views

Sklearn method to predict number of clusters? [closed]

right now I'm looking for an sklearn method that does something like: arr = [13,15,41,45,90,100] print(KMeans.num_clusters(arr)) Outputs 3
momion's user avatar
  • 131
-3 votes
1 answer
751 views

How to perform clustering of points when distance between any two points are given? [closed]

I have a Set of lets say 100 points. And the distance of a point from any other point is given. Which means I have 100x100 dataset giving me distance of each of the 100 points from all the other 100 ...
Utkarsh Srivastava's user avatar
0 votes
0 answers
1k views

Don't understand overlapping between clusters, kmeans

how come there are overlaps in my clusters ? Is it because sklearn.KMeans finish the iterations too soon ? graph: kmeans cluster sepal iris flower some clarifications: the data is 4D, values are ...
Liam_Noah's user avatar
0 votes
1 answer
485 views

Simple approach to assigning clusters for new data after k-modes clustering

I am using a k-modes model (mymodel) which is created by a data frame mydf1. I am looking to assign the nearest cluster of mymodel for each row of a new data frame mydf2. Similar to this question - ...
sh_student's user avatar
3 votes
2 answers
2k views

How to find an "x" amount of closest elements to a centroid

I am working on a dataset that is very high dimensional and have performed k-means clustering on it. I am trying to find the 20 closest points to each centroid. The dimensions of the dataset (X_emb) ...
Harith Siddiqui's user avatar
0 votes
1 answer
127 views

How to tag data point to a cluster?

I have completed and plotted the DBSCAN cluster in R markdown. This is my code currently: dbscan.8=fpc::dbscan(current.matrix, eps=2, MinPts=log(33359)) #list generated fviz_cluster(dbscan.8, data=...
jonoliver's user avatar
1 vote
1 answer
1k views

How to produce a pairwise plot of Kmeans clustering plots in R?

I performing k mean clustering analysis on the Iris dataset in R. I am trying to produce a pairwise plot of all the different combinations of attributes (Sepal.Length, Sepal.Width, Petal.Length and ...
daisybeats's user avatar
1 vote
1 answer
405 views

change specific row size of seaborn clustermap

I use seaborn clustermap for visualizing clustering results (each row represents a different cluster). In addition, I have the data of what percentage of the total data is assigned to each cluster. I ...
obar's user avatar
  • 357
1 vote
1 answer
227 views

Using norm Function In MATLAB

I have a matrix of data which is the coordinates of some points and coordinates of 5 clusters data = [randi(100,100,1),randi(100,100,1)]; x_Clusters = [20 5 12 88 61]; y_Clusters = [10 50 14 41 10]; ...
MMd.NrC's user avatar
  • 91
2 votes
1 answer
3k views

How to perform clustering on a dataset containing TRUE/FALSE values in Python?

My dataset contains columns describing abilities of certain characters, filled with True/False values. There are no empty values. My ultimate goal is to make groups of characters with similar ...
adamDud's user avatar
  • 339
0 votes
1 answer
827 views

How to calculate the number of days from a datetime until today?

I have a dataframe with a date column that is represented as ndarray object. I want to clusterize dataframe and I decided to convert each string (like '2009-01-04') in this column to int. How can I ...
user12628549's user avatar
0 votes
2 answers
6k views

How to cluster a large dataset based on similarity?

I would like to cluster a huge dataset into clusters based on similarity. How can I approach this problem? I have tried MinBatchK means and DBSCAN but I am not getting great results. The problem I am ...
Lionel Christopher's user avatar
1 vote
2 answers
291 views

How to select certain rows of a data set in R to then use in a function?

I am trying to find the Mahalanobis Distance between the different species in the iris dataset in R. I was able to find the distance between setosa and versicolor by the following code: library(HDMD) ...
daisybeats's user avatar
1 vote
1 answer
543 views

Resolve error in creating table of logit regression results with stargazer in R

I am hoping to present a nice table of a logistic regression measuring hypertension using stargazer which includes the coefficients, standard error, and significance (indicated by stars). When I try ...
juliah0494's user avatar
0 votes
1 answer
656 views

Mahalanobis distance with multiple observations, variables and groups

For the iris data set, I am trying to find the Mahalanobis distances between each pair of species. I have tried the following but have had no luck. I tried the following: group <- matrix(iris$...
daisybeats's user avatar
1 vote
1 answer
1k views

Running multiple aggregations on metrics (Kusto/Application Insights)

I am looking to run a Kusto query against an Application Insights instance that will report a metric binned by a certain time amount but also grouped by a custom property. Currently, I have this ...
pkiller162's user avatar
2 votes
0 answers
223 views

Identify cluster number in dendrogram from heatmaply

I am using the heatmaply package to create heatmaps with dendrograms from the dendextend package. Is there a way to identify the cluster numbers on the dendrogram? This is an example heatmap for the ...
Sara Altamirano's user avatar
-2 votes
1 answer
940 views

How to plot OPTICS clustering results using seaborn?

I obtained features from 10 images from 2 categories (cats and dogs) using CNN. So I have a (10, 2500) numpy array. I applied the OPTICS clustering algorithm on the array to find which image belongs ...
Harsh Wardhan's user avatar
0 votes
1 answer
762 views

ignite client is taking long time to start when we are connecting to multiple nodes

scenario , i have two server nodes in beginning and when we are trying to connect client nodes taking 15+ min to start client. please find below server configuration. only change is IP address for ...
Bhavesh Modi's user avatar
0 votes
0 answers
34 views

Data points in hierarchial clustering

In Hierarchy Clustering(Single Link or Complete Link), is it possible for a point to be closer to points in other clusters than to every point in its own cluster? I understand that, in single linkage, ...
satish cc's user avatar
0 votes
0 answers
315 views

When visualizing graph clusters, prevent convex hulls from overlapping

I have a 2-d graph partitioned into 25 clusters. The cluster shapes are complex and in some cases adjacent. Here is a script that will generate a simplified example of what my results look like: ...
Obed's user avatar
  • 413
2 votes
1 answer
1k views

What does minimising the loss function mean in k-means clustering?

I am learning about the k-means clustering algorithm, and I have read that the algorithm is "Trying to minimise a loss function in which the goal of clustering is not met". I understand the ...
ceno980's user avatar
  • 2,013
0 votes
0 answers
74 views

How to cluster a score / probability map and get the modes (with variable numbers) in pytorch or numpy

I have a 2d probability map (please correct me if I use any term wrong). Something like this: Here yellow is a high value and violet is zero. Please ignore the red cross. It is represented as a ...
ArcaneEmergence's user avatar
0 votes
0 answers
541 views

How can I achieve hierarchical clustering with p-values for a large dataset?

I am trying to carry out hierarchical cluster analysis (based on Ward's method) on a large dataset (thousands of records and 13 variables) representing multi-species observations of marine predators, ...
Julia Gostischa's user avatar
4 votes
2 answers
2k views

How to explain text clustering result by feature importance? (DBSCAN)

There are similar questions and libraries like ELI5 and LIME. But I couldn't find a solution to my problem. I have a set of documents and I am trying to cluster them using scikit-learn's DBSCAN. First,...
MehmedB's user avatar
  • 1,139
2 votes
1 answer
3k views

For DBSCAN python, is it mandatory to do Standardization and normalization both?

For DBSCAN implementation, is it necessary to have all the feature columns Standardized AND Normalized? e.g. [[ 664. , 703. , 2901.069079], [ 632. , 717. , 2901.069079], [ ...
sandeepsign's user avatar
0 votes
0 answers
188 views

DBSCAN on high dense dataset. R

I've been recently studying DBSCAN with R for transit research purposes, and I'm hoping if someone could help me with this particular dataset. Summary of my dataset is described below. BTIME ...
Yun Hyunsoo's user avatar
0 votes
1 answer
520 views

Density based clustering that allows user to specify number of clusters

I have data that consists of roughly 100,000 points on a 2-d graph. Each point has X and Y coordinates. I'm looking for an algorithm that will cluster these points based on density but I want to ...
Obed's user avatar
  • 413
-1 votes
1 answer
112 views

Different Kmean results by sklearn and from scratch

I tried to compare the kmean clustering result from sklearn package and from scratch. The scratch code is showns below: import matplotlib.pyplot as plt from matplotlib import style style.use('ggplot')...
夏思阳's user avatar
1 vote
0 answers
120 views

How to plot cluster/node number on a Self Organizing Map

I'm a neophyte of data analysis with R and I'm analyzing RNAseq data using Self Organizing Maps and the Kohonen package to cluster genes based on trends of expression. I'm quite satisfied with the ...
Elio's user avatar
  • 21

1
26 27
28
29 30
125