문제

I want classify my data with LDA (Linear discriminant analysis) classifier. My test data size is:

1    12   240    64

And my train data size is:

85    12   240    64  

My label size is:

1 85  

For this purpose I used classify MATLAB code like this:

class = classify(Test_data, Train_data, label, 'linear');

But it give me error:

The length of GROUP must equal the number of rows in TRAINING.

I don't know why give me this error because as you see, my TRAINING data row number is 85, the same as my label(GROUP) length. Can some one please tell me what I have done wrong?

도움이 되었습니까?

해결책

LDA works on rows; note the documentation "training and group must have the same number of rows".

Your labels are currently specified in columns. The following will fix your error:

class = classify(Test_data,Train_data,label','linear');

Note the ' after label to transpose into rows.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top