1
00:00:00,000 --> 00:00:02,520
Welcome to this course on
sequences and prediction,

2
00:00:02,520 --> 00:00:05,460
a part of the TensorFlow in
practice specialization.

3
00:00:05,460 --> 00:00:08,370
In this course, we'll
focus on time series,

4
00:00:08,370 --> 00:00:10,110
where you'll learn about
different types of

5
00:00:10,110 --> 00:00:11,730
time series before we go

6
00:00:11,730 --> 00:00:14,205
deeper into using
time series data.

7
00:00:14,205 --> 00:00:17,475
This week, you'll focus on
time series themselves.

8
00:00:17,475 --> 00:00:19,070
We'll go through some examples of

9
00:00:19,070 --> 00:00:20,870
different types of time series,

10
00:00:20,870 --> 00:00:23,960
as well as looking at basic
forecasting around them.

11
00:00:23,960 --> 00:00:25,820
You'll also start preparing

12
00:00:25,820 --> 00:00:28,745
time series data for machine
learning algorithms.

13
00:00:28,745 --> 00:00:30,230
For example, how do you split

14
00:00:30,230 --> 00:00:32,090
time series data into training,

15
00:00:32,090 --> 00:00:34,025
validation, and testing sets?

16
00:00:34,025 --> 00:00:36,050
We'll explore
some best practices and

17
00:00:36,050 --> 00:00:38,685
tools around that to get
you ready for week 2,

18
00:00:38,685 --> 00:00:39,815
where you'll start looking at

19
00:00:39,815 --> 00:00:41,860
forecasting using a dense model,

20
00:00:41,860 --> 00:00:43,130
and how it differs from

21
00:00:43,130 --> 00:00:45,170
more naive predictions based

22
00:00:45,170 --> 00:00:47,885
on simple numerical
analysis of the data.

23
00:00:47,885 --> 00:00:50,060
In week 3, we'll get into using

24
00:00:50,060 --> 00:00:52,970
recurrent neural networks
to forecast time series.

25
00:00:52,970 --> 00:00:55,460
We'll see the stateless
and stateful approaches,

26
00:00:55,460 --> 00:00:57,005
training on windows of data,

27
00:00:57,005 --> 00:01:00,145
and you'll also get hands-on
in forecasting for yourself.

28
00:01:00,145 --> 00:01:02,215
Finally, in week 4,

29
00:01:02,215 --> 00:01:03,470
you'll add convolutions to

30
00:01:03,470 --> 00:01:05,390
the mix and put
everything you've worked

31
00:01:05,390 --> 00:01:08,795
on together to start forecasting
some real world data,

32
00:01:08,795 --> 00:01:11,015
and that's measurements
of sunspot activity

33
00:01:11,015 --> 00:01:13,535
over the last 250 years.

34
00:01:13,535 --> 00:01:16,655
So let's get started with
a look at time series,

35
00:01:16,655 --> 00:01:17,930
what they are, and

36
00:01:17,930 --> 00:01:20,240
the different types of them
that you may encounter.

37
00:01:20,240 --> 00:01:22,220
Time series are everywhere.

38
00:01:22,220 --> 00:01:25,655
You may have seen
them in stock prices,

39
00:01:25,655 --> 00:01:28,770
weather forecasts,
historical trends,

40
00:01:28,770 --> 00:01:30,120
such as Moore's law.

41
00:01:30,120 --> 00:01:31,700
Here, I've plotted the number of

42
00:01:31,700 --> 00:01:33,950
transistors per
square millimeter,

43
00:01:33,950 --> 00:01:36,410
where I grouped
chip releases by year,

44
00:01:36,410 --> 00:01:38,420
and then drew
the Moore's law trend line

45
00:01:38,420 --> 00:01:39,955
from the first data item,

46
00:01:39,955 --> 00:01:41,910
where you can see a correlation.

47
00:01:41,910 --> 00:01:44,450
If you want some really
fun correlations,

48
00:01:44,450 --> 00:01:46,640
here's one from
Tyler Vigen's site

49
00:01:46,640 --> 00:01:48,530
of Spurious Correlations.

50
00:01:48,530 --> 00:01:50,600
This one is a time
series correlation

51
00:01:50,600 --> 00:01:52,610
of total revenue generated by

52
00:01:52,610 --> 00:01:54,590
video game arcades versus

53
00:01:54,590 --> 00:01:58,355
computer science doctorates
awarded in the United States.

54
00:01:58,355 --> 00:02:01,129
While all of these
are quite familiar,

55
00:02:01,129 --> 00:02:02,285
they begged the question,

56
00:02:02,285 --> 00:02:04,325
what exactly is a time series?

57
00:02:04,325 --> 00:02:06,920
It's typically defined as
an ordered sequence of

58
00:02:06,920 --> 00:02:10,490
values that are usually
equally spaced over time.

59
00:02:10,490 --> 00:02:12,650
So for example, every year in

60
00:02:12,650 --> 00:02:14,210
my Moore's law charts or

61
00:02:14,210 --> 00:02:16,235
every day in
the weather forecast.

62
00:02:16,235 --> 00:02:17,959
In each of these examples,

63
00:02:17,959 --> 00:02:19,920
there is a single value
at each time step,

64
00:02:19,920 --> 00:02:22,445
and as a results,
the term univariate

65
00:02:22,445 --> 00:02:24,400
is used to describe them.

66
00:02:24,400 --> 00:02:27,230
You may also encounter
time series that

67
00:02:27,230 --> 00:02:29,555
have multiple values
at each time step.

68
00:02:29,555 --> 00:02:30,800
As you might expect,

69
00:02:30,800 --> 00:02:33,895
they're called
Multivariate Time Series.

70
00:02:33,895 --> 00:02:36,830
Multivariate Time Series
charts can be

71
00:02:36,830 --> 00:02:40,250
useful ways of understanding
the impact of related data.

72
00:02:40,250 --> 00:02:43,490
For example, consider
this chart of births versus

73
00:02:43,490 --> 00:02:47,450
deaths in Japan
from 1950 to 2008.

74
00:02:47,450 --> 00:02:49,920
It clearly shows
the two converging,

75
00:02:49,920 --> 00:02:51,870
but then deaths begin to outstrip

76
00:02:51,870 --> 00:02:54,320
births leading to
a population decline.

77
00:02:54,320 --> 00:02:56,480
Now, while they
could be treated as

78
00:02:56,480 --> 00:02:59,180
two separate univariate
time series,

79
00:02:59,180 --> 00:03:00,860
the real value of
the data becomes

80
00:03:00,860 --> 00:03:04,820
apparent when we show them
together as a multivariate.

81
00:03:04,820 --> 00:03:07,160
Also consider this chart showing

82
00:03:07,160 --> 00:03:10,340
the global temperature
against CO2 concentration.

83
00:03:10,340 --> 00:03:12,110
As univariates, they would show

84
00:03:12,110 --> 00:03:14,245
a trend, but when combined,

85
00:03:14,245 --> 00:03:15,740
the correlation is very easy to

86
00:03:15,740 --> 00:03:18,920
see adding further value
to the data.

87
00:03:18,920 --> 00:03:22,955
Movement of a body can also
be plotted as a series

88
00:03:22,955 --> 00:03:26,695
of univariates or as
a combined multivariate.

89
00:03:26,695 --> 00:03:30,290
Consider, for example, the path
of a car as it travels.

90
00:03:30,290 --> 00:03:32,090
A time step zero is at

91
00:03:32,090 --> 00:03:34,205
a particular latitude
and longitude.

92
00:03:34,205 --> 00:03:35,990
As subsequent time steps,

93
00:03:35,990 --> 00:03:39,395
these values changed based
on the path of the car.

94
00:03:39,395 --> 00:03:41,770
The acceleration of
the car, in other words,

95
00:03:41,770 --> 00:03:43,985
it's not moving at
a constant speed,

96
00:03:43,985 --> 00:03:45,830
means that the spaces between

97
00:03:45,830 --> 00:03:48,185
the time steps also
change in size,

98
00:03:48,185 --> 00:03:50,435
in this case getting larger.

99
00:03:50,435 --> 00:03:52,550
But what if we were to plot

100
00:03:52,550 --> 00:03:54,935
the direction of
the car as univariates.

101
00:03:54,935 --> 00:03:56,900
Based on its heading,
we could see that

102
00:03:56,900 --> 00:03:59,390
the longitude of the car
decreases over time,

103
00:03:59,390 --> 00:04:01,415
but its latitude increases,

104
00:04:01,415 --> 00:04:04,290
and as such you will
get charts like these.