cancel
Showing results for 
Search instead for 
Did you mean: 

APL Forecast function: How to combine two input parameters to create a key

Former Member
0 Kudos

Hello,

I am new to PAL. I am using APLWRAPPER_FORECAST function to predict the amount for future years. My input dataset contain ID, Year and Amount. Currently I am predicting amount for each Id separately and then combining the result. Could I directly give ID and Year as a key in input and predicted result should also contain the same.

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Mayur,

Can you please provide us sample data? It looks like you have only one row in your dataset.

Regards

Angad

Former Member
0 Kudos

Hello Angad,

I have enough data to train the model and I am able to produce results with single ID.

My dataset is like below

ID(Post_Code)---------Year------------Amount

ID is not continues and the key is ID+Year.

I have 5 IDs and amount for each ID from 2003 to 2026. I am collecting data for a particular ID in input table and generating result as Year and Amount. Hence the result dataset is only for that particular ID.

Instead of collecting data for each ID I want to give whole table as input and result should also contain ID,Year and predicted amount for future years. But I am not able to include the ID(post_code) in my output data set.

Below are the table types of Input and Output and FORECAST function which I am currently using:

create type post_code_data_input_t as table(

"post_code" integer, (ID)

"year"     integer,

"amount" double

);

create type post_code_data_output_t as table(

"year"     integer,

"amount" double,

"kts_1" double

);

call APLWRAPPER_FORECAST(FUNC_HEADER, FORECAST_CONFIG, VARIABLE_DESC, VARIABLE_ROLES, POST_CODE_DATA_INPUT_TBL, POST_CODE_DATA_OUTPUT_TBL, OPERATION_LOG, SUMMARY, INDICATORS) with overview;

Inpute Dataset is:

post_code          Year          Amount

2540                    2003       8000.123

2540                    2026       7000.223

.

.

.

.

2540                   2016        9000.324

And similarly for other 4 post codes.

Regards,

Mayur

Former Member
0 Kudos

Mayur,

Thanks for the explanation. I wish we could add OID in the output table. It is possible to have OID in function_header and you can use "post_code" as value but I don't know if output table can have OID.

I will try it myself and let you know the results.

Cheers

Angad