How do you classify a row of seperate cells in MATLAB?
At the moment I can classify single coloums like so:
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
Unlike the above, I want to classify:
A B C
Row A | 1 | 1 | 1 = a house
Row B | 1 | 2 | 1 = a garden
Here's a code example from the MATLAB site:
nb = NaiveBayes.fit(training, class)
nb = NaiveBayes.fit(..., 'param1', val1, 'param2', val2, ...)
I don't understand what param1
, val1
, etc. are. Can anyone help?