Sign up ×
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

I've computer a single centroid per class using PROC fastclus in SAS,

proc fastclus data=sample.samples_train mean=knn.clusters
maxc=1 *number of clusters*
var &predictors; 
by class;

I'm trying to classify a test set based on the closest one of these centroids created. This i'm doing using PROC discrim in also in SAS.

proc discrim data=knn.clusters   
             method=NPAR k=1 metric=identity noclassify;
      class class; 
      var &predictors; 
      ods output ErrorTestClass=knn.error;

I'm using the euclidean distance measure with the option metric=identity.

The following error is returned.

ERROR: There are not enough observations to evaluate the pooled covariance matrix in DATA= data set or BY group.

This works if I set the number of cluster in fastproc equal to 2.

How do I however preform a 1NN with single centroid per class in SAS?

share|improve this question
I also asked the question on stackoverflow [… – entropy Dec 21 '12 at 8:57
I dont have enterprise miner – entropy Dec 21 '12 at 8:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.