Mission 12 - Regression Revisited
Estimated time for completing this mission: 20 mins
Learning Objective
Using LOGIBLOX to create a Regression model business app.
Scenario
Imagine that you have to create a regression analysis model for someone who has never seen a regression model so you want to present different plots and results in an easily interpretable way. In this task, we will show the tools for that using LOGIBLOX.
BLOX used in this mission:
Logic BLOX
- MyData/FinalData
- Database/First Rows
- Database/Group By
- AI/Regression
- Charts/Chart Dataset
- Charts/Multi Charts
App BLOX
- Chart
- Panel
- Input
- Button
- Textfield
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:
Regression Revisited
- Import dataset from Data section to Module4 folder
- In Module4 create new app named Regression revisited
- Include all the BLOX which are mentioned in the description above as App BLOX
- Make the "panel" BLOX large enough to fit two "chart" BLOX in it
- In the "input" BLOX write a title for the dashboard
- Below the first "chart" BLOX, insert an "input" BLOX and name is accuracy
- Next to it, put a "text field" BLOX
- Once the layout of the app is done (see image below for help), create a new logic by clicking on the flask icon on your current page
- Name the new logic "Regression"
- Make the compositions of logic as seen on the images below
- In the "First row" BLOX specify the number of row to 200
- In the "Group By" BLOX, use the "ORDERDATE" and the "average" command
- In the regression model function specify Features as "ORDERDATE" Target as "SALES" exponential degree as quadratic, "x is time series" is yes and give a name to the model (Preferably "Linear Model 3")
- Then on the first "Chart data" BLOX specify "X" as x, "y" as y_pred, label as "Prediction", chose a color and "Chart type" as line
- On the other one specify "X" as x, "y" as y, label as "True Value", chose a color and "Chart type" as scatter
- Then in BLOX "Multi Chart" tick yes on "Show Legend", "Tilt Axis" and "Continuous x"
- As a last step run the app and then clicking on the "Button" page BLOX will display the different results
- As your challenge, try to add to the existing app a graph that would compare degrees of regression (i.e. linear vs fifth power).
Hint
Create new regression models using the same data BLOX as previously. Connect them to the chart datasets and finally to multi chart. Specify the powers in regression BLOX. Create new Graph element in App Designer and connect it with Multichart BLOX in logic view.
Results and Summary
The first chart displays the true values and the predicted regression line.
Whereas the second chart, the true values are plotted against the predicted values hence, the model is better if the points are closer to the diagonal.



