1.1 - 8.10 - BasketGenerator Syntax Elements - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)
TargetColumns
Specify the names of the input columns that contain the items to collect into baskets. If you specify multiple columns, the function treats every unique combination of column values as one item.

For example, you could specify only the column that contains the stock keeping unit (SKU) that identifies an item that was sold. Alternatively, you could specify the SKU column and the columns that contain the month manufactured, color and size.

BasketSize
[Optional] Specify the number of items to include in a basket (an INTEGER value).
Default: 2
Accumulate
[Optional] Specify the names of the input columns to copy to the output table. Each accumulate_column must be a partition_column; otherwise, the function is nondeterministic (for more information, see Nondeterministic Results and UniqueID Syntax Element). However, not every partition_column must be an accumulate_column.
OutputCombinations
[Optional] Specify whether the function returns a basket for each unique combination of items. If you specify 'false', the function returns a basket for each unique permutation of items.
In a combination, item order is irrelevant. For example, the baskets "tomatoes and basil" and "basil and tomatoes" are equivalent.
In a permutation, item order is relevant. For example, the baskets "tomatoes and basil" and "basil and tomatoes" are not equivalent.
The function returns combinations and permutations in lexicographical order.
If n is the number of distinct items that can appear in a basket and r is basket_size, then:
  • The maximum number of combinations is:

    n Cr or n!/(r!(n-r)!)

  • The maximum number of permutations is:

    n Pr or n!/(n-r)!)

If the number of combinations or permutations exceeds one million, the function outputs no rows.
Default: 'true'
MaxPartitionSize
[Optional] Specify the maximum number of items in a partition (an INTEGER value). If the number of items in a partition exceeds max_partition_size, the function ignores that partition.
Default: 100