ClusteringSpec clusteringSpec = new ClusteringSpec( modelSchema );
Measure measure = comparisonMeasure.getMeasure();
if( measure instanceof Euclidean )
clusteringSpec.setComparisonMeasure( new EuclideanMeasure() );
else if( measure instanceof SquaredEuclidean )
clusteringSpec.setComparisonMeasure( new SquaredEuclideanMeasure() );
else
throw new UnsupportedOperationException( "unsupported comparison measure: " + comparisonMeasure );