February 2020
Intermediate to advanced
328 pages
8h 19m
English
For this recipe, we need to analyze the trend of the data prior to building the model.
First, let's import the keras library:
library(keras)
In this recipe, we will use the shampoo sales data, which can be downloaded from this book's GitHub repository. This dataset contains the monthly sales of shampoo over a 3-year period and consists of 36 rows. The original dataset is credited to Makridakis, Wheelwright, and Hyndman (1998):
data = read.table("data/shampoo_sales.txt",sep = ',')data <- data[-1,]rownames(data) <- 1:nrow(data)colnames(data) <- c("Year_Month","Sales")head(data)
The following screenshot shows a few records from the data:
Let's analyze the trend in the Sales column of the data:
# Draw a line plot to show the trend ...
Read now
Unlock full access