[Script Info]
Title:
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.38,0:00:01.96,Default,,0000,0000,0000,,So let's do it. Let's calculate mean
Dialogue: 0,0:00:01.96,0:00:04.32,Default,,0000,0000,0000,,and standard deviation. And to do that, let's
Dialogue: 0,0:00:04.32,0:00:08.43,Default,,0000,0000,0000,,think back to our example with stores and
Dialogue: 0,0:00:08.43,0:00:11.49,Default,,0000,0000,0000,,sales. And let's say the question we want to
Dialogue: 0,0:00:11.49,0:00:15.43,Default,,0000,0000,0000,,answer is, is there any correlation between the
Dialogue: 0,0:00:15.43,0:00:18.41,Default,,0000,0000,0000,,day of the week and how much money
Dialogue: 0,0:00:18.41,0:00:22.41,Default,,0000,0000,0000,,people spend on various items? And what's interesting
Dialogue: 0,0:00:22.41,0:00:25.40,Default,,0000,0000,0000,,about this design pattern is that all the
Dialogue: 0,0:00:25.40,0:00:31.21,Default,,0000,0000,0000,,mapper has to do is, I'll put the day of the week as a key, so maybe Monday, and
Dialogue: 0,0:00:31.21,0:00:35.06,Default,,0000,0000,0000,,the value of a sale, maybe $5.20 as a value.
Dialogue: 0,0:00:35.06,0:00:38.50,Default,,0000,0000,0000,,That's it. What does that leave for the reducer? Well,
Dialogue: 0,0:00:38.50,0:00:41.57,Default,,0000,0000,0000,,it leaves all the math for the reducer. And the
Dialogue: 0,0:00:41.57,0:00:43.85,Default,,0000,0000,0000,,general reason for this rule of thumb, for what the
Dialogue: 0,0:00:43.85,0:00:45.99,Default,,0000,0000,0000,,mapper and reducer are doing, comes from the fact that
Dialogue: 0,0:00:45.99,0:00:50.54,Default,,0000,0000,0000,,oftentimes with these, with these summary statistics, you sort of need
Dialogue: 0,0:00:50.54,0:00:53.18,Default,,0000,0000,0000,,to know all of the statistics or all of
Dialogue: 0,0:00:53.18,0:00:56.11,Default,,0000,0000,0000,,the parent data before you can make any calculations. So
Dialogue: 0,0:00:56.11,0:00:58.23,Default,,0000,0000,0000,,we don't want to jump the gun and have the mapper
Dialogue: 0,0:00:58.23,0:01:01.03,Default,,0000,0000,0000,,do calculations before it's ready. So why don't you go
Dialogue: 0,0:01:01.03,0:01:04.31,Default,,0000,0000,0000,,ahead and calculate the mean and standard deviation for
Dialogue: 0,0:01:04.31,0:01:07.05,Default,,0000,0000,0000,,sales for each day of the week, to help us
Dialogue: 0,0:01:07.05,0:01:10.59,Default,,0000,0000,0000,,try to answer this question. If there's any correlation between
Dialogue: 0,0:01:10.59,0:01:12.78,Default,,0000,0000,0000,,the day of the week and how much people spend.