Path: news.mathworks.com!not-for-mail
From: "ade77 " <ade100a@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Pattern Classification using Neural Network ( newff)
Date: Tue, 3 Nov 2009 03:08:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <hco6qi$kio$1@fred.mathworks.com>
References: <hco1vf$ndj$1@fred.mathworks.com>
Reply-To: "ade77 " <ade100a@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257217682 21080 172.30.248.38 (3 Nov 2009 03:08:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 03:08:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1059495
Xref: news.mathworks.com comp.soft-sys.matlab:581951


I did exactly the same project last year. Your code seems correct. I will assume the following based on the description of the problem:

1. You have 20 rows of input features.
2. You need to classify the problem into 4 possible outcomes.
unless you need to pass the weights into another program, the codes you have written:
 W = net.IW{1};
> V = net.LW{2};
> 
> W =W';
> V = V'
is completely unnecessay, since MATLAB will stote the weights in the network(net).

Back to the problem, once you have the network trained, all you have to do is test the network.

test = sim(net,new_input).
The trick here is that your output will produce 4 elements, the one that is closest to 1 is your classification.

For example if your classification is [red green blue orange], and you get 
[1.2  2.4  5.6  3] , then red is your classification. because 1.2 is closest to 1

In most cases, you will get negative, you need to decide based on your input features, if you will use absoulte values. For example, 
test = sim(net, new_inputs) gives [0.7  1.5  -0.8  3.2], if you take absolute value, then -0.8 is closest to 1, hence blue is your classification.

Finally, I have assumed that you correctly put the inputs and outputs in your training, and you normalize the inputs.

if you are still confused, feel free to let me know

One last thing, you can just let MATLAB use its default parameters, and all you need to change is the number of neurons, and try 2 or more hidden layers, since your input features are many.