ModelSchema modelSchema = createModelSchema( model );
if( model.getModelClass() != ClusteringModel.ModelClass.CENTER_BASED )
throw new UnsupportedOperationException( "unsupported model class, got: " + model.getModelClass() );
ComparisonMeasure comparisonMeasure = model.getComparisonMeasure();
if( comparisonMeasure.getKind() != ComparisonMeasure.Kind.DISTANCE )
throw new UnsupportedOperationException( "unsupported comparison kind, got: " + comparisonMeasure.getKind() );
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