How to Reassign Wrong cluster Values.

조회 수: 2 (최근 30일)
Med Future
Med Future 2022년 12월 14일
댓글: Image Analyst 2022년 12월 16일
Hello, I hope you are doing well. I have the dataset,Which is wrongly clusters into 4 cluster, but there should be 3 Clusters.
The cluster 2 (cell 2) and cluster 3 (cell 3) have almost similar values. I want to rearrange the clusters to make 3 clusters
How can i do that in Matlab. Can anybody help me with that?

채택된 답변

Image Analyst
Image Analyst 2022년 12월 15일
How are you clustering it? If you use kmeans you can tell it (force it) to use 4 clusters and it will find 4 clusters.
  댓글 수: 5
Med Future
Med Future 2022년 12월 16일
@Image Analyst The all four columns are the features which are used to identify the cluster.
I used column 2 and column 4 for K-means clustering.
Image Analyst
Image Analyst 2022년 12월 16일
Your data called "clusters" has 4 datasets, so why do you say that there should be 3? When you run it, it looks like 4 clusters is reasonable. Which sets should be combined? And when you told kmeans there were 3, which sets did it combine?
s = load('Dataset.mat')
s = struct with fields:
clusters: {4×1 cell}
ca = s.clusters;
plotColors = lines(numel(ca));
% Plot first 3 columns
for k = 1 : numel(ca)
thisCluster = ca{k};
plot(thisCluster(:, 2), thisCluster(:, 4), '.', 'Color', plotColors(k, :), 'MarkerSize', 40)
hold on
end
xlabel('Column2')
ylabel('Column4')
grid on

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Jiri Hajek
Jiri Hajek 2022년 12월 14일
Hi, your clusters contain just matrices organized in four columns, so you can easily e.g. put two of them together (concatenate versitcally) like this:
clusters{3} = [clusters{3};clusters{4}];
And to remove the fourth cluster, you can use:
clusters = clusters(1:3);
  댓글 수: 3
Jiri Hajek
Jiri Hajek 2022년 12월 14일
편집: Jiri Hajek 2022년 12월 14일
Since you did not mention any specific algorithm, this was actually a valid response.:-) But jokes aside, try to explain what you need. You want to rearrange but not to merge - so perhaps you should try to explain wat you want to achieve with the data, exactly.
Med Future
Med Future 2022년 12월 15일
@Jiri Hajek Let me explain this to you, I have apply clustering algorithm on this, There should be 3 Clusters, but the clustering algorithm solve this into 4 clusters
The cell 2 and cell 3 are mostly similar values, we want to apply any algorithm which have similar values or values near to each other should be in 1 cell.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by