5
MATLABで別々の行をどのように分類しますか?Naive Bayesの行の分類
私はそうのような単一coloums分類することができます現時点では上記とは異なり
training = [1;0;-1;-2;4;0;1]; % this is the sample data.
target_class = ['posi';'zero';'negi';'negi';'posi';'zero';'posi'];
% target_class are the different target classes for the training data; here 'positive' and 'negetive' are the two classes for the given training data
% Training and Testing the classifier (between positive and negative)
test = 10*randn(25, 1); % this is for testing. I am generating random numbers.
class = classify(test,training, target_class, 'diaglinear') % This command classifies the test data depening on the given training data using a Naive Bayes classifier
を、私は分類する:
A B C
Row A | 1 | 1 | 1 = a house
Row B | 1 | 2 | 1 = a garden
はここでMATLABサイトからコードの例です:
nb = NaiveBayes.fit(training, class)
nb = NaiveBayes.fit(..., 'param1', val1, 'param2', val2, ...)
param1
、val1
などが分かりません。誰も助けることができますか?ここで
こんにちは、このインスタンスでは、test_classは何ですか? –
@JungleBoogie:テストセットの真のクラスラベルです。パフォーマンスの公平な測定値を得るために使用します(モデルを1つのセットで訓練し、完全に異なるセットでテストします)。 – Amro
ああ、私は今理解しています。私はあなたのメソッドを使用しようといくつかのエラーが表示されますが、私は自分のメソッドを使用することができました(違いについては分かりません)実装を見ることができます[ここ](http://stackoverflow.com/questions/11566964/clustering-and -bayes-classifiers-matlab)を実行します。 –