Skip to Content
1

HANA PAL: Naive Bayes Classification bug

Nov 26, 2017 at 11:45 PM

69

avatar image

I've found what I believe to be a bug with the PAL_NBCTRAIN_PROC() function in PAL. I have reproduced the problem using the example provided in the example of the documentation here. I'm using SPS12 as provided in SAP CAL.

The error is associated with the specific order of the data types in the algorithm input tables; where if it doesn't follow certain patterns, the error will be thrown:

Could not execute 'CALL "DM_PAL".PAL_NBCTRAIN_PROC(PAL_NBCTRAIN_TRAININGSET_TBL, "#PAL_CONTROL_TBL", ...' in 97 ms 515 µs . 
SAP DBTech JDBC: [2048]: column store error: search table error:  [2620] executor: plan operation failed;Can not insert data from temp table "DM_PAL:P3_5A1B16AB39370B41E200AD59A228CE2B (t 432345564228450191)" into table ""DM_PAL"."NBC_PAL_NBC_MODEL_TBL"" 

I don't know what all the certain patterns are, but I can describe the simplest case that will reproduce the error.

In the documentation example, change the PAL_NBCTRAIN_TRAININGSET_T Type:

  • add new column "Attribute" INTEGER after AnnualIncome column

The code should look like this

CREATE TYPE PAL_NBCTRAIN_TRAININGSET_T AS TABLE(
	"HomeOwner" VARCHAR (100), 
	"MaritalStatus" VARCHAR (100),
	"AnnualIncome" INTEGER,
	"Attribute" INTEGER, --new column
	"DefaultedBorrower" VARCHAR (100)
);

Reflect these changes in the input data table PAL_NBCTRAIN_TRAININGSET_TBL by adding the relevant column with dummy data:

CREATE COLUMN TABLE PAL_NBCTRAIN_TRAININGSET_TBL LIKE PAL_NBCTRAIN_TRAININGSET_T;
INSERT INTO PAL_NBCTRAIN_TRAININGSET_TBL VALUES ('YES','Single',125,2,'NO');
INSERT INTO PAL_NBCTRAIN_TRAININGSET_TBL VALUES ('NO','Married',100,7,'NO');
INSERT INTO PAL_NBCTRAIN_TRAININGSET_TBL VALUES ('NO','Single',70,4,'NO');
INSERT INTO PAL_NBCTRAIN_TRAININGSET_TBL VALUES ('YES','Married',120,5,'NO');
INSERT INTO PAL_NBCTRAIN_TRAININGSET_TBL VALUES ('NO','Divorced',95,6,'YES');
INSERT INTO PAL_NBCTRAIN_TRAININGSET_TBL VALUES ('NO','Married',60,7,'NO');
INSERT INTO PAL_NBCTRAIN_TRAININGSET_TBL VALUES ('YES','Divorced',220,2,'NO');
INSERT INTO PAL_NBCTRAIN_TRAININGSET_TBL VALUES ('NO','Single',85,5,'YES');
INSERT INTO PAL_NBCTRAIN_TRAININGSET_TBL VALUES ('NO','Married',75,6,'NO');
INSERT INTO PAL_NBCTRAIN_TRAININGSET_TBL VALUES ('NO','Single',90,7,'YES');

Continue to complete the remainder of the example, the error will be raised when the PAL_NBCTRAIN_PROC() function is called.

I would like to know if anyone can replicate this error, and if so, if there is a work around.

Any help appreciated, Michael

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Michael Kollegger Feb 01 at 08:59 AM
1

From another post: https://archive.sap.com/discussions/thread/3656729

INSERT INTO YOUR_PARAMETER_TABLE VALUES ('IS_SPLIT_MODEL', 0, null, null);

So change to

INSERT INTO YOUR_PARAMETER_TABLE VALUES ('IS_SPLIT_MODEL', 1, null, null);

Share
10 |10000 characters needed characters left characters exceeded
Michael Plazzer Feb 01 at 09:57 PM
0

Thanks Michael. I don't have access to the environment at the moment. I'll happily accept the answer if someone else can confirm the work around is valid.

Share
10 |10000 characters needed characters left characters exceeded