How to train neural networks for regression when the response variable is a vector

10 Ansichten (letzte 30 Tage)
I am training to figure out how to train neural networks for regression when the response variable is a vector.
For example, I want my input X to be of the form
X = [ 1 3 4 5 9 ;
2 3 4 5 7;
1 2 3 4 3]
For each input vector I want to have a vector response veraible. For example,
Y = [ 1 2;
3 4;
5 6]
Here reponse [1 2] corresponds to input [ 1 3 4 5 9 ] and so on.
MATLAB has very good description of how to work with the case when Y is collection of scarlars. In particular, there is a good example of how to use fitrnet here: https://www.mathworks.com/help/stats/fitrnet.html
However, I couldn't find example of how to do it for multivariate regession.

Antworten (1)

Abhishek
Abhishek am 15 Mai 2023
Hi Alex,
I understand that you're trying to design a neural network for multivariate regression. To train a neural network for regression when the response variable is a vector, one option could be to use a multi-output neural network.
In such a neural network, the output layer contains multiple nodes, with each node corresponding to one element in the response vector. Specifically, in the example you posted, a two-output neural network would be needed to correspond to the two elements in the response vector.
Also, if type of model is not a constraint, I also suggest you to try 'mvregress' function in MATLAB for multivariate linear regression where the response variable is a vector.
To use mvregress, you can simply input your design matrix (predictors) X and the response matrix (multivariate outcomes) Y. To know more about the function, refer to this documentation: Multivariate linear regression - MATLAB mvregress (mathworks.com)

Community Treasure Hunt

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

Start Hunting!

Translated by