code: public Assignments cluster(Matrix matrix) {
          ClusterResult r = fullCluster(scaleMatrix(matrix), 0);
          verbose("Created " + r.numClusters + " clusters");
  
          Assignment[] assignments = new HardAssignment[r.assignments.length];
          for (int i = 0; i < r.assignments.length; ++i)
              assignments[i] = new HardAssignment(r.assignments[i]);
  
          return new Assignments(r.numClusters, assignments, matrix);
      }
docs: Returns the Cluster {@link Assignments} of each data point in {@link
  matrix}.  This method will determine a "good" number of clusters
  algorithmiclly.  This method also uses the relaxed correlation objective
  function, as the k-means objective function would always keep each data
  point in it's own cluster.