Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.

Qlik AutoML: Generate Predictions with AutoML API endpoint connection

100% helpful (1/1)
cancel
Showing results for 
Search instead for 
Did you mean: 
KellyHobson
Former Employee
Former Employee

Qlik AutoML: Generate Predictions with AutoML API endpoint connection

Last Update:

Mar 3, 2023 11:23:50 AM

Updated By:

KellyHobson

Created date:

Mar 3, 2023 11:24:57 AM

 

Introduction 

With Qlik AutoML, you can generate predictions within the AutoML interface or via external API calls. In this article, we will outline another option for generating predictions with API endpoint connection in Qlik Sense.

A benefit of using this method is being able to re-run the predictions as a script each time the test or apply data is refreshed.

 

Steps

 

1. Train and Deploy Model: Upload titanic survival datasets (titanic_train.csv and titanic_test.csv) to your Qlik Cloud tenant. We train a model with Survived as the target variable. Then we select CatBoost model (top performer) and deploy this model. 

deployedmodel.png

2.  Open app with test data: Instead of selecting 'Create Prediction' from the Deployment overview page. We open up titanic_test.csv as a Qlik Sense App. In this example, we call the app, 'titanic_endpointAPI.'

 

testtoapp.png

3. Create automl section: Navigate to Data Load Editor page and review the Auto-generated code for titanic_test.csv. Click on the '+' button to add a new section, in this article we name the section, automl.

 

dataload1.png

4. Create AutoML endpoint connection: On the right hand side, click on 'Create new Connection' and select Qlik AutoML. 

 

create_new_connbutton.png

 

endpointSEL.png

 

5. Populate parameters within the endpoint connection:

For ML Deployment, use the model deployed in step #1, titanicsurvival_v1-CATBC.

For 'Name of Returned Table', we set to titanic_survival. This is the name of the dataset which will contain the predictions and SHAP values from running the test data against the deployed model.

We opt to only include SHAP and not select apply dataset or errors.

For the Association Field, we use PassengerId in case we would like to link this new table to the test dataset. If we do not set an Association Field, it will generate automl_row_index value in titanic_survival.

Lastly, we set AutoML_titanic as the name of the connection. This will be the value displayed on the connections pane in data load editor.

Test the connection, then click Save.

 

create_connection.png

 

6.  Generate Endpoint script code: Once the endpoint connection is created, then click on the table icon.

 

create_connection_available.png

This will prompt you to select the data you would like to load as the Resident Table. We select titanic_test, and then for Tables, we check mark next to titanic_survival.

load_script.png

 

This will allow you to 'Insert' the following script to your automl section:


[titanic_survival]:
LOAD * EXTENSION endpoints.ScriptEval('{"RequestType":"endpoint", "endpoint":{"connectionname":"AutoML_titanic"}}', titanic_test);

 

7. Load the data: Now you are ready to run, 'Load Data' and view the predicted output within the App. 

 

loaddata.png

 

datamodelview.png

8.  Work with data in sheet: With the data loaded, we can make reports with the predicted output. 

 

sheet_explore.png

 

 

 

Environment

 

The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.

Related Content 

Getting Starting with Qlik AutoML

Contributors
Version history
Last update:
‎2023-03-03 11:23 AM
Updated by: