7.00.02 - 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
Release Date
September 2017
Content Type
Programming Reference
User Guide
Publication ID
B700-1022-700K
Language
English (United States)

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.