7.00.02 - SQL-MapReduce Call to Predict Outcomes of Test Table Data - 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)

You can provide the model table either as an input file (as in the first call) or in the Model attribute (as in the second call). When you provide the model table as an input file, you must specify PARTITION BY ANY and the Responses argument.

DROP TABLE IF EXISTS nb_iris_predict;

CREATE TABLE nb_iris_predict (PARTITION KEY(id)) AS
SELECT * FROM NaiveBayesPredict (
  ON nb_iris_input_test PARTITION BY ANY
  ON nb_iris_model AS model DIMENSION
  IDCol ('id')
  NumericInputs ('[1:4]')
  Responses ('virginica', 'setosa', 'versicolor')
) ORDER BY id;
DROP TABLE IF EXISTS nb_iris_predict;

CREATE TABLE nb_iris_predict (PARTITION KEY(id)) AS
SELECT * FROM NaiveBayesPredict (
  ON nb_iris_input_test
  Model ('nb_iris_model')
  IDCol ('id')
  NumericInputs ('[1:4]')
) ORDER BY id;