title: How to find most optimal number of clusters with K-Means clustering in Python
body: <p>I am new to clustering algorithms. I have a movie dataset with more than 200 movies and more than 100 users. All the users rated at least one movie. A value of 1 for good, 0 for bad and blank if the annotator has no choice.</p>
  <p>I want to cluster similar users based on their reviews with the idea that users who rated similar movies as good might also rate a movie as good which was not rated by any user in the same cluster. I used cosine similarity measure with k-means clustering. The csv file is shown below:</p>
  <pre><code>  UserID         M1     M2       M3  ...............  M200                          
    user1          1      0                               0     
    user2          0      1        1                                      
    user3          1      1                               1                                                                         
      .
      .
      .
      .
   user100         1      0        1                                       
  </code></pre>
  <p>The problem i am facing is that i don't know exactly how to find most optimal number of clusters for this dataset and then draw a graph of those clusters. I am clustering them with k-means and there is no issue with that but i want to know the most stable or optimal number of clusters for this dataset.</p>
  <p>I will appreciate some help..</p>