BasketGenerator Syntax Elements - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢
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:

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

  • The maximum number of permutations is:

    nPr 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
MaxOutputCombinations
Specify the maximum number of combinations or permutations allowed in a transaction (an INTEGER value). The function ignores transactions with combinations or permutations greater than max_output_combinations.
Default: 1000000