MATLAB Answers

0

bias and variance of trained neural network

Asked by Mohamad on 1 Dec 2013
Latest activity Commented on by Muhammad Adil Raja on 8 Dec 2018 at 21:20
Hello How can we save the bias and variance of a trained network? thank you in advance

  0 Comments

Sign in to comment.

2 Answers

Answer by Greg Heath
on 2 Dec 2013
 Accepted Answer

[x,t] = simplefit_dataset;
net = fitnet(4);
rng(0)
[ net tr y e ] = train(net,x,t);
biaserr = mean(e(:))
varerr = var(e(:))
HTH
Thank you for formally accepting my answer
Greg

  2 Comments

hi Greg, how can I calculate bias and variance if I have mean square error ? or i must have err=Targets-predictions
Hi Greg, I really like this definition of variance as it is calculated over the error and not on the model output alone. However, is there a reference to back it up? Normally the variance is defined as the variance of the model output, which rather sounds non-sensible to me.
Moreover, how to compute these values if I am using fitnet for MIMO (multiple input or multiple output) problems or while using ensembles?
Best,
MA

Sign in to comment.


Answer by Mohamad on 2 Dec 2013

Greg Thank you very much.

  0 Comments

Sign in to comment.