Imported from https://github.com/andrade-stats/convexCovariateClusteringClassification