BasketGenerator Syntax Elements - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.10
1.1
Published
October 2019
Language
English (United States)
Last Update
2019-12-31
dita:mapPath
ima1540829771750.ditamap
dita:ditavalPath
jsj1481748799576.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:

    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