Skip to content

Mission 12 - Regression Revisited

Estimated time for completing this mission: 20 mins

Learning Objective

Create a regression model app in LOGIBLOX to present regression analysis results in an easily interpretable way.

Scenario

You need to create a regression analysis app for non-technical users. The app should display regression results with clear visualizations comparing predicted values against true values.

BLOX used in this mission:

Logic BLOX

  • MyData/FinalData
  • AI/Regression Model

App Templates

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

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 Regression App

  1. Import dataset from the Data section to Module5 folder
  2. In Module5, create a new app named Regression Revisited
  3. Drag a Panel template onto the canvas and make it large enough to fit two Chart templates inside
  4. Drag two Chart templates into the Panel side by side
  5. Add two Label templates below the charts: one with text "Accuracy:" and one empty label for displaying the accuracy value
  6. Add a Button template to trigger the regression logic
  7. Click the flask icon to create a new logic flow and name it "Regression"

Build Regression Logic

  1. In the logic flow, drag the "MyData" BLOX
  2. In the "MyData" BLOX settings, set "Limit" to 200
  3. In the "MyData" BLOX settings, configure "Group By" to "ORDERDATE". Then click the + button after "Aggregation", select "all" in the first dropdown and "Average" in the second dropdown
  4. Connect the "MyData" BLOX to "Regression Model" BLOX. In the "Regression Model" BLOX settings, set "Features" to "ORDERDATE", "Target" to "SALES", "Regression Type" to "Quadratic", "Feature is time series" to "yes", and name the model "Quadratic Model"
  5. Connect the "Button" template to the "MyData" BLOX in the logic
  6. Connect the "Line Chart" output from the "Regression Model" BLOX to the first Chart template in the app
  7. Connect the "Scatter Plot" output from the "Regression Model" BLOX to the second Chart template in the app
  8. Connect the "Prediction Score" output from the "Regression Model" BLOX to the empty accuracy Label template
  9. Run the app and click the button to display the regression results with accuracy score

startBlox

Layout composition

startBlox

Logic composition

Results and Summary

startBlox

Resulting Chart

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