Skip to Content
0

Exception 73001402 during execution of Predictive Analytics Library (PAL) in HANA for Random Forest

Mar 16, 2017 at 01:23 PM

199

avatar image
Former Member

Hey,

when executing the procedure for the Random Forest algorithm, i get this error:

2:05:03 PM (SQL Editor) Could not execute 'CALL "IOYMB191QNJP8QPJ_RULE_MINING_HDI_CONTAINER_2"."sap::RandomForestTrain"(PROCESSGUID => ...'Error: (dberror) AFL error: search table error: _SYS_AFL.AFLPAL:RANDOMFORESTTRAIN: [423] (range 3) AFL error exception: exception 73001402: PAL error[73001402]:Data table column 1 cannot be handled as continuous type

Here are my TableTypes:

table type FOREST_TRAIN_DATA {
     "0" : String(100);
     "1" : String(100);
     "2" : String(100);
     "3" : String(100);
     "4" : String(100);
     "5" : String(100);
     "6" : String(100);
     "7" : String(100);
     "8" : String(100);
     "9" : String(100);
     "10" : String(100);
     "11" : String(100);
     "12" : String(100);
     "13" : String(100);
     "14" : String(100);
     "15" : String(100);
     "16" : String(100);
     "17" : String(100);
     "18" : String(100);
     "19" : String(100);
     "CLASS" : String(20);
   };
   
   table type FOREST_TRAIN_PARAM {
     "NAME" : hana.VARCHAR(100);
	"INTARGS" : Integer; 
	"DOUBLEARGS" : Double;
	"STRINGARGS" : hana.VARCHAR(100);
   };
   
   table type FOREST_TRAIN_MODEL{
       ID     : Integer;
       TREEINDEX : Integer;
       MODEL : hana.VARCHAR(5000);
   };
   
   table type FOREST_TRAIN_IMPORTANCE{
      VARIABLE : hana.VARCHAR(100);
      IMPORTANCE: Double;
      };
      
    table type FOREST_TRAIN_ERROR{
      TREEINDEX : Integer;
      ERROR_RATE: Double;
      };
      
    table type FOREST_TRAIN_CONFUSION{
      ID : Integer;
      CONTENT: hana.VARCHAR(1000);
      };

Signature file:

{
	"procedure": "sap::RandomForestTrainSignature",
	"area": "AFLPAL",
	"function": "RANDOMFORESTTRAIN",
	"parameters": [
					{
						"type": "sap::RandomForestTrainTableTypes.FOREST_TRAIN_DATA",
						"direction": "IN"
					}, {
						"type": "sap::RandomForestTrainTableTypes.FOREST_TRAIN_PARAM", 
						"direction": "IN"
					},  {
						"type": "sap::RandomForestTrainTableTypes.FOREST_TRAIN_MODEL",
						"direction": "OUT"
					}, {
						"type": "sap::RandomForestTrainTableTypes.FOREST_TRAIN_IMPORTANCE",
						"direction": "OUT"
					}, {
						"type": "sap::RandomForestTrainTableTypes.FOREST_TRAIN_ERROR",
						"direction": "OUT"
					}, {
						"type": "sap::RandomForestTrainTableTypes.FOREST_TRAIN_CONFUSION",
						"direction": "OUT"
					}
		]
}

Procedure:

PROCEDURE "sap::RandomForestTrain" ()
   LANGUAGE SQLSCRIPT
   SQL SECURITY INVOKER
   --DEFAULT SCHEMA <default_schema_name>
   READS SQL DATA AS
BEGIN


  FOREST_TRAIN_PARAM = select 'TREES_NUM' as "NAME" , 300 as "INTARGS", null as "DOUBLEARGS", null as "STRINGARGS"  from "synonym::DUMMY"
                  union 
                  select 'TRY_NUM' as "NAME" , 3 as "INTARGS", null as "DOUBLEARGS", null as "STRINGARGS"  from "synonym::DUMMY"
                  union
                  select 'CONTINUOUS_COL' as "NAME" , 1 as "INTARGS", null as "DOUBLEARGS", null as "STRINGARGS"  from  "synonym::DUMMY"
                  union
                  select 'CONTINUOUS_COL' as "NAME" , 2 as "INTARGS", null as "DOUBLEARGS", null as "STRINGARGS"  from  "synonym::DUMMY"
                  ;
  
  FOREST_TRAIN_DATA = select * from "rule_mining.db.data::RandomForest.FOREST_TRAIN_DATA";
  
  CALL "sap::RandomForestTrainSignature"(:FOREST_TRAIN_DATA, :FOREST_TRAIN_PARAM, :FOREST_TRAIN_MODEL, :FOREST_TRAIN_IMPORTANCE, :FOREST_TRAIN_ERROR, :FOREST_TRAIN_CONFUSION);

select * from :FOREST_TRAIN_MODEL;
  
END
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member
Mar 17, 2017 at 03:12 AM
0

Hi,

If the feature in the training data table is continuous variable, it must be either INT or DOUBLE column. If the column is of DOUBLE type, no parameter is needed. If it is of INT type, 'CONTINOUS_COL' is needed with the column index of the table starting from 0. The 'CONTINOUS_COL' does not apply to string column. In your case, if a string column is continuous variable, please set the column type to DOUBLE or convert the string column to double column explicitly in SQL.

Best regards,

Xingtian

Share
10 |10000 characters needed characters left characters exceeded