Seasonal decomposition
In the last exercise, you identified some repetitive patterns in the traffic data with both visual inspection and using an autocorrelation plot.
You'll now dissect this data further by splitting it into it's components.
The data has been loaded for you into traffic
.
This exercise is part of the course
Analyzing IoT Data in Python
Exercise instructions
- Import
statsmodels.api
assm
. - Perform seasonal decomposition on the time series
"vehicles"
column from the DataFrametraffic
and assign the result tores
. - Print the seasonal component to screen.
- Plot the time series decomposition result.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Import modules
____
# Perform decompositon
res = sm.tsa.____(____[____])
# Print the seasonal component
____
# Plot the result
____
# Show the plot
plt.show()