Split Input into Training and Testing Data Sets - Aster Analytics

Teradata Aster® Analytics Foundation User GuideUpdate 2

Product
Aster Analytics
Release Number
7.00.02
Published
September 2017
Language
English (United States)
Last Update
2018-04-17
dita:mapPath
uce1497542673292.ditamap
dita:ditavalPath
AA-notempfilter_pdf_output.ditaval
dita:id
B700-1022
lifecycle
previous
Product Category
Software

This code divides the 150 data rows into a training data set (80%) and a testing data set (20%):

DROP TABLE IF EXISTS gmm_iris_train;
DROP TABLE IF EXISTS gmm_iris_test;

CREATE TABLE gmm_iris_train AS
  SELECT * FROM gmm_iris_input WHERE id%5!=0;

CREATE TABLE gmm_iris_test AS
  SELECT * FROM gmm_iris_input WHERE id%5=0;
Alternatively, you can do the preceding task with the Sample or RandomSample function.