on 07-04-2017 9:53 AM
Hi,
we have created a classification model in SAP BO predictive analytics (dektop). For visualization we want to export the feature importance (maybe in an HANA DB) including corresponding values of the intervals.
So here is my question: is there any way to export the described values?
From SAP Predictive Analytics desktop, save the classification model in table: MODEL_TRAIN_DESKTOP within HANA.
From HANA Studio, prepare the signature of the APL function : get_model_info for a model in Native format
drop table GET_MODEL_INFO_SIGNATURE;
create column table GET_MODEL_INFO_SIGNATURE like PROCEDURE_SIGNATURE_T;
insert into GET_MODEL_INFO_SIGNATURE values (1, 'USER_APL','FUNCTION_HEADER_T', 'IN');
insert into GET_MODEL_INFO_SIGNATURE values (2, 'USER_APL','MODEL_NATIVE_T', 'IN'); --- Native format
insert into GET_MODEL_INFO_SIGNATURE values (3, 'USER_APL','OPERATION_CONFIG_T', 'IN');
insert into GET_MODEL_INFO_SIGNATURE values (4, 'USER_APL','SUMMARY_T', 'OUT');
insert into GET_MODEL_INFO_SIGNATURE values (5, 'USER_APL','VARIABLE_ROLES_WITH_COMPOSITES_OID_T', 'OUT');
insert into GET_MODEL_INFO_SIGNATURE values (6, 'USER_APL','VARIABLE_DESC_OID_T', 'OUT');
insert into GET_MODEL_INFO_SIGNATURE values (7, 'USER_APL','INDICATORS_T', 'OUT');
insert into GET_MODEL_INFO_SIGNATURE values (8, 'USER_APL','PROFITCURVE_T', 'OUT');
call SYS.AFLLANG_WRAPPER_PROCEDURE_DROP('USER_APL','APLWRAPPER_GET_MODEL_INFO');
call SYS.AFLLANG_WRAPPER_PROCEDURE_CREATE('APL_AREA','GET_MODEL_INFO','USER_APL', 'APLWRAPPER_GET_MODEL_INFO', GET_MODEL_INFO_SIGNATURE);
Specify the model format in the function header, and run the APL function : get_model_info
drop table FUNC_HEADER;
create table FUNC_HEADER like FUNCTION_HEADER_T;
insert into FUNC_HEADER values ('Oid', '#42');
insert into FUNC_HEADER values ('LogLevel', '8');
insert into FUNC_HEADER values ('ModelFormat', 'native');
drop table OPERATION_CONFIG;
create table OPERATION_CONFIG like OPERATION_CONFIG_T;
drop table SUMMARY;
create table SUMMARY like SUMMARY_T;
drop table VARIABLE_DESC;
create table VARIABLE_DESC like VARIABLE_DESC_OID_T;
drop table VARIABLE_ROLES;
create table VARIABLE_ROLES like VARIABLE_ROLES_WITH_COMPOSITES_OID_T;
drop table INDICATORS;
create table INDICATORS like INDICATORS_T;
drop table PROFITCURVES;
create table PROFITCURVES like PROFITCURVE_T;
call APLWRAPPER_GET_MODEL_INFO (
FUNC_HEADER, MODEL_TRAIN_DESKTOP,
OPERATION_CONFIG, SUMMARY, VARIABLE_ROLES, VARIABLE_DESC, INDICATORS, PROFITCURVES
) with overview;
Extract variables importance from APL table : INDICATORS
select
OID ,
row_number() OVER (partition by OID order by to_double(VALUE) desc) as "Rank",
VARIABLE as "Explanatory Variable",
round(to_double(VALUE) *100 , 2) as "Individual Contribution",
round(sum(to_double(VALUE)) OVER (partition by OID order by to_double(VALUE) desc) *100 ,2) as "Cumulative Contribution"
from
INDICATORS
where
KEY = 'MaximumSmartVariableContribution'
order by 4 desc;
Sample Results
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just for further clarification: is this about "seeing" the plot? In Factory you will be able to do this with our soon to be released version 3.2. I'll attach a screenshot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe this could be a way? (SAP Cloud Platform Predictive Service - Key Influencer)
https://help.hana.ondemand.com/c4pa/frameset.htm?e8bda9b653ff4b48a702124e27747f85.html
I understand desktop export would be ideal but I do not have a solution from the user interface.
Otherwise scripting maybe?
Hi Torge,
Let me think about this and come back to you.
Kind regards
Antoine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Torge, can you please explain why you need to do this? Kind regards Antoine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.