逻辑回归预测分析编程规范(模型):http://www.cnblogs.com/omygod/archive/2013/05/15/3080437.html

逻辑回归预测分析编程规范(预测):http://www.cnblogs.com/omygod/archive/2013/05/15/3080441.html

逻辑回归预测分析编程规范(实例):http://www.cnblogs.com/omygod/archive/2013/05/16/3081367.html

 

SET SCHEMA PAL;

-- PAL setup

CREATE TYPE PAL_T_RGP_DATA AS TABLE (ID INTEGER, LIFESPEND INTEGER);
CREATE TYPE PAL_T_RGP_FITTED AS TABLE (ID INTEGER, FITTED DOUBLE, GENDER INTEGER);

CREATE COLUMN TABLE PAL_RGP_SIGNATURE (ID INTEGER, TYPENAME VARCHAR(100), DIRECTION VARCHAR(100));
INSERT INTO PAL_RGP_SIGNATURE VALUES (1, 'PAL_T_RGP_DATA', 'in');
INSERT INTO PAL_RGP_SIGNATURE VALUES (2, 'PAL_T_RG_PARAMS', 'in');
INSERT INTO PAL_RGP_SIGNATURE VALUES (3, 'PAL_T_RG_COEFF', 'in');
INSERT INTO PAL_RGP_SIGNATURE VALUES (4, 'PAL_T_RGP_FITTED', 'out');

CALL SYSTEM.AFL_WRAPPER_GENERATOR ('PAL_RGP', 'AFLPAL', 'FORECASTWITHLOGISTICR', PAL_RGP_SIGNATURE);

-- app setup

CREATE COLUMN TABLE RGP_PREDICT LIKE PAL_T_RGP_DATA;
CREATE COLUMN TABLE RGP_PREDICTED LIKE PAL_T_RGP_FITTED;

-- app runtime

TRUNCATE TABLE RGP_PREDICT;
INSERT INTO RGP_PREDICT VALUES (1,3000);
INSERT INTO RGP_PREDICT VALUES (2,5000);
INSERT INTO RGP_PREDICT VALUES (3,9000);
INSERT INTO RGP_PREDICT VALUES (4,12000);
INSERT INTO RGP_PREDICT VALUES (5,14000);

TRUNCATE TABLE RGP_PREDICTED;

CALL _SYS_AFL.PAL_RGP (RGP_PREDICT, RG_PARAMS, RG_COEFF, RGP_PREDICTED) WITH OVERVIEW;

posted on 2013-05-16 10:54  沧海-重庆  阅读(726)  评论(0编辑  收藏  举报