Naive Bayes を当てはめようとすると、次のようになります。
training_data = sample; %
target_class = K8;
# train model
nb = NaiveBayes.fit(training_data, target_class);
# prediction
y = nb.predict(cluster3);
エラーが発生します:
??? Error using ==> NaiveBayes.fit>gaussianFit at 535
The within-class variance in each feature of TRAINING
must be positive. The within-class variance in feature
2 5 6 in class normal. are not positive.
Error in ==> NaiveBayes.fit at 498
obj = gaussianFit(obj, training, gindex);
誰でもこれとそれを解決する方法に光を当てることができますか? ここで同様の投稿を読みましたが、どうすればよいかわかりません。行ではなく列に基づいて適合しようとしているように見えますが、クラスの分散は、特定のクラスに属する各行の確率に基づく必要があります。これらの列を削除すると機能しますが、明らかにこれは私がやりたいことではありません。