Filter löschen
Filter löschen

Developing a neural network using data from a one column matrix containing 6606 entries

2 Ansichten (letzte 30 Tage)
I am creating a neural network, but I am unsure how to train my network using the one column matrix. How would I approach this?

Antworten (1)

Ayush Anand
Ayush Anand am 21 Nov. 2023
Hi Jorge,
I understand that you have a one column matrix, and you want to know how to train a neural network on the same. Neural networks usually take inputs in the form of a N*M matrix, where the number of rows N is the number of data samples we have with us and M is the number of features we have for each sample.
If you have just one column, this means the data you have just one feature, or in other words its simply the data values available to us. You can train a neural network on this in the exact same way as you would on an input data of any shape, and MATLAB will treat it the same way. Here is an example to show how it works:
x= rand (1,6606) * pi/2 ; %Generate 6606 random values between 0 and pi/2
y=sin(x); %This is the target function
net=feedforwardnet (); %Defining the neural network; we can specify the number of hidden layers we want in the arguments
net = train(net, x, y); %Training the model
predictedOutput= net([pi/2]); %Making predictions on a sample
In the above example, a matrix containing just one column of 6606 random numbers (similar to the case you have) between 0 and pi/2 is passed to the neural network as the input layer. The neural network uses this to train and fit the given target vector and produces an output which resembles the sine function when used for predictions.
You can read more about neural networks here:
I hope this helps!

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by