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

조회 수: 1 (최근 30일)
Elysi Cochin
Elysi Cochin 2020년 12월 7일
편집: Adam Danz 2020년 12월 24일
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