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

1 次查看(过去 30 天)
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]

采纳的回答

Adam Danz
Adam Danz 2020-12-17
编辑:Adam Danz 2020-12-24
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by