2.5. Time Series Plots#

Learning Outcome

Students will be able to develop an analytic model and trendline for a time series, and then predict the last n-tile of data in order to evaluate the effectiveness of their model.

Sample Tasks

  • Avoid extrapolation

    • Build a model using a weather data set from 1900 to present.

    • Create a scatter plot using rain data and add a trendline.

    • Predict rainfall 1 week and 1 month into future.

    • Verify the accuracy of your model using the actual rainfall.

    • Add the updated data to your chart, and check to see if it falls within a standard deviation of the prediction.

    • Discuss why the prediction for 1 week was more accurate than for 1 month.

[OhioDoHEducation21]

The term time series simply means data where time is taken as the independent variable. It gets its own name because using data collected over time to predict the future is such an important application.

Our first reading, from Learning Data Science [LGN23], discusses using line plots to visualize time series.

Reading Question

  • In the housing market crash, which percentile of houses did the worst ?

Our second reading, from the Python Data Science Handbook [Van16], first discusses tools within the pandas library for manipulating times, and then discussed the techniques of resampling, shifting, and windowing to make visualizations of time-series easier to understand.

Reading Question

  • When should one apply a rolling window to a time series?

Further Resources

See Section 2.1 for information on plotting with Matplotlib and Seaborn.