kmeans works for GenericSTM and Array