Skip to Content

C45 supports only classification but not regression error in Hana studio

Hi All,

I am facing the below error when i am trying to create a PAL procedure through Kmeans .

Following is the error .

Error : Could not execute 'CALL DM_PAL.PAL_CREATEDT_PROC(PAL_KMEANS_RESULT_TBL, "#PAL_CONTROL_TBL", PAL_CDT_JSONMODEL_TBL, ...' in 188 ms 440 µs . SAP DBTech JDBC: [423]: AFL error: search table error: _SYS_AFL.AFLPAL:CREATEDT: [423] (range 3) AFL error exception: exception 73001273: PAL error[73001273]:C45 supports only classification, not regression

Exception raises exactly when i am building the decision tree .Code is as follows .

Step 1 : Building the data

SET SCHEMA DM_PAL; DROP TYPE PAL_KMEANS_RESASSIGN_T;

CREATE TYPE PAL_KMEANS_RESASSIGN_T AS TABLE(

"ID" INT,

"CENTER_ASSIGN" INT,

"DISTANCE" DOUBLE

);

DROP TYPE PAL_KMEANS_DATA_T;

CREATE TYPE PAL_KMEANS_DATA_T AS TABLE(

"ID" INT,

"AGE" DOUBLE,

"INCOME" DOUBLE,

PRIMARY KEY("ID")

);

DROP TYPE PAL_KMEANS_CENTERS_T;

CREATE TYPE PAL_KMEANS_CENTERS_T AS TABLE(

"CENTER_ID" INT,

"V000" DOUBLE,

"V001" DOUBLE

);

DROP TYPE PAL_CONTROL_T;

CREATE TYPE PAL_CONTROL_T AS TABLE(

"NAME" VARCHAR(100),

"INTARGS" INTEGER,

"DOUBLEARGS" DOUBLE,

"STRINGARGS" VARCHAR(100)

);

-- create kmeans procedure

DROP TABLE PAL_KMEANS_PDATA_TBL;

CREATE COLUMN TABLE PAL_KMEANS_PDATA_TBL(

"POSITION" INT,

"SCHEMA_NAME" NVARCHAR(256),

"TYPE_NAME" NVARCHAR(256),

"PARAMETER_TYPE" VARCHAR(7)

);

INSERT INTO PAL_KMEANS_PDATA_TBL VALUES (1, 'DM_PAL', 'PAL_KMEANS_DATA_T', 'IN');

INSERT INTO PAL_KMEANS_PDATA_TBL VALUES (2, 'DM_PAL', 'PAL_CONTROL_T', 'IN');

INSERT INTO PAL_KMEANS_PDATA_TBL VALUES (3, 'DM_PAL', 'PAL_KMEANS_RESASSIGN_T',

'OUT');

INSERT INTO PAL_KMEANS_PDATA_TBL VALUES (4, 'DM_PAL', 'PAL_KMEANS_CENTERS_T',

'OUT');

CALL SYS.AFLLANG_WRAPPER_PROCEDURE_DROP('DM_PAL', 'PAL_KMEANS_PROC');

CALL SYS.AFLLANG_WRAPPER_PROCEDURE_CREATE('AFLPAL', 'KMEANS', 'DM_PAL',

'PAL_KMEANS_PROC', PAL_KMEANS_PDATA_TBL);

DROP TABLE PAL_KMEANS_DATA_TBL;

CREATE COLUMN TABLE PAL_KMEANS_DATA_TBL LIKE PAL_KMEANS_DATA_T;

INSERT INTO PAL_KMEANS_DATA_TBL VALUES (0 , 20, 100000);

INSERT INTO PAL_KMEANS_DATA_TBL VALUES (1 , 21, 101000);

INSERT INTO PAL_KMEANS_DATA_TBL VALUES (2 , 22, 102000);

INSERT INTO PAL_KMEANS_DATA_TBL VALUES (3 , 30, 200000);

INSERT INTO PAL_KMEANS_DATA_TBL VALUES (4 , 31, 201000);

INSERT INTO PAL_KMEANS_DATA_TBL VALUES (5 , 32, 202000);

INSERT INTO PAL_KMEANS_DATA_TBL VALUES (6 , 40, 400000);

INSERT INTO PAL_KMEANS_DATA_TBL VALUES (7 , 41, 401000);

INSERT INTO PAL_KMEANS_DATA_TBL VALUES (8 , 42, 402000);

DROP TABLE #PAL_CONTROL_TBL;

CREATE LOCAL TEMPORARY COLUMN TABLE #PAL_CONTROL_TBL(

"NAME" VARCHAR(100),

"INTARGS" INTEGER,

"DOUBLEARGS" DOUBLE,

"STRINGARGS" VARCHAR(100)

);

INSERT INTO #PAL_CONTROL_TBL VALUES ('THREAD_NUMBER', 2, NULL, NULL);

INSERT INTO #PAL_CONTROL_TBL VALUES ('GROUP_NUMBER', 3, NULL, NULL);

INSERT INTO #PAL_CONTROL_TBL VALUES ('INIT_TYPE', 1, NULL, NULL);

INSERT INTO #PAL_CONTROL_TBL VALUES ('DISTANCE_LEVEL', 2, NULL, NULL);

INSERT INTO #PAL_CONTROL_TBL VALUES ('MAX_ITERATION', 100, NULL, NULL);

INSERT INTO #PAL_CONTROL_TBL VALUES ('EXIT_THRESHOLD', NULL, 0.000001, NULL);

INSERT INTO #PAL_CONTROL_TBL VALUES ('NORMALIZATION', 0, NULL, NULL);

--clean kmeans result

DROP TABLE PAL_KMEANS_RESASSIGN_TBL;

CREATE COLUMN TABLE PAL_KMEANS_RESASSIGN_TBL LIKE PAL_KMEANS_RESASSIGN_T;

DROP TABLE PAL_KMEANS_CENTERS_TBL;

CREATE COLUMN TABLE PAL_KMEANS_CENTERS_TBL LIKE PAL_KMEANS_CENTERS_T;

CALL DM_PAL.PAL_KMEANS_PROC(PAL_KMEANS_DATA_TBL, "#PAL_CONTROL_TBL",

PAL_KMEANS_RESASSIGN_TBL, PAL_KMEANS_CENTERS_TBL) WITH OVERVIEW;

SELECT * FROM PAL_KMEANS_CENTERS_TBL;

SELECT * FROM PAL_KMEANS_RESASSIGN_TBL;

DROP TABLE PAL_KMEANS_RESULT_TBL;

CREATE COLUMN TABLE PAL_KMEANS_RESULT_TBL(

"AGE" DOUBLE,

"INCOME" DOUBLE,

"LEVEL" INT

);

TRUNCATE TABLE PAL_KMEANS_RESULT_TBL;

INSERT INTO PAL_KMEANS_RESULT_TBL(

SELECT PAL_KMEANS_DATA_TBL.AGE, PAL_KMEANS_DATA_TBL.INCOME,

PAL_KMEANS_RESASSIGN_TBL.CENTER_ASSIGN

FROM PAL_KMEANS_RESASSIGN_TBL

INNER JOIN PAL_KMEANS_DATA_TBL

ON PAL_KMEANS_RESASSIGN_TBL.ID = PAL_KMEANS_DATA_TBL.ID

);

SELECT * FROM PAL_KMEANS_RESULT_TBL;

Step 2 :

SET SCHEMA DM_PAL; DROP TYPE PAL_CDT_DATA_T;

CREATE TYPE PAL_CDT_DATA_T AS TABLE(

"AGE" DOUBLE,

"INCOME" DOUBLE,

"LEVEL" INT

);

DROP TYPE PAL_CDT_JSONMODEL_T;

CREATE TYPE PAL_CDT_JSONMODEL_T AS TABLE(

"ID" INT,

"JSONMODEL" VARCHAR(5000)

);

DROP TYPE PAL_CDT_PMMLMODEL_T;

CREATE TYPE PAL_CDT_PMMLMODEL_T AS TABLE(

"ID" INT,

"PMMLMODEL" VARCHAR(5000)

);

DROP TYPE PAL_CONTROL_T;

CREATE TYPE PAL_CONTROL_T AS TABLE(

"NAME" VARCHAR (100),

"INTARGS" INTEGER,

"DOUBLEARGS" DOUBLE,

"STRINGARGS" VARCHAR(100)

);

--create procedure

DROP TABLE PAL_CDT_PDATA_TBL;

CREATE COLUMN TABLE PAL_CDT_PDATA_TBL(

"POSITION" INT,

"SCHEMA_NAME" NVARCHAR(256),

"TYPE_NAME" NVARCHAR(256),

"PARAMETER_TYPE" VARCHAR(7)

);

INSERT INTO PAL_CDT_PDATA_TBL VALUES (1, 'DM_PAL', 'PAL_CDT_DATA_T', 'IN');

INSERT INTO PAL_CDT_PDATA_TBL VALUES (2, 'DM_PAL', 'PAL_CONTROL_T', 'IN');

INSERT INTO PAL_CDT_PDATA_TBL VALUES (3, 'DM_PAL', 'PAL_CDT_JSONMODEL_T', 'OUT');

INSERT INTO PAL_CDT_PDATA_TBL VALUES (4, 'DM_PAL', 'PAL_CDT_PMMLMODEL_T', 'OUT');

CALL SYS.AFLLANG_WRAPPER_PROCEDURE_DROP('DM_PAL', 'PAL_CREATEDT_PROC');

CALL SYS.AFLLANG_WRAPPER_PROCEDURE_CREATE('AFLPAL', 'CREATEDT', 'DM_PAL',

'PAL_CREATEDT_PROC', PAL_CDT_PDATA_TBL);

DROP TABLE PAL_CDT_TRAINING_TBL;

CREATE COLUMN TABLE PAL_CDT_TRAINING_TBL(

"REGION" VARCHAR(50),

"SALESPERIOD" VARCHAR(50),

"REVENUE" Double,

"CLASSLABEL" VARCHAR(50)

);

DROP TABLE #PAL_CONTROL_TBL;

CREATE LOCAL TEMPORARY COLUMN TABLE #PAL_CONTROL_TBL(

"NAME" VARCHAR(100),

"INTARGS" INTEGER,

"DOUBLEARGS" DOUBLE,

"STRINGARGS" VARCHAR(100)

);

INSERT INTO #PAL_CONTROL_TBL VALUES ('PERCENTAGE', NULL, 1.0, NULL);

INSERT INTO #PAL_CONTROL_TBL VALUES ('THREAD_NUMBER', 2, NULL, NULL);

INSERT INTO #PAL_CONTROL_TBL VALUES ('IS_SPLIT_MODEL', 1, NULL, NULL);

INSERT INTO #PAL_CONTROL_TBL VALUES ('PMML_EXPORT', 2, NULL, NULL);

DROP TABLE PAL_CDT_JSONMODEL_TBL;

CREATE COLUMN TABLE PAL_CDT_JSONMODEL_TBL LIKE PAL_CDT_JSONMODEL_T;

DROP TABLE PAL_CDT_PMMLMODEL_TBL;

CREATE COLUMN TABLE PAL_CDT_PMMLMODEL_TBL LIKE PAL_CDT_PMMLMODEL_T;

Exception exactly comes when i execute following statement .

CALL DM_PAL.PAL_CREATEDT_PROC(PAL_KMEANS_RESULT_TBL, "#PAL_CONTROL_TBL",

PAL_CDT_JSONMODEL_TBL, PAL_CDT_PMMLMODEL_TBL) WITH OVERVIEW;


Please help us in solving the above error .

Thanks in advance .

Regards,

Divya

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers