Question
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?
Related Questions
Expert Answer
John Michell
PhD Expert
Answered Nov 20, 2025
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).
Have a different question? Ask here