<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Ask Ghassem - Recent questions tagged clustering</title>
<link>https://ask.ghassem.com/tag/clustering</link>
<description>Powered by Question2Answer</description>
<item>
<title>Kmeans clustering in python - Giving original labels to predicted clusters</title>
<link>https://ask.ghassem.com/1022/kmeans-clustering-python-giving-original-predicted-clusters</link>
<description>&lt;p&gt;I have a dataset with 7 labels in the target variable.&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
X = data.drop(&#039;target&#039;, axis=1)
Y = data[&#039;target&#039;]
Y.unique()&lt;/pre&gt;

&lt;p&gt;array([&#039;Normal_Weight&#039;, &#039;Overweight_Level_I&#039;, &#039;Overweight_Level_II&#039;,&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#039;Obesity_Type_I&#039;, &#039;Insufficient_Weight&#039;, &#039;Obesity_Type_II&#039;,&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#039;Obesity_Type_III&#039;], dtype=object)&lt;/p&gt;

&lt;pre class=&quot;prettyprint lang-python&quot; data-pbcklang=&quot;python&quot; data-pbcktabsize=&quot;4&quot;&gt;
km = KMeans(n_clusters=7, init=&quot;k-means++&quot;, random_state=300)
km.fit_predict(X)
np.unique(km.labels_)&lt;/pre&gt;

&lt;p&gt;array([0, 1, 2, 3, 4, 5, 6])&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After performing KMean clustering algorithm with number of clusters as 7, the resulted clusters are labeled as 0,1,2,3,4,5,6. But how to know which real label matches with the predicted label.&lt;/p&gt;

&lt;p&gt;In other words, I want to know how to give original label names to new predicted labels, so that they can be compared like how many values are clustered correctly (Accuracy).&lt;/p&gt;</description>
<category>Machine Learning</category>
<guid isPermaLink="true">https://ask.ghassem.com/1022/kmeans-clustering-python-giving-original-predicted-clusters</guid>
<pubDate>Wed, 27 Apr 2022 05:32:54 +0000</pubDate>
</item>
<item>
<title>Why should I use Dynamic Time Warping over GMM for timer series clustering?</title>
<link>https://ask.ghassem.com/962/why-should-dynamic-time-warping-over-timer-series-clustering</link>
<description></description>
<category>Machine Learning</category>
<guid isPermaLink="true">https://ask.ghassem.com/962/why-should-dynamic-time-warping-over-timer-series-clustering</guid>
<pubDate>Fri, 04 Dec 2020 03:19:16 +0000</pubDate>
</item>
<item>
<title>how to choose the number of clusters based on intertia and based on silhouette using K-means</title>
<link>https://ask.ghassem.com/433/choose-number-clusters-based-intertia-based-silhouette-using</link>
<description>how to choose the number of clusters based on intertia and based on silhouette using K-means</description>
<category>Machine Learning</category>
<guid isPermaLink="true">https://ask.ghassem.com/433/choose-number-clusters-based-intertia-based-silhouette-using</guid>
<pubDate>Sat, 20 Oct 2018 01:04:51 +0000</pubDate>
</item>
<item>
<title>What is k-means algorithm and how can we select K for it?</title>
<link>https://ask.ghassem.com/394/what-is-k-means-algorithm-and-how-can-we-select-k-for-it</link>
<description></description>
<category>Machine Learning Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/394/what-is-k-means-algorithm-and-how-can-we-select-k-for-it</guid>
<pubDate>Mon, 15 Oct 2018 05:49:41 +0000</pubDate>
</item>
</channel>
</rss>