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>_CM_DATA_TBL VALUES(4,1,2);<br />

INSERT INTO <strong>PAL</strong>_CM_DATA_TBL VALUES(5,1,1);<br />

INSERT INTO <strong>PAL</strong>_CM_DATA_TBL VALUES(6,2,2);<br />

INSERT INTO <strong>PAL</strong>_CM_DATA_TBL VALUES(7,2,1);<br />

INSERT INTO <strong>PAL</strong>_CM_DATA_TBL VALUES(8,2,2);<br />

INSERT INTO <strong>PAL</strong>_CM_DATA_TBL VALUES(9,2,2);<br />

INSERT INTO <strong>PAL</strong>_CM_DATA_TBL VALUES(10,2,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('BETA',NULL,1,null);<br />

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

CREATE COLUMN TABLE <strong>PAL</strong>_CM_CONFUSIONMATRIX_TBL LIKE <strong>PAL</strong>_CM_CONFUSIONMATRIX_T;<br />

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

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

<strong>PAL</strong>_CM_CLASSIFICATIONREPORT_T;<br />

CALL DM_<strong>PAL</strong>.<strong>PAL</strong>_CM(<strong>PAL</strong>_CM_DATA_TBL, #<strong>PAL</strong>_CONTROL_TBL,<br />

<strong>PAL</strong>_CM_CONFUSIONMATRIX_TBL,<strong>PAL</strong>_CM_CLASSIFICATIONREPORT_TBL) with OVERVIEW;<br />

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

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

Expected Results<br />

<strong>PAL</strong>_CM_CONFUSIONMATRIX_TBL:<br />

<strong>PAL</strong>_CM_CLASSIFICATIONREPORT_TBL:<br />

3.2.7 KNN<br />

K-Nearest Neighbor (KNN) is a memory based classification method with no explicit training phase. In the<br />

testing phase, given a query sample x, its top K nearest samples is found in the training set first, then the label<br />

of x is assigned as the most frequent label of the K nearest neighbors. In this release of <strong>PAL</strong>, the description of<br />

each sample should be real numbers. In order to speed up the search, the KD-tree searching method is<br />

provided.<br />

Prerequisites<br />

●<br />

●<br />

The first column of the training data and input data is an ID column. The second column of the training<br />

data is of class type. The class type column is of integer type. Other data columns are of integer or double<br />

type.<br />

The input data does not contain null value.<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 161

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

Saved successfully!

Ooh no, something went wrong!