Just like in the Forecast service, we could adjust the variable description at the dataset level, but we will instead use the Key Influencers service parameters to adjust the variable description.
Open a new tab in Postman.
Fill in the following information
Field Name |
Value |
Request Type |
POST |
URL |
C4PAURL /api/analytics/keyinfluencer/sync |
Select the Authorization tab and fill in the same details as in the previous call.
Select the Body tab, enable the raw mode and select JSON (application/json)
in the drop down, then add the following content:
{
"datasetID": 9999999,
"targetColumn": "class",
"numberOfInfluencers" : 2,
"targetKey" : 1,
"skippedVariables" : ["id", "sex", "race"],
"variableDescription" : [
{"position" : "1", "variable" : "id", "storage" : "integer" , "value" : "nominal" , "key" : "1"},
{"position" : "2", "variable" : "age", "storage" : "integer" , "value" : "continuous"},
{"position" : "3", "variable" : "workclass", "storage" : "string" , "value" : "nominal"},
{"position" : "4", "variable" : "fnlwgt", "storage" : "integer" , "value" : "continuous"},
{"position" : "5", "variable" : "education", "storage" : "string" , "value" : "nominal"},
{"position" : "6", "variable" : "education_num", "storage" : "integer" , "value" : "ordinal"},
{"position" : "7", "variable" : "marital_status", "storage" : "string" , "value" : "nominal"},
{"position" : "8", "variable" : "occupation", "storage" : "string" , "value" : "nominal"},
{"position" : "9", "variable" : "relationship", "storage" : "string" , "value" : "nominal"},
{"position" : "10", "variable" : "race", "storage" : "string" , "value" : "nominal"},
{"position" : "11", "variable" : "sex", "storage" : "string" , "value" : "nominal"},
{"position" : "12", "variable" : "capital_gain", "storage" : "integer" , "value" : "continuous"},
{"position" : "13", "variable" : "capital_loss", "storage" : "integer" , "value" : "continuous"},
{"position" : "14", "variable" : "hours_per_week", "storage" : "number" , "value" : "continuous"},
{"position" : "15", "variable" : "native_country", "storage" : "string" , "value" : "nominal"},
{"position" : "16", "variable" : "class", "storage" : "integer" , "value" : "nominal"}
]
}
Make sure the datasetID
(here the value 9999999) is correct. To get the list of valid identifier, you can run Step 6: List all registered datasets from the Test the “Data Set” SAP Predictive services using a REST client tutorial
Click on Send
The top 2 influencers are still the marital_status
and capital_gain
. But if you look closer you will notice that the capital_gain
is now properly encoded as a continuous attribute. However, you can see that one of the group for the capital_gain
variable has a higherBound
equal to “99999” which is in fact the missing value indicator.
Let’s try with the following Body, which define the missing value for the relevant attribute:
{
"datasetID": 9999999,
"targetColumn": "class",
"numberOfInfluencers" : 2,
"targetKey" : 1,
"skippedVariables" : ["id", "sex", "race"],
"variableDescription" : [
{"position" : "1", "variable" : "id", "storage" : "integer" , "value" : "nominal" , "key" : "1"},
{"position" : "2", "variable" : "age", "storage" : "integer" , "value" : "continuous"},
{"position" : "3", "variable" : "workclass", "storage" : "string" , "value" : "nominal" , "missing" : "?"},
{"position" : "4", "variable" : "fnlwgt", "storage" : "integer" , "value" : "continuous"},
{"position" : "5", "variable" : "education", "storage" : "string" , "value" : "nominal"},
{"position" : "6", "variable" : "education_num", "storage" : "integer" , "value" : "ordinal"},
{"position" : "7", "variable" : "marital_status", "storage" : "string" , "value" : "nominal"},
{"position" : "8", "variable" : "occupation", "storage" : "string" , "value" : "nominal" , "missing" : "?"},
{"position" : "9", "variable" : "relationship", "storage" : "string" , "value" : "nominal"},
{"position" : "10", "variable" : "race", "storage" : "string" , "value" : "nominal"},
{"position" : "11", "variable" : "sex", "storage" : "string" , "value" : "nominal"},
{"position" : "12", "variable" : "capital_gain", "storage" : "integer" , "value" : "continuous" , "missing" : "99999"},
{"position" : "13", "variable" : "capital_loss", "storage" : "integer" , "value" : "continuous"},
{"position" : "14", "variable" : "hours_per_week", "storage" : "number" , "value" : "continuous"},
{"position" : "15", "variable" : "native_country", "storage" : "string" , "value" : "nominal" , "missing" : "?"},
{"position" : "16", "variable" : "class", "storage" : "integer" , "value" : "nominal"}
]
}
Make sure the datasetID
(here the value 9999999) is correct. To get the list of valid identifier, you can run Step 6: List all registered datasets from the Test the “Data Set” SAP Predictive services using a REST client tutorial
The performances a roughly the same as we limited the analysis to only 2 attributes on a small dataset. Off course you can increase the number of influencers and see the difference.