How to show class label of each data point in 3D scatter plot from clustering evaluation result?
Mostra commenti meno recenti
How to show by plotting class label of each data point within each cluster obtained by any clustering?
Here is an illustration of kmeans clustering:
load fisheriris
eva = evalclusters(meas,'kmeans','gap','KList',[1:6])
scatter3(meas(:,1), meas(:,2), meas(:,3), 15, eva.OptimalY, 'filled')
So above example outputs 5 flusters which I can represent with colors. However, I will like to identify which data point fell into which cluster by putting label or coloring original data point (each data point represent an image).
Say, I pick cluster number 1. I can get the data indices within each cluster as follows:
find(eva.OptimalY == 1) % Here, we will get indices of all data points within
% cluster number 1
I will like to see (by plotting) which data points are within this cluster by class labels. So final output plot can have colored contours (circles) around each cluster, containing differently colored data points corresponding to their respective class labels.
Risposte (1)
Image Analyst
il 31 Lug 2018
0 voti
Use gscatter() instead of scatter3().
4 Commenti
hello_world
il 31 Lug 2018
Modificato: hello_world
il 31 Lug 2018
Image Analyst
il 31 Lug 2018
It doesn't do the classification (decide which data point lies in which cluster) - it just shows each class in a different color. It looks like you already did the classification and just needed a way to visualize "which data point fell into which cluster", by a different color for each class, which is what gscatter() will do.
hello_world
il 31 Lug 2018
Modificato: hello_world
il 31 Lug 2018
Image Analyst
il 3 Ago 2018
Attach screenshots to help us visualize the problem.
Categorie
Scopri di più su Cluster Analysis and Anomaly Detection in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!