function initCentroids(X, nClusters) {
  const indices = [];
  while (indices.length < nClusters) {
    const ind = Math.floor(Math.random() * X.shape[0]);
    if (!indices.includes(ind)) {
      indices.push(ind);
    }
  }
  return tf.gather(X, indices);
}
@param {Tensor2D} X - 2-D array of data points being clustered, shape = [nInstances, nFeatures]
@param {Number} nClusters - number of clusters
@return 2-D array centroids. shape = [nClusters, nFeatures]