7.00.02 - Split Input into Training and Testing Data Sets - Aster Analytics

Teradata Aster® Analytics Foundation User GuideUpdate 2

Aster Analytics
Release Number
Release Date
September 2017
Content Type
Programming Reference
User Guide
Publication ID
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.