KMeans clustering of textual data
<p>I have a pandas dataframe with the following 2 columns:</p>

<pre><code>      Database Name             Name

      db1_user                  Login
      db1_client                Login
      db_care                   Login
      db_control                LoginEdit
      db_technology             View
      db_advanced               LoginEdit
</code></pre>

<p>I have to cluster the Database Name based on the field âNameâ. When I convert it to a numpy, using </p>

<p>dataset = df2.values</p>

<p>When I print the print(dataset.dtype), the type is object. I have just started with Clustering, from what I read, I understand that object is not a type suitable for Kmeans clustering. </p>

<p>Any help would be appreicated!! </p>

<p>What is the <strong>mean</strong> of</p>

<pre><code>Login
LoginEdit
View
</code></pre>

<p>supposed to be?</p>

<p>There is a reason why k-means only works on continuous numerical data. Because the <em>mean</em> requires such data to be well defined.</p>

<p>I don't think clustering is applicable on your problem <em>at all</em> (rather look into data cleaning). But clearly you need a method that works with arbitrary distances - k-mean does not.</p>

python dataframe cluster-analysis k-means