Page 134 - Artificial Intellegence_v2.0_Class_12
P. 134
p
y – y )
i
i
MSE i=i
n
MSE will never be negative because the errors are always squared.
A dvantag e
is useful for ensuring that our trained model does not have any outlier predictions ith significant errors because
places a higher eight on these errors due to the squaring element of the function.
Disadvantag e
If our model makes a single particularly incorrect forecast, the squaring part of the function multiplies the error. o ever,
in many real life cases, e don't orry about these outliers and instead seek a more fully rounded model that performs
ell enough on ma ority of cases.
Experiential Learning
Video Session
can the code or visit the follo ing link to atch the video ean quared rror
https .youtube.com atch v h ma
After atching the video, ans er the follo ing question
hat do you mean by
or calculating in ython, the mean squared error function gives the ean squared error regression loss.
f r om sk lear n.metr ics imp or t mean_ sq u ar ed _ er r or
y _ tr u e = [ 3 , 0 .5 , , .2 ] list of actual values
2
-
7
y _ p r ed = [ 2 .5 , .0 , .3 , ] list of predicted values
0
8
2
p r int( " M SE v alu e= " , mean_ sq u ar ed _ er r or ( y _ tr u e, y _ p r ed ) ) returns value
sing nested lists
y _ tr u e = [ [ 0 .5 , ] , [ - 1 , ] , [ 7 , 5 ] ]
-
0
1
-
1
y _ p r ed = [ [ 0 , ] , [ - 1 , .5 ] , [ 8 , 5 .5 ] ]
2
p r int( " M SE v alu e= " , mean_ sq u ar ed _ er r or ( y _ tr u e, y _ p r ed ) )
Output:
value .
value .
R MS E ( R oot Mean S q uar e Er r or )
he oot ean quare rror ) is a metric for determining ho ell a regression line fits the data points.
can also be understood as the standard deviation in the residuals. ecall that the residual is the difference bet een the
predicted value and observed value in the egression ine.
Touchpad Artificial Intelligence (Ver. 2.0)-XII

