Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!news2.glorb.com!postnews.google.com!e18g2000yqo.googlegroups.com!not-for-mail
From: Greg Heath <heath@alumni.brown.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to set Target vector in Neural Network?
Date: Mon, 2 Mar 2009 18:42:21 -0800 (PST)
Organization: http://groups.google.com
Lines: 51
Message-ID: <a998d9a8-b285-488d-8dc7-8a13a38d1d20@e18g2000yqo.googlegroups.com>
References: <gohugi$gsl$1@fred.mathworks.com>
NNTP-Posting-Host: 68.39.98.10
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1236048141 7334 127.0.0.1 (3 Mar 2009 02:42:21 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 3 Mar 2009 02:42:21 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: e18g2000yqo.googlegroups.com; posting-host=68.39.98.10; 
	posting-account=mUealwkAAACvQrLWvunjg50tRAnsNtJR
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB5; 
	Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; 
	.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; Seekmo 10.0.341.0),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:522014


On Mar 2, 7:44 pm, "Tak " <lauho...@hotmail.com> wrote:
> Now I have 50 images and they are decomposed into 5 input vectors for each. Which means now I have 5 x50 array.

How do you represent an image with only 5 values?
The smallest images I have encountered are 3 X 5
binary images of integers. Therefore each image
is represented by 15 values, i.e., a 15-dimensional
input vector. The resulting dimensionality of a data
containing 50 images would be 15 X 50.

What kind of images do you have and what do the
5 values represent?

If 40 images belongs into one class and 10 belongs to another. What
should I do in the Target Class value? Should the Target vector 1
dimensional or 2 dimensional array?

For two classes one output is typical. The target
values are unipolar binary with values from {0,1}.
For more classes use one output for each class.

> And How can I know the accuracy from the performance chart?

You need an independent nontraining set to obtain
an unbiased estimate of generalization error.

Use 10-fold cross-validation:

1. Randomly partition Class 0 into 10 subsets of 4 images
   each and partition Class 1 into 10 subsets of 1 image
   each.
2. Form a 10 subset mixture with each subset containing
   4 Class 0 images and 1 Class 1 image.
3. Repeat the following steps 10 times
   a. Use one of the subsets as a test set to
      obtain an unbiased estimate of generalization
      error.
   b. Use the other 9 subsets to form a training set.
   c. To avoid biasing caused by the unbalanced
      composition of the training set, add 4
      duplicates of each Class 1 case so that
      the training set contains 36 cases from each
      class.
    d. Train a net using the training set and estimate
      the error using the test set.
4. Obtain the average and standard deviation of the
   10 error estimates obtained in 3d.

Hope this helps.

Greg