From the course: Practical Python for Time Series Analysis
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Reduce granularity with resample - Python Tutorial
From the course: Practical Python for Time Series Analysis
Reduce granularity with resample
- [Instructor] Now, by applying the granularity reducing technique, by aggregating the values, we even get higher R squared, a bit higher, but still improving. 75% and 80%. How did we get there? Basically, if we go at reducing the granularity, we observed that the date periods in the frequency goes in between 10 days. However, in the discretize temporal column, the previous we had by seven days. These results in fever data points, we had 121. And when reduced the granularity, we have 86 rows. Since we have the date as the index, we can use the resample function, which is asking for a rule. And the rule is by how many days, hours we want to aggregate? We will specify by 10 days. And we will apply aggregations, such that for the CPI, we get the average. Now, for the mortgage rates, we also get the average. And, finally, for the period, we shall get the last between the selected in that 10 days range. We…