Visualizations

To actually visualize the average sales volumes over the 4-year series, the plot command is used:

y.plot(figsize=(15, 6))
plt.show()

This results in the following visualization, shown here executed in Watson Studio:

When you plot or otherwise visualize data, it is much easier to recognize patterns. In this example, the data scientist pointed out a pattern commonly identified as seasonality. The data scientist then goes a step further and performs a time series decomposition, breaking out trend, seasonality, and noise, using the following commands:

from pylab import rcParams
rcParams['figure.figsize'] = 18, 8
decomposition = sm.tsa.seasonal_decompose(y, model='additive')
fig = decomposition.plot()
plt.show()

And again, as executed in Watson Studio, we have the following:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset