7.00.02 - SQL Statement to Create Model Table - 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)
CREATE DIMENSION TABLE  complaints_tokens_model  AS
  SELECT * FROM  NaiveBayesTextClassifierTrainer  (
    ON (SELECT * FROM NaiveBayesTextClassifierInternal (
      ON (SELECT doc_id, lower(token) AS token, category
        FROM  TextTokenizer  (
          ON  complaints  PARTITION BY ANY
          TextColumn ('text_data')
          OutputByWord ('true')
          Accumulate ('doc_id', 'category')
      )
    ) AS "TOKENS" PARTITION BY category
    TokenColumn ('token')
    ModelType ('Bernoulli')
    DocIDColumns ('doc_id')
    DocCategoryColumn ('category')
  )
) PARTITION BY 1) ORDER BY prob;