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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_PDATA_TBL VALUES<br />

(3,'DM_<strong>PAL</strong>','<strong>PAL</strong>_DISTRRANDOM_RESULT_T', 'OUT');<br />

call SYS.AFLLANG_WRAPPER_PROCEDURE_DROP('DM_<strong>PAL</strong>','<strong>PAL</strong>_DISTRRANDOM_PROC');<br />

call SYS.AFLLANG_WRAPPER_PROCEDURE_CREATE('AFL<strong>PAL</strong>','DISTRRANDOM',<br />

'DM_<strong>PAL</strong>','<strong>PAL</strong>_DISTRRANDOM_PROC', <strong>PAL</strong>_DISTRRANDOM_PDATA_TBL);<br />

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

CREATE COLUMN TABLE <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TBL LIKE<br />

<strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_T;<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TBL VALUES ('DistributionName',<br />

'UNIFORM');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TBL VALUES ('MIN', '2');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TBL VALUES ('MAX', '2.1');<br />

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

CREATE LOCAL TEMPORARY 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 ('NUM_RANDOM', 10000, null, null);<br />

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

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

CREATE COLUMN TABLE <strong>PAL</strong>_DISTRRANDOM_RESULT_TBL LIKE <strong>PAL</strong>_DISTRRANDOM_RESULT_T;<br />

CALL DM_<strong>PAL</strong>.<strong>PAL</strong>_DISTRRANDOM_PROC(<strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TBL,<br />

#<strong>PAL</strong>_CONTROL_TBL, <strong>PAL</strong>_DISTRRANDOM_RESULT_TBL) with overview;<br />

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

Expected Result<br />

3.6.9 Sampling<br />

In business scenarios the number of records in the database is usually quite large, and it is common to use a<br />

small portion of the records as representatives, so that a rough impression of the dataset can be given by<br />

analyzing sampling.<br />

This release of <strong>PAL</strong> provides eight sampling methods, including:<br />

●<br />

●<br />

●<br />

●<br />

●<br />

●<br />

●<br />

●<br />

First_N<br />

Middle_N<br />

Last_N<br />

Every_N th<br />

SimpleRandom_WithReplacement<br />

SimpleRandom_WithoutReplacement<br />

Systematic<br />

Stratified<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 469

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

Saved successfully!

Ooh no, something went wrong!