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>_KMEDIANS_DATA_TBL VALUES (6 , 1.5, 'B', 15.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (7 , 1.5, 'B', 16.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (8 , 0.5, 'B', 16.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (9 , 1.2, 'C', 16.1);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (10, 15.5, 'C', 15.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (11, 16.5, 'C', 15.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (12, 16.5, 'C', 16.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (13, 15.5, 'C', 16.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (14, 15.6, 'D', 16.2);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (15, 15.5, 'D', 0.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (16, 16.5, 'D', 0.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (17, 16.5, 'D', 1.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (18, 15.5, 'D', 1.5);<br />

INSERT INTO <strong>PAL</strong>_KMEDIANS_DATA_TBL VALUES (19, 15.7, 'A', 1.6);<br />

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

CREATE LOCAL TEMPORARY COLUMN TABLE #<strong>PAL</strong>_CONTROL_TBL(<br />

"NAME" VARCHAR(100),<br />

"INTARGS" INTEGER,<br />

"DOUBLEARGS" DOUBLE,<br />

"STRINGARGS" VARCHAR(100)<br />

);<br />

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

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES ('GROUP_NUMBER', 4, NULL, NULL);<br />

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES ('INIT_TYPE', 1, NULL, NULL);<br />

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

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

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES ('EXIT_THRESHOLD', NULL, 1.0E-6, NULL);<br />

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

INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES ('CATEGORY_WEIGHTS', NULL, 0.5, NULL);<br />

--INSERT INTO #<strong>PAL</strong>_CONTROL_TBL VALUES ('MINKOWSKI_POWER', NULL, 3, NULL);<br />

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

CREATE COLUMN TABLE <strong>PAL</strong>_KMEDIANS_ASSIGN_TBL LIKE <strong>PAL</strong>_KMEDIANS_ASSIGN_T;<br />

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

CREATE COLUMN TABLE <strong>PAL</strong>_KMEDIANS_CENTERS_TBL LIKE <strong>PAL</strong>_KMEDIANS_CENTERS_T;<br />

--CALL PROCEDURE<br />

CALL DM_<strong>PAL</strong>.<strong>PAL</strong>_KMEDIANS_PROC(<strong>PAL</strong>_KMEDIANS_DATA_TBL, "#<strong>PAL</strong>_CONTROL_TBL",<br />

<strong>PAL</strong>_KMEDIANS_ASSIGN_TBL, <strong>PAL</strong>_KMEDIANS_CENTERS_TBL) WITH OVERVIEW;<br />

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

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

Expected Results<br />

<strong>PAL</strong>_KMEDIANS_CENTERS_TBL:<br />

82 P U B L I C<br />

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

<strong>PAL</strong> Functions

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

Saved successfully!

Ooh no, something went wrong!