RMSE of sequences in cell arrays with different length
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
In the Sequence-to-Sequence Regression Using Deep Learning example the rmse is caclulated this way
for i = 1:numel(YTest)
YTestLast(i) = YTest{i}(end);
YPredLast(i) = YPred{i}(end);
end
figure
rmse = sqrt(mean((YPredLast - YTestLast).^2))
in this case we are interested only on the last element so YPredLast - YTestLast is one to one element substraction
IN the general case that i am interested on the whole output sequence, what will be the substraction??
YTest - Ypred cannot be performed as these are cell arrays.
how can we calculate the rmse from the whole sequencies?
2 Commenti
madhan ravi
il 3 Apr 2019
Modificato: madhan ravi
il 3 Apr 2019
You use (i) and you say it’s a cell array ?? No sign of pre-allocation whatsoever.
Risposte (1)
Star Strider
il 19 Apr 2019
I am not certain what final result you want.
This should get you started:
subt = cellfun(@minus, YTest, YPred, 'Uni',0); % Vector Differences
RMSE = cellfun(@(x)sqrt(mean(x.^2)), subt, 'Uni',0); % RMSE Of Vector Differences
You can use the cell2mat function to convert the ‘RMSE’ vector to a double vector, and then do any other necessary calculations on it.
Experiment to get the result you want.
0 Commenti
Vedere anche
Categorie
Scopri di più su Get Started with Statistics and Machine Learning Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!