"Hao " <weihao.hello@gmail.com> wrote in message <k65ufb$s1f$1@newscl01ah.mathworks.com>...
> Hello everyone,
>
> I am using Neural Network toolbox to do pattern recognition, but now I have a problem. I have already trained the neural network. To do the pattern recognition, I will test the network. I have a set of 100 testing samples of 4 classes, each of which has the format as follows:
>
> feature set: feature 1, feature 2,feature 3,feature 4,feature 5,.................
> target: 1 0 0 0 (for example)
No.
The inputs and targets are column vectors.
The target vectors are columns of eye(4). For example.
t = ind2vec( [ 1 2 3 4 3 2 1 ])
The output vectors will be columns of y = t + error
The assigned classes are obtained from
classes = vec2ind(y)
> that is to say, the input of the network is the feature set, and the output should have 4 binary values, only one of which is 1, in order to predict the specified class.
>
> However, the actual output of the network is usually like:
> 0.9844, 0.0000, 0.2311, 0.085
>
> In this case, how can I convert the output into binary values? How can I decide which class does this sample belong to?
class = vec2ind( [0.9844, 0.0000, 0.2311, 0.085]') % Note the transpose
Hope this helps.
Greg
> Hello everyone,
>
> I am using Neural Network toolbox to do pattern recognition, but now I have a problem. I have already trained the neural network. To do the pattern recognition, I will test the network. I have a set of 100 testing samples of 4 classes, each of which has the format as follows:
>
> feature set: feature 1, feature 2,feature 3,feature 4,feature 5,.................
> target: 1 0 0 0 (for example)
No.
The inputs and targets are column vectors.
The target vectors are columns of eye(4). For example.
t = ind2vec( [ 1 2 3 4 3 2 1 ])
The output vectors will be columns of y = t + error
The assigned classes are obtained from
classes = vec2ind(y)
> that is to say, the input of the network is the feature set, and the output should have 4 binary values, only one of which is 1, in order to predict the specified class.
>
> However, the actual output of the network is usually like:
> 0.9844, 0.0000, 0.2311, 0.085
>
> In this case, how can I convert the output into binary values? How can I decide which class does this sample belong to?
class = vec2ind( [0.9844, 0.0000, 0.2311, 0.085]') % Note the transpose
Hope this helps.
Greg