views:

114

answers:

2

I want to fit a function using neural networks, with 0/1 as outputs. please help me find the best way to it.

In fact I want to know the fitting function in MATLAB, specifically in the neural network toolbox. I don't know which method is good for modeling a function with binary output.

Also is there anyway in MATLAB that I can gain weights?

A: 

Usually neural networks are used for decision making, so a 0/1 answer is just what you want: a "yes" or a "no".

To actually fit the network one uses two sets that are known to produce a "yes" and "no" answer. Then one calculates the rates of Type I and Type II errors (often called purity and 1-efficiency) as a function of the network parameters.

These functions have values between 0 and 1. The goal of the fit is to find a set of network parameters which produce an acceptable balance between Type I and Type II errors while making them both as small as possible.

honk
+2  A: 

If you have a binary classification task (0/1 output), then you can train a NN with two output nodes, one per class, and the trick is to use a logistic function on the output node so that that its always in the range [0,1] (this is the default if you use NEWPR function). It can be interpreted as a probability, then you can use the default value 0.5 as threshold or maybe use ROC curves to find a better threshold for your case.

Please see this post for a simple example in MATLAB of learning the XOR binary operator.

Amro