1
00:00:00,240 --> 00:00:01,020
Welcome back.

2
00:00:01,290 --> 00:00:07,940
It's the last video we covered are to score and so this one we're gonna look at mean absolute era.

3
00:00:08,200 --> 00:00:09,240
Let's come down here.

4
00:00:09,450 --> 00:00:13,710
We'll create a little heading mean absolute error.

5
00:00:13,900 --> 00:00:14,990
Okay I am.

6
00:00:15,020 --> 00:00:16,600
Ay ay.

7
00:00:16,620 --> 00:00:22,820
Now again we could always look up what mean absolute error is but what we're going to do is check in

8
00:00:22,830 --> 00:00:25,410
with the code first and then we'll look into it.

9
00:00:25,410 --> 00:00:26,460
How do we calculate it.

10
00:00:26,460 --> 00:00:32,990
I mean absolute error you might be able to deduce from its name what it actually does if not.

11
00:00:32,990 --> 00:00:33,460
That's right.

12
00:00:33,460 --> 00:00:34,210
We'll look into it.

13
00:00:34,710 --> 00:00:38,220
Import mean absolute needed square.

14
00:00:38,220 --> 00:00:44,010
That's gonna be the next one to evaluate it we need to make some predictions because remember a valuation

15
00:00:44,010 --> 00:00:48,210
metrics are always comparing truth labels to predicted labels.

16
00:00:48,200 --> 00:00:54,950
So we'll predict on the test data set and go and they E equals mean absolute error.

17
00:00:55,170 --> 00:01:00,120
And we're going to compare y test which is the truth labels that we made up here.

18
00:01:00,120 --> 00:01:02,730
Why test to our predictions.

19
00:01:02,730 --> 00:01:08,400
Which is why we've just made here and then going to have a look at M.J. OK.

20
00:01:08,560 --> 00:01:12,000
That wasn't too hard but two point one too.

21
00:01:12,100 --> 00:01:13,360
What does that mean.

22
00:01:13,360 --> 00:01:21,120
Well again this might be a little bit easier to visualize so we might create a data frame side by side

23
00:01:21,130 --> 00:01:30,370
we're going to posit data equals a dictionary and we're gonna have actual values vs. what we want here

24
00:01:31,300 --> 00:01:44,350
is predicted values go y parades wonderful and then we'll have a look at f huh.

25
00:01:44,380 --> 00:01:45,670
So what do we have here.

26
00:01:46,150 --> 00:01:50,360
Well this is the truth labels and this is what our model has predicted.

27
00:01:50,860 --> 00:01:54,880
So can see twenty three point six is twenty three point 0 0 2.

28
00:01:55,020 --> 00:01:55,590
Okay.

29
00:01:55,630 --> 00:01:59,350
Thirty two point four thirty point nine point two.

30
00:01:59,350 --> 00:02:04,000
Looking at these right and then looking at this number can you think about where this number might be

31
00:02:04,000 --> 00:02:06,710
coming from.

32
00:02:06,810 --> 00:02:07,200
That's right.

33
00:02:07,200 --> 00:02:13,660
He can't what we might do is add another column that may add a little bit of clarity equals and we're

34
00:02:13,660 --> 00:02:14,940
going to do.

35
00:02:15,250 --> 00:02:19,370
Def predicted value.

36
00:02:19,390 --> 00:02:22,030
So this is this is a column we're creating for the differences right.

37
00:02:22,030 --> 00:02:27,390
So the difference between our predicted value and the actual values.

38
00:02:27,730 --> 00:02:29,340
There we go.

39
00:02:29,390 --> 00:02:30,690
We'll be IDF again.

40
00:02:30,880 --> 00:02:32,310
Differences.

41
00:02:32,340 --> 00:02:32,720
OK.

42
00:02:32,750 --> 00:02:36,300
So we see that this one is minus point six or.

43
00:02:36,520 --> 00:02:42,670
This one is minus point five and this one is three point ones was a bit off here and this one was really

44
00:02:42,670 --> 00:02:43,060
off right.

45
00:02:43,060 --> 00:02:45,250
It's minus four point eighty seven.

46
00:02:45,310 --> 00:02:45,820
Okay.

47
00:02:46,750 --> 00:02:52,570
So now you might be starting to get an idea of where mean absolute error comes from if not mean absolute

48
00:02:52,570 --> 00:02:58,870
error it's formally defined as the average of the absolute differences between predictions and actual

49
00:02:58,870 --> 00:03:02,860
values and so it gives you an idea of how wrong your predictions are.

50
00:03:02,860 --> 00:03:05,410
So what we might do is write that here.

51
00:03:05,620 --> 00:03:19,090
So amazing is the average of the absolute differences between predictions and actual values.

52
00:03:19,090 --> 00:03:29,260
It gives you an idea of how wrong your models predictions are and what it means by absolute is that

53
00:03:29,260 --> 00:03:35,110
it would turn these values positive and then add them all up and then take the main and then that's

54
00:03:35,110 --> 00:03:36,510
going to give us this number.

55
00:03:36,520 --> 00:03:43,750
So basically what this is saying is that on average every prediction our model makes is going to be

56
00:03:43,750 --> 00:03:50,190
on average plus or minus two point one two away from the actual value.

57
00:03:50,290 --> 00:03:51,910
And you can kind of see that right.

58
00:03:51,930 --> 00:03:57,640
Some are only point six six seven away but others are more than two point one.

59
00:03:57,640 --> 00:04:03,910
So this is 2.8 9 and this is negative 3 point 7 9 4 and you can keep going throughout all the 102 rows

60
00:04:03,910 --> 00:04:09,820
and figure out this figure manually or you could just take the psychic learn implementations word for

61
00:04:09,820 --> 00:04:09,910
it.

62
00:04:10,600 --> 00:04:14,190
So what we're gonna do next that's covered mean absolute error.

63
00:04:14,260 --> 00:04:16,240
We're going to have a look at Main squared error.
