Skip to content

Mission 13 - Comparing Predictions

Estimated time for completing this mission: 30 mins

Learning Objective

Creating charts with advanced functionality in App Designer.

BLOX used in this mission:

Logic BLOX

  • MyData/FinalData
  • AI/Regression Model
  • AI/Time Series Model

App Templates

  • Chart (2x)
  • Panel
  • Button (2x)
  • Label (4x)
  • Multiselect (2x)

Data

The same data set will be used as for the previous exercise. In case you do not have the data set you can download it here: FinalData.xlsx

Steps

Please refer to the Navigation Guide to perform the steps below

App Designer:

Create Comparing Predictions App

  1. Import the dataset from the Data section to Module5 folder
  2. In Module5, create a new app named Comparing Predictions
  3. Drag a Panel template onto the canvas and make it large enough to fit the content
  4. Drag two Chart templates into the Panel side by side
  5. Add two Multiselect templates above the charts for selecting feature variables
  6. Add four Label templates to display model information and accuracy scores
  7. Add two Button templates to trigger each model's logic
  8. Click the flask icon to create a new logic flow and name it "Compare Models"

startBlox

App Overview

Build Time Series Model Logic

  1. In the logic flow, drag the "MyData" BLOX
  2. In the "MyData" BLOX settings, configure "Group By" to "ORDERDATE" and set "Aggregation" to "Sum" for all columns
  3. Connect the "MyData" BLOX to "Time Series Model" BLOX. In the "Time Series Model" BLOX settings, set "Time Variable" to "ORDERDATE", "Time Format" to "%Y/%m/%d", "Target Variable" to "SALES", "Look Back Window Size" to 50, "Training Intensity" to "Medium", and provide a model name
  4. Connect the first Multiselect template to the "Feature Variables" input of the "Time Series Model" BLOX
  5. Connect the first Button template to the "MyData" BLOX in the logic
  6. Connect the "Compare Graph" output from the "Time Series Model" BLOX to the first Chart template

Hint

Configure the Multiselect template by double-clicking it and adding feature variable options using the "Configure" button. Name the items the same as column names from your data (e.g., "QUANTITYORDERED", "PRICEEACH"). Users can select different combinations to see which features produce the most accurate predictions.

Build Regression Model Logic

  1. Connect the second Button template to the "MyData" BLOX in the logic
  2. Connect the "MyData" BLOX to "Regression Model" BLOX. In the "Regression Model" BLOX settings, set "Target" to "SALES", "Regression Type" to "Fifth Power", "Feature is time series" to "no", and provide a model name
  3. Connect the second Multiselect template to the "Features" input of the "Regression Model" BLOX
  4. Connect the "Line Chart" output from the "Regression Model" BLOX to the second Chart template
  5. Run the app and experiment with different feature variables for both models to compare their accuracy

Results and Summary

startBlox

Final Logics

startBlox

Result in Working App View for Time Series

startBlox

Result in Working App View for the Regression

From the results, it is clear that the regression model fit the data better. Different data require different models, that is why it is crucial to have all these tools available when it comes to prediction.

Well done! Now let's move on to the next module!