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

4 vues (au cours des 30 derniers jours)
Elysi Cochin
Elysi Cochin le 7 Déc 2020
Modifié(e) : Adam Danz le 24 Déc 2020
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]

Réponse acceptée

Adam Danz
Adam Danz le 17 Déc 2020
Modifié(e) : Adam Danz le 24 Déc 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

Plus de réponses (0)

Catégories

En savoir plus sur Sequence and Numeric Feature Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by