25.10.2016 Views

SAP HANA Predictive Analysis Library (PAL)

sap_hana_predictive_analysis_library_pal_en

sap_hana_predictive_analysis_library_pal_en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INSERT INTO <strong>PAL</strong>_GMM_PDATA_TBL VALUES (1,'DM_<strong>PAL</strong>','<strong>PAL</strong>_GMM_DATA_T', 'IN');<br />

INSERT INTO <strong>PAL</strong>_GMM_PDATA_TBL VALUES (2,'DM_<strong>PAL</strong>','<strong>PAL</strong>_CONTROL_T', 'IN');<br />

INSERT INTO <strong>PAL</strong>_GMM_PDATA_TBL VALUES (3,'DM_<strong>PAL</strong>','<strong>PAL</strong>_GMM_INIT_T', 'IN');<br />

INSERT INTO <strong>PAL</strong>_GMM_PDATA_TBL VALUES (4,'DM_<strong>PAL</strong>','<strong>PAL</strong>_GMM_RESULTS_T', 'OUT');<br />

INSERT INTO <strong>PAL</strong>_GMM_PDATA_TBL VALUES (5,'DM_<strong>PAL</strong>','<strong>PAL</strong>_GMM_RESULTSMODEL_T',<br />

'OUT');<br />

CALL SYS.AFLLANG_WRAPPER_PROCEDURE_DROP('DM_<strong>PAL</strong>','<strong>PAL</strong>_GMM');<br />

CALL SYS.AFLLANG_WRAPPER_PROCEDURE_CREATE('AFL<strong>PAL</strong>', 'GMM', 'DM_<strong>PAL</strong>', '<strong>PAL</strong>_GMM',<br />

<strong>PAL</strong>_GMM_PDATA_TBL);<br />

DROP TABLE <strong>PAL</strong>_GMM_DATA_TBL;<br />

CREATE COLUMN TABLE <strong>PAL</strong>_GMM_DATA_TBL LIKE <strong>PAL</strong>_GMM_DATA_T;<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(0,0.10,0.10,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(1,0.11,0.10,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(2,0.10,0.11,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(3,0.11,0.11,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(4,0.12,0.11,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(5,0.11,0.12,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(6,0.12,0.12,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(7,0.12,0.13,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(8,0.13,0.12,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(9,0.13,0.13,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(10,0.13,0.14,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(11,0.14,0.13,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(12,10.10,10.10,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(13,10.11,10.10,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(14,10.10,10.11,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(15,10.11,10.11,'A');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(16,10.11,10.12,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(17,10.12,10.11,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(18,10.12,10.12,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(19,10.12,10.13,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(20,10.13,10.12,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(21,10.13,10.13,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(22,10.13,10.14,'B');<br />

INSERT INTO <strong>PAL</strong>_GMM_DATA_TBL VALUES(23,10.14,10.13,'B');<br />

DROP TABLE <strong>PAL</strong>_GMM_INIT_TBL;<br />

CREATE COLUMN TABLE <strong>PAL</strong>_GMM_INIT_TBL LIKE <strong>PAL</strong>_GMM_INIT_T;<br />

INSERT INTO <strong>PAL</strong>_GMM_INIT_TBL VALUES(0,2);<br />

DROP TABLE #<strong>PAL</strong>_CONTROL_TBL;<br />

CREATE LOCAL TEMPORARY COLUMN TABLE #<strong>PAL</strong>_CONTROL_TBL LIKE <strong>PAL</strong>_CONTROL_T;<br />

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES('THREAD_NUMBER',2,null,null);<br />

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES('MAX_ITERATION',500,null,null);<br />

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES('INIT_MODE',0,null,null);<br />

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES('ERROR_TOL',null,0.001,null);<br />

DROP TABLE <strong>PAL</strong>_GMM_RESULTS_TBL;<br />

CREATE COLUMN TABLE <strong>PAL</strong>_GMM_RESULTS_TBL LIKE <strong>PAL</strong>_GMM_RESULTS_T;<br />

DROP TABLE <strong>PAL</strong>_GMM_RESULTSMODEL_TBL;<br />

CREATE COLUMN TABLE <strong>PAL</strong>_GMM_RESULTSMODEL_TBL LIKE <strong>PAL</strong>_GMM_RESULTSMODEL_T;<br />

CALL DM_<strong>PAL</strong>.<strong>PAL</strong>_GMM(<strong>PAL</strong>_GMM_DATA_TBL, #<strong>PAL</strong>_CONTROL_TBL,<br />

<strong>PAL</strong>_GMM_INIT_TBL,<strong>PAL</strong>_GMM_RESULTS_TBL,<strong>PAL</strong>_GMM_RESULTSMODEL_TBL) with OVERVIEW;<br />

SELECT * FROM <strong>PAL</strong>_GMM_RESULTS_TBL;<br />

SELECT * FROM <strong>PAL</strong>_GMM_RESULTSMODEL_TBL;<br />

Expected Results<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Predictive</strong> <strong>Analysis</strong> <strong>Library</strong> (<strong>PAL</strong>)<br />

<strong>PAL</strong> Functions P U B L I C 59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!