3 Implementing a nowcasting model

 

This chapter covers

  • Offline versus online forecasting
  • Building a real-time nowcasting model from scratch
  • Exploratory data analysis and feature selection on time series data
  • Training online models with real-time data
  • Computing real-time metrics to measure the performance of online models

Forecasting is a process used to predict future state or conditions based on historical data. Traditionally, this is done by discovering past trends and patterns in the data and projecting those trends into the future. For example, a clothing retailer may train a machine learning model on sales for previous months for different products to determine how much inventory to order for next month. They may also incorporate seasonal patterns learned from historical data, for example the demand for warmer clothes increasing during the winter months.

Forecasting models work well if these patterns and trends are fairly stable. However, as discussed in Chapter 1, real-world distributions can be non-stationary, causing predictive models to lose accuracy over time. Certain problem domains such as the weather and financial markets are highly volatile, so making accurate predictions several days or months into the future is very difficult.

3.1 Coding a nowcasting model

3.1.1 Offline forecasting

3.1.2 Building an online forecasting model

3.2 Building a production real-time machine learning application

3.2.1 River: a real-time machine learning library

3.2.2 Collecting data from event streams for exploratory data analysis and feature selection

3.2.3 Integrating an online nowcasting model

3.3 Adding an evaluation module

3.3.1 Updating the OnlineRegressor class to publish data to a new event stream

3.3.2 Create a subscriber for model evaluation

3.3.3 From experimentation to a production event-driven system

3.4 Summary