Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Function NameDescriptionParametersExamples
CountOutputs the number of steam elements.
NameDescriptionDefault ValueOptional?

OUTPUT_ATTRIBUTES

The name for the output attribute.countTrue
['FUNCTION' = 'Count']

 

['FUNCTION' = 'Count', 'OUTPUT_ATTRIBUTES' = 'number_of_elements']
SumOutputs the sum of elements. 
NameDescriptionDefault ValueOptional?
INPUT_ATTRIBUTESThe single string or a list of the name(s) of the attribute(s) in the input tuples. By default, all input attributes are used. This could raise an error if attributes are not numeric.(all attributes)True
OUTPUT_ATTRIBUTESA single string or list of output attributes. By default, the string "Sum_" concatenated with the original input attribute name is used."Sum_" + intput attribute nameTrue

['FUNCTION' = 'Sum']

 

['FUNCTION' = 'Sum', 'INPUT_ATTRIBUTES' = 'value1']

 

['FUNCTION' = 'Sum', 'INPUT_ATTRIBUTES' = ['value1', 'value2']]

AvgAverage value (mean)TODO 
MinMin valueTODO 
MaxMax valueTODO 
TriggerThe tuple that triggers the output.TODO 
VarianceCalculates the varianceTODO 
TopKCalculates the top-K listTODO 
NestNests the valid elements as list.TODO 

 

Examples

Code Block
languagejs
linenumberstrue
counted = AGGREGATION({AGGREGATIONS = [['FUNCTION' = 'Count']], GROUP_BY = ['publisher', 'item']}, windowed)

...

Code Block
languagejs
linenumberstrue
counted = AGGREGATION({AGGREGATIONS = [['FUNCTION' = 'Count'], ['FUNCTION' = 'Sum', 'INPUT_ATTRIBUTES' = 'value1']], GROUP_BY = ['publisher', 'item']}, windowed)
Code Block
languagejs
linenumberstrue
/// count the number of items for each publisher
counted = AGGREGATION({AGGREGATIONS = [['FUNCTION' = 'Count']], GROUP_BY = ['publisher', 'item']}, windowed)
/// aggregate the 100 most frequent items for each publisher to an ordered list
TopKItemsByPublisher ::= AGGREGATION({AGGREGATIONS = [
	[
		'FUNCTION' = 'TopK',
		'TOP_K' = '100',                         /// number of items
		'SCORING_ATTRIBUTES' = 'Count',          /// the attribute name that defines the order
		'INPUT_ATTRIBUTES' = 'item',             /// do not use the whole input tuple, just use the 'item' attribute for creating the output top-k set
		'MIN_SCORE' = '0',                       /// remove items that reaches a score of 0 (due to the previous aggregation these are all items that has no valid tuple)
		'UNIQUE_ATTR'='item'                     /// use 'item' as a unique attribute. that means, a new tuple with an known items id replaces the previous value. (this is some kind of element window in this operator)
	]], GROUP_BY = ['publisher']}, counted)

 

Changing the way this operator outputs values

...