Questions tagged [hierarchical-clustering]
Hierarchical clustering is a clustering technique that generates clusters at multiple hierarchical levels, thereby generating a tree of clusters. Hierarchical clustering provides advantages to analysts with its visualization potential.
1,153
questions
0
votes
0
answers
18
views
JSON that ignores nodes and groups leaves beyond color threshold in agglomerative clustering
I created a dendrogram using
AgglomerativeClustering
dendrogram(linkage_x, labels=all_encoded, color_threshold=2.2)
And I obtain this outcome
I'd like to turn this into JSON to then visualize ...
0
votes
0
answers
11
views
threshold for news clustering by Sentence transformers
I have been using Bert-based sentence embedding specifically Fast Clustering
It is a great help in clustering news of the same topic/event
the base code looks like this
corpus_sentences = list(...
-1
votes
0
answers
9
views
Bert news clustering and community detection
I have been using Bert-based sentence embedding specifically Fast Clustering
It is a great help in clustering news of the same topic/event
I'm now considering storing the derived clusters into a ...
2
votes
1
answer
37
views
python clustering package that can cluster based in distance matrix but also predict new row (without new clustering/distance matrix)
I am aware of various (sklearn) clustering algorithm that work with distance matrices - e.g. produced via a proximity matrix coming from a random forest (some clumsy reproducible code below). Is there ...
0
votes
0
answers
36
views
+50
hierarchical clustering of ternary matrix
I have a matrix with values -1,0,1 of the form
array([[ 1, 1],
[ 0, -1],
[ 1, -1],
[ 1, 1]
[ -1, 1]])
and what I want is kind of a hierarchical clustering from left ...
1
vote
1
answer
74
views
+50
Hierarchical cluster analysis help - dendrogram
I made a code to generate a dendrogram as you can see in the image, using the hclust function. So, I would like help in the interpretation of this dendrogram. Note that the locations of these points ...
0
votes
0
answers
12
views
SKlearn Agglomerative clustering - the two most suitable clusters for a point
I am doing a project which involves clustering of embeddings. In order to try improving it, instead of considering only the cluster to which an embedding belongs, I want to consider also the second ...
0
votes
0
answers
12
views
How to create and fill a similarity matrix for warehouse management
I'm trying to realize a similarity matrix using a specific similarity index and data from a warehouse.
The info needed from the DB file is:
product name
product rack in the warehouse
product shelf ...
0
votes
0
answers
9
views
Clustering of directed graphs satisfying priority constraints
I recently ran into a problem related to directed graph clustering, but don't know how to solve it.
There is a directed acyclic graph G = (V,E), where V is the set of vertices, and $E$ is the set of ...
0
votes
0
answers
12
views
How can I solve the choice of the right cluster?
For a project I have to implement the Bisecting k-means algorithm. For now I have written these lines of code.
My problem, however, is that in this case I am going to always apply kmeans to the two ...
0
votes
1
answer
23
views
Is there a way to use overlapping community clustering algorithms on igraph networks?
I have a list object of igraph networks that I would like to apply an overlapping community algorithm to. I understand that cluster_fast_greedy and cluster_edge_betweenness in igraph are hierarchical ...
0
votes
0
answers
30
views
Improve efficiency of distance matrix calculation for time series with dtw in big dataset with python
I'm trying to improve the distance matrix calculation of all possible paris in a dataset of 109489 elements.
All the elements on the column are time series (stored as lists) and the metric I'm using ...
0
votes
1
answer
22
views
K-means clustering: ValueError: could not convert string to float
I'm trying to do some clustering using the alghorithm k-means but I'm getting this error:ValueError: could not convert string to float: 'M'.
I think this happens because my variable is categorical one ...
0
votes
0
answers
35
views
Why is k-means clustering producing such bad results?
I have a dataset with 60 000 rows and 19 columns ( I will leave a sample below) and I am trying to make clusters. Using the k-means algorithm I am getting a very low score.
Dataset Sample
Since some ...
0
votes
1
answer
39
views
Clusters with k-means having bad results
I have a dataset with 60 000 rows and 19 columns ( I will leave a sample below) and I am trying to make clusters.
Using the k-means algorithm I am getting a very low score.
Dataset Sample
Since some ...
0
votes
1
answer
16
views
forming clusters/groups in a dataset based on unique values from some of the columns using R
I have a following dataset, this is a sample dataset which depicts the Products and its features(in each columns). It contains 12 features/columns for the 21 Products/records.
Data.df <- structure(...
0
votes
0
answers
13
views
Clustering. Legend for graph
please help me to find out how to generate legend for my graph.
I did the clustering and got the following results:
0 cluster = 23 values, 3 cluster = 5 values, 2 cluster = 1 values,1 cluster = 1 ...
0
votes
0
answers
39
views
Clustering/NLP : Clustering similar text with additional sentence
I have corpus more than 100K paragraphs, which have below characteristics:
Each paragraphs can have multiple instructions/steps. Paragraphs can have length > 4096.(BigBird Limit)
Two more(even ...
0
votes
0
answers
14
views
FactoMineR: category labels in HCPC cluster
I am trying to get category labels in a graph clustering using fviz_cluster from FactoMineR library, example:
library(FactoMineR)
data(tea)
Here I only choice qualitative variables
tt=tea[...
0
votes
0
answers
20
views
Hierarchical clustering based on Mahalanobis distances in R
Good day. Is there anyone that could help me generate Hierarchical clustering based on Mahalanobis distances (preferably using R)? I've tried using ecodist and pvclust but Im having trouble generating ...
0
votes
0
answers
55
views
Finding the minimum and maximum value in pandas dataframe columns
I have a pandas dataframe from which clusters are created using
import pandas as pd
from scipy.cluster.hierarchy import fclusterdata
tag_pos_refin = [(1042, 1056), (895, 922), (966, 995), (692, 716), ...
0
votes
1
answer
26
views
Is there benefit in multiple levels of clustering?
I'm currently developing a clustering model and seeking something a bit novel.
I have looked at initial clustering to 5 clusters and then applying another run to cluster these into 2 each (so 10 total)...
0
votes
0
answers
19
views
Find the max Distance without horizontal line in a dendrogram
I've been working with dendrograms to determine the optimal number of clusters for hierarchical.
If having this:
Dendrogram
Having a linkage array like so, that defines this dendrogram:
[[ 1. ...
0
votes
1
answer
21
views
Number paragons of in HCPC cluster
In HCPC analysis, it is possible to use the function res.hcpc$desc.ind$para to identify the five representative individual of each clsuter. Any way to increase the number of paragons?
Thanks!
0
votes
0
answers
20
views
Regroup clusters generated by sklearn AgglomerativeClustering
After having generated a dendogram to see how many clusters to generate from my data, I decided to create 9 clusters using the following code :
from sklearn.cluster import AgglomerativeClustering
...
0
votes
0
answers
16
views
Error in adorn_ns in while doing target segmentation of clusters in R
Am just starting out in R and machine learning.
Am working on a hierarchical clustering problem where after getting clusters of attitudinal variables (e.g preference for a certain choice), I want to ...
0
votes
0
answers
17
views
Finding possible thresholds for clustering
I'm fiddling around with scipys fcluster.
linkage(p, 'single', 'euclidean')
fcluster(Z, t, criterion='distance')
In particular, I am looking for the right value(s) for the threshold parameter t.
I ...
0
votes
1
answer
57
views
specifying three cluster groups, but dendrogram clusters into four
I'm having a frustrating problem that I can't reproduce (I wish I could). I've generated dendrograms with three ecological datasets, using the same code but unique objects for each. Each leaf in the ...
0
votes
1
answer
13
views
Clustering List of Strings
Let's we have this kind of long list:
list = ['computer','computers 12','old computer','laptop','lap top','laptops']
Is there any method to convert similar strings into categories into clusters? For ...
0
votes
1
answer
38
views
Comparing Kmeans and Agglomerative Clustering
I'm working to compare kmeans and agglomerative clustering methods for a country-level analysis, but I'm struggling because they are assigning numerical clusters differently, so even if a country (let'...
0
votes
0
answers
29
views
HDBSCAN inference labels not equal to labels generated during train period
I am trying to use HDBSCAN to generate clusters. And I also want to save the model and use it to make cluster label to new datas.
The problem is, whenever I apply HDBSCAN to datat bigger than 9754,
...
0
votes
0
answers
28
views
Calculating p-values for divisive hierarchical clustering in R (pvclust package)
Would anyone know how to calculate significance values for clusters in the R package pvclust using a divisive hierarchical clustering method (e.g. diana from the cluster package)? The pvclust package ...
0
votes
0
answers
32
views
How can I create an automated line that cut a dendrogram based on cluster number?
I'm coding in python, trying to create an horizontal line based on decided number of clusters. In my case I used 5 number of clusters, and the distance (according to dendrogram) is ~70 .
I'm using ...
2
votes
1
answer
58
views
Grouping/Clustering Rectangles
I have a list of shapes (list of points) e.g. rectangles which I want to group/cluster together.
This is what I have:
And this is what I want to achieve.
How to do it?
I already looked at some ...
1
vote
0
answers
32
views
HDBSCAN on Movielens Latent embeddings does not cluster well
I am working on a recommendation algorithm, and that has right now boiled down to finding the right clustering algorithm for the job.
Data
The data I'm working with is the MovieLens 100K dataset, from ...
0
votes
0
answers
14
views
Choosing clustering method for multivariate data
I'm currently trying to find the right approach to cluster feature vectors (dimension is 84) in an unsupervised way - there is no known labels. I'm supposed to group similar points (2500 in total). To ...
0
votes
1
answer
67
views
What is the most efficient way to cluster clusters?
I have used kmeans to cluster my data. Now I want to cluster the clusters so that the clustered clusters consist of the individual clusters from the first round of clustering.
Minimal reproducible ...
0
votes
1
answer
54
views
How to calculate total within sum of squares and between sum of squares for ward hierarchical clustering?
How would I calculate the total within sum of squares and between sum of squares for the ward clustering below? I have looked at several resources online and have not been successful. I came across ...
0
votes
1
answer
22
views
Hierarchical Clustering related
I have a question concerning hierarchical clustering using R Language. I am trying to find out what values does the argument dist.metric takes of the function hclust. I wonder whether this is the same ...
0
votes
0
answers
15
views
Hierarchical clustering: Calcuating amountof clusters
I am working with R.
I am calculating a hierarchical cluster and plotting it. I then cut it into cluster-groups to plot again.
I have a for-loop, to do this on subsets of a database, which works fine.
...
0
votes
0
answers
87
views
How can I create a scatter plot in R to visualise the result of a SOM clustering model?
I have a dataset (this is just a dummy, my real datasets are much larger) in which there are five variables: two spatial variables X and Y (basically pairs of coordinates) and three attributes A, B ...
0
votes
0
answers
16
views
Metaheuristic method for clustering words
Which metaheuristic method is better for the word clustering problem? I think ant colony and genetic are good methods for this. What are the criteria for choosing from metaheuristic methods? I ...
0
votes
0
answers
24
views
Clustering and deleting small cluster sizes using ndi.label
I am writing a code to cluster 2D image field of cloud mask(1s and 0s). I use ndi.label to detect all areas with marker =1 that are connected and give them a unique integer value. I use np.unique to ...
1
vote
0
answers
34
views
NbClust not showing any result when i run my code on RStudio
So here is my code. I want to know how many clusters that is optimal using the Single-Linkage Method. I have already installed the package for NbClust. But, when I run my code NbClust does not show ...
0
votes
1
answer
51
views
Python make newick format using dataframe with 0s and 1s
I have a dataframe like this
a b c d e f g h i j k l m
mut1 0 0 0 0 0 1 1 1 1 1 1 1 1
mut2 0 0 0 0 0 1 1 1 1 1 0 0 0
mut3 0 0 0 0 0 1 1 0 0 0 0 0 0
mut4 0 0 0 0 0 1 0 0 0 0 0 0 0
mut5 0 ...
2
votes
1
answer
30
views
Call .Fortran in R for hclust
I'm still a newbie to R and I need the complete syntax of the hclust function. I don't know how to get the full syntax of the .Fortran function contained in the hclust function. Below are .Fortran ...
0
votes
0
answers
18
views
How to automatically assign human readable labels to a topic?
Hi!
I ran a cluster analysis on my structural topic model and it resulted in 98 topics. How can I either a) manually assign topic names for each topic such that topic 98 could be called "teams&...
0
votes
0
answers
23
views
UPGMA with hclust plotting branch lengths as raw distances
I'm working on a presentation regarding utilizing UPGMA with the hlcust() function within our research lab. According to the literature, the branch length calculated by UPGMA for any pair of elements ...
0
votes
1
answer
15
views
Clustering based on location and timestamp
I have a dataset with longitude, latitude and timestamp. I want to use hierarchical clustering to cluster points that are within x miles and t duration. I understand I can use hclust and dbscan ...
0
votes
0
answers
34
views
Hierarchical Clustering (Ward Clustering) in R
Has anyone made a manual syntax of hierarchical clustering or ward clustering without the function (hclust() or agnes()) that found in packages ('cluster') in R?
If you have, can you share it?
Thanks ...