How to set multiple output in fitrnet function?
6 views (last 30 days)
Show older comments
Hello, I tried to use fitrnet cuntion in R2021a. It works well when I set only one output. But if the output data is 2D vector, error occurs. The raw code is following:
load carbig
X = [Acceleration Cylinders Displacement Horsepower Model_Year];
Y = [MPG Weight];
rng("default") % For reproducibility of the partition
c = cvpartition(length(Y),"Holdout",0.20);
trainingIdx = training(c); % Indices for the training set
XTrain = X(trainingIdx,:);
YTrain = Y(trainingIdx,:);
testIdx = test(c); % Indices for the test set
XTest = X(testIdx,:);
YTest = Y(testIdx,:);
Mdl = fitrnet(XTrain,YTrain,"Standardize",true, ...
"LayerSizes",[30 10])
I can set two output using newff function in previous version. How can I deal with it? Thanks
2 Comments
dpb
on 23 Jul 2021
I don't have the subject TB but there's no indication in present documentation of the regression net fitrnet being anything but a single response variable model
A search of current documentation didn't find any such function as newff that would do any such thing, either.
Which release and toolbox contained the function -- you sure you weren't using something from FEX or from some other source?
Answers (0)
See Also
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!