parameters: (data,cluster_cnt,iter=20,thresh=1e-5)
return_statement: return clusters
docstring: Group data into a number of common clusters
  
          data -- 2D array of data points.  Each point is a row in the array.
          cluster_cnt -- The number of clusters to use
          iter -- number of iterations to use for kmeans algorithm
          thresh -- distortion threshold for kmeans algorithm
  
          return -- list of 2D arrays.  Each array contains the data points
                    that belong to a specific cluster.
  
          Uses kmeans algorithm to find the clusters.
docstring_summary: Group data into a number of common clusters
docstring_tokens: Group data into a number of common clusters
function: def cluster_data(data,cluster_cnt,iter=20,thresh=1e-5):
      """ Group data into a number of common clusters
  
          data -- 2D array of data points.  Each point is a row in the array.
          cluster_cnt -- The number of clusters to use
          iter -- number of iterations to use for kmeans algorithm
          thresh -- distortion threshold for kmeans algorithm
  
          return -- list of 2D arrays.  Each array contains the data points
                    that belong to a specific cluster.
  
          Uses kmeans algorithm to find the clusters.
      """
      wh_data = vq.whiten(data)
      code_book,dist = vq.kmeans(wh_data,cluster_cnt,iter,thresh)
      code_ids, distortion = vq.vq(wh_data,code_book)
      clusters = []
      for i in range(len(code_book)):
          cluster = np.compress(code_ids == i,data,0)
          clusters.append(cluster)
      return clusters
function_tokens: def cluster_data ( data , cluster_cnt , iter = 20 , thresh = 1e-5 ) : wh_data = vq . whiten ( data ) code_book , dist = vq . kmeans ( wh_data , cluster_cnt , iter , thresh ) code_ids , distortion = vq . vq ( wh_data , code_book ) clusters = [ ] for i in range ( len ( code_book ) ) : cluster = np . compress ( code_ids == i , data , 0 ) clusters . append ( cluster ) return clusters