Skip to Main Content
Hands-On Artificial Intelligence on Amazon Web Services
book

Hands-On Artificial Intelligence on Amazon Web Services

by Subhashini Tripuraneni, Charles Song
October 2019
Intermediate to advanced content levelIntermediate to advanced
426 pages
10h 8m
English
Packt Publishing
Content preview from Hands-On Artificial Intelligence on Amazon Web Services

Training DeepAR

In this section, we will fit DeepAR to the weekly sales. Let's start by preparing training and test datasets in JSON format.

Let's have a look at the following code, which demonstrates the creation of json lines:

import deepar as datrain_key      = 'deepar_sales_training.json'test_key       = 'deepar_sales_test.json'#Prediction and context length for training the DeepAR modelprediction_length = 9salesfn = 'data/store20_sales.csv'salesdf = da.retailsales.prepareSalesData(salesfn)testSet = da.retailsales.getTestSales(salesdf, test_key)trainingSet = da.retailsales.getTrainSales(salesdf, train_key, prediction_length)

In the preceding code block, we have created JSON lines for training and testing the datasets:

  • The prepareSalesData() function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Artificial Intelligence for IoT Cookbook

Artificial Intelligence for IoT Cookbook

Michael Roshak

Publisher Resources

ISBN: 9781789534146Supplemental Content