chapter seven

7 Improving your company’s monthly power usage forecast

 

This chapter covers:

  • Adding additional data to your analysis
  • Using pandas to fill in missing values in your data
  • Visualizing your time-series data
  • Using a neural network to generate forecasts
  • Generating power consumption forecasts with DeepAR

In chapter 6, you worked with Kiara to develop a AWS SageMaker DeepAR model to predict power consumption across her company’s 48 sites. You had just a bit more than one year’s data for each of the sites, and you predicted the temperature for November, 2018, with an average percentage error of less that 6%. Amazing! Let’s expand on this scenario by adding additional data for our analysis and filling in any missing values. First, let’s take a deeper look at DeepAR.

7.1  DeepAR’s ability to pick up periodic events

The DeepAR algorithm was able to identify patterns such as weekly trends in our data from chapter 6. Figure 7.1 shows your predicted and actual usage for site 33 in November. This site follows a consistent weekly pattern.

Figure 7.1. Predicted versus actual consumption from site 33 using the DeepAR model you built in chapter 6
ch06_weekly_trend_site_33.png

7.2  DeepAR’s greatest strength: Incorporating related time series

7.3  Incorporating additional datasets into Kiara’s power consumption model

7.4  Getting ready to build the model

7.4.1  Download the notebook we prepared

7.4.2  Set up the folder on SageMaker

7.4.3  Upload notebook to SageMaker

7.4.4  Download the datasets from the S3 bucket

7.4.5  Set up a folder on S3 to hold your data

7.4.6  Upload the datasets to your AWS bucket

7.5  Building the model

7.5.1  Part 1: Setting up the notebook

7.5.2  Part 2: Importing the datasets

7.5.3  Part 3: Getting the data into the right shape

7.5.4  Part 4: Create training and test datasets

7.5.6  Part 6: Make predictions and plot results