始める無料で始める

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.

この演習はコースの一部です

Analyzing IoT Data in Python

コースを見る

演習の手順

  • Import statsmodels.api as sm.
  • Perform seasonal decomposition on the time series "vehicles" column from the DataFrame traffic and assign the result to res.
  • Print the seasonal component to screen.
  • Plot the time series decomposition result.

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

# Import modules
____

# Perform decompositon 
res = sm.tsa.____(____[____])

# Print the seasonal component
____

# Plot the result
____

# Show the plot
plt.show()
コードを編集して実行