Win $20,000. Help build the future of education. Answer the call. Learn more

Build a time-series model to see price changes at a retail store

Time series analysis includes methods for analyzing time series data in order to extract meaningful statistics and other characteristics of the data. Time series allows you to analyze major patterns related to trends, seasonality, cyclicity, and irregularity. With time-series forecasting, you can use a model to predict future values based on previously observed values. Time series are widely used for non-stationary data, like economic, weather, stock price, and retail sales.

This tutorial demonstrates how to quickly build a time-series model using the Findability Platform Predict Plus operator from Red Hat Marketplace using a dataset that shows the how the prices differ over a period of time at a particular retail store outlet.

Learning objectives

  • Use the Findability Platform Predict Plus from Red Hat Marketplace
  • Set up a time-series model on Findability Platform Predict Plus
  • Learn how to configure the training and forecast parameters
  • View and analyze the time-series results

Prerequisites

To complete the steps in this tutorial, you need to install the FP Predict + operator from Red Hat Marketplace. Please refer to the tutorial Get started with Findability Predict Plus on Red Hat Marketplace for instructions.

Estimated time

Completing this tutorial should take about 40 minutes.

Steps to build the time series model

Step 1. Create a new time-series job

  1. Log in to your FP Predict + Operator instance.

    alt

  2. Click on + Start button

    alt

  3. A prompt will pop up asking if your data contains a time stamp. Select Yes.

    alt

  4. Another prompt will pop up asking if you will be predicting values. Select Yes.

    alt

Step 2. Configure the time-series model

  1. To configure the time-series model for this tutorial, we created two sample CSV files for you to work with. You will need to download them before you can start.

  2. Enter the details as follows:

    1. For Job Name, enter TS. (Avoid special characters in the name)
    2. Set the Dataset location to be local.
    3. For Daily Interval, set as Daily.
    4. For Tasks, select Model + Forecast.
    5. For the training file, upload the file from the downloaded train.csv. file.
    6. Set the Target Variable as item_price.

      alt

    7. Upload the forecast file from the downloaded file sales_test.csv.

    8. Set the Timestamp variable as date.
    9. Set the Timestamp Format as dd/mm/yyyy.
    10. Select Run.

    alt

Note: It will take about 10 minutes to set up the model, please wait and don’t refresh the page until it’s over.

Step 3. Analyze your output

After the model is set up completely, you will receive an output like the graph below that shows the time-series of prices over the time period 2013 to 2015:

![](https://developer.ibm.com/developer/default/tutorials/build-a-time-series-model-findability-predict-plus/images/output.png)

Select the Analytics icon to analyze your results.

alt

Analysis description

  1. The first table on the top left corner depicts the actual vs. predicted time intervals and the difference in prediction for each time interval. Note that it provides only the head values of the result table.
  2. The graph on the top right represents the same output as received on the dashboard.
  3. The Modeling Metrics and Forecast Metrics provides measures of the trained model using techniques such as Mean Error, Root Mean Square, Mean Percentage Error, Mean Absolute Percentage Error ,and Mean Absolute Scaled Error. These measures allow you to evaluate how well the underlying model is trained and how well it forecasts.
  4. The log table provides metadata of the trained file, such as the number of rows and the time it takes to train.
  5. The last table is about the Important Rows since ours is a time-series model with only one underlying feature distribution.

    alt

    alt

Important pointers on the datasets

  • There should only be 2 other columns apart from the date — Row sequence number and Target Variable.
  • Ensure the time interval is correctly maintained through the training and forecast data. For exmaple, if you set the time interval as “daily”, your dataset must contain only one record for a particular day.
  • Additionally, if your interval is set to “daily”, your forecast data must have a forecast for every day without a gap.

If you encounter the following error, clear your browser cache or try in another browser.

alt

For further reference, look at the datasets used in this tutorial.

Summary

In summary, this tutorial helps you to understand how to perform time-series analysis with Red Hat Market Place using the FP Predict + Operator.

Next steps