How to create a Target data ? Neural Network Tool

조회 수: 4 (최근 30일)
Nikolak
Nikolak 2013년 1월 30일
이동: Walter Roberson 2024년 8월 15일
Hello,
I want to make a feedforward backpropagation neural network in order to solve a classification problem.
Let's say I want to import a data set from UCI Machine Learning Repository ( this one ) which is 4x306. How do I create a Target data set in order to train it?
Thanks in advance.
  댓글 수: 2
Mrinmoyee Bhattacharya
Mrinmoyee Bhattacharya 2019년 3월 29일
이동: Walter Roberson 2024년 8월 15일
I just want to create target dataset, Is there any code? then it will be helpful for me
huda
huda 2024년 8월 15일
이동: Walter Roberson 2024년 8월 15일
neural network

댓글을 달려면 로그인하십시오.

채택된 답변

Greg Heath
Greg Heath 2013년 1월 30일
The target for 2-class classification has dimensions [1 N] (N=306) with values {0,1}. However, if the ratio of N1/N0 is not in the interval [0.5, 2 ], then randomly add duplicates of the smaller class until the class sizes are equal. Occasionally, it helps to add a small noise component to the duplicates.
Use PATTERNNET with a LOGSIG activation function and TRAINSCG training function. The corresponding output, y = net(x), is a consistent estimate of the posterior probability of the "1" class, given the input x, i.e., P(classind = 1 | x ). the corresponding class index can be obtained from round(y).
In general, for c-class classification, the target matrix has dimensions [ c N ]with columns of the c-dimensional unit matrix. The row index of the 1 is the class index for that column. The assigned class is obtained from classind = vec2ind(y) (the row of the largest value).
Hope this helps.
Thank you for formally accepting my answer.
Greg

추가 답변 (1개)

Jing
Jing 2013년 1월 30일
I guess what you ask is 'preparets' function. This function prepare data for network simulation and training. Use the following command you can find the usage and an example of this function:
doc preparets
Hope it helps!
  댓글 수: 7
Walter Roberson
Walter Roberson 2019년 3월 29일
It depends which function you are using. Some of them just want a vector of class numbers. Others want the result of calling vec2ind on the vector of class numbers.
Either way you need information about what the correct class number is for each sample.
Mrinmoyee Bhattacharya
Mrinmoyee Bhattacharya 2019년 3월 29일
I am using this function for create a target dataset:
I have imported my dataset in column vector
My dataset is showing (1x14480)
data = CP1U;
target = full(vec2ind(data))
Is this correct ?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by