how can i get the regression values into a variable in neural network

1 Ansicht (letzte 30 Tage)
When we fit-data-with-a-neural-network, we can get the regression graph, when we click the Regression button in the nntool window.
is it possible to get the 4 values written on the title of the graph plot into a variable?
so i can view the variable regr as below
regr = [ 0.97327 0.96889 0.94805 0.96877]

Akzeptierte Antwort

Adam Danz
Adam Danz am 17 Dez. 2020
Bearbeitet: Adam Danz am 24 Dez. 2020
After the figure is created from the nntool and is the current figure, these lines below will extract the subplot title information,
fig = gcf();
ax = findobj(fig,'Type','Axes');
titles = get(ax,'Title');
titleStr = get([titles{:}],'String');
[~, plotID] = regexp(titleStr,'^(.*):','match','tokens','once');
[~, numStrings] = regexp(titleStr,'R=(.*)$','match','tokens','once');
S = [plotID{:}] % the subplot ID
R = str2double([numStrings{:}]) % the R value
Outputs
S =
1×4 cell array
{'All'} {'Test'} {'Validation'} {'Training'}
R =
0.97891 0.96889 0.95093 0.98575

Weitere Antworten (0)

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