Operator Normalize

Primitive operator image not displayed. Problem loading file: ../../image/tk$com.ibm.streams.timeseries/op$com.ibm.streams.timeseries.analysis$Normalize.svg

The Normalize operator incrementally estimates the means and variance and can normalize the time series to zero means and unit variance.

The Normalize operator can perform two functions:

  1. Produce and estimate means and variance for a specified period or all the time.
  2. Normalize the incoming time series to zero means and unit variance for a specified period or all the time.

The Normalize operator is a univariate operator.

Behavior in a consistent region

  • The Normalize operator is not supported in a consistent region. A warning occurs when you compile your streams processing application.
  • The operator cannot be the start of a consistent region. An error occurs when you compile your streams processing application.

Exceptions

The Normalize operator throws an exception in the following cases:

  • The value for the initSamples parameter is 0.
Examples

Summary

Ports
This operator has 1 input port and 1 output port.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator supports 3 parameters.

Required: initSamples, inputTimeSeries

Optional: partitionBy

Metrics
This operator does not report any metrics.

Properties

Implementation
C++
Threading
Always - Operator always provides a single threaded execution context.

Input Ports

Ports (0)

This port consumes the input time series to be normalized. The inputTimeSeries parameter specifies the name of the attribute on this port that contains the time series data. The accepted data types are float64 and list<float64>.

Properties

Output Ports

Assignments
This operator allows any SPL expression of the correct type to be assigned to output attributes.
Output Functions
normalizeFunctions
<any T> T AsIs(T v)

The default function for output attributes. By default, this function assigns the output attribute to the value of the input attribute with the same name.

<any T> T normalizedTimeSeries()

Returns normalized time series values. Each value in the list is the normalized value of the input data that shares an index.

<any T> T means()

Returns the estimated mean values. The value that is stored at index n is the mean value, which is calculated for the input time series that is stored at index n.

<any T> T variance()

Returns the estimated variance values. The value that is stored at index n is the variance value, which is calculated for the input time series that is stored at index n.

Ports (0)

This port submits a tuple that contains the normalized timeseries. This port submits a tuple each time a timeseries is normalized. Custom output functions are used to specify the value of the output tuple attributes. The output tuple attributes whose assignments are not specified are assigned from input attributes.

Properties

Parameters

This operator supports 3 parameters.

Required: initSamples, inputTimeSeries

Optional: partitionBy

initSamples

Specifies the number of time series input values that are used by the algorithm to determine the value of means and variances. After the means and variance are calculated by the algorithm, these values are used to normalize the next arriving input time series. The estimation of means and variances is stopped after initSamples.

Properties

inputTimeSeries

Specifies the name of the attribute that contains the time series data in the input tuple. The supported data types are float64 and list<float64>.

Properties

partitionBy

Specifies the name of the attribute that contains the key values that are associated with the time series values in the input tuple.

Properties

Code Templates

Normalize

stream<${schema}> ${outputStream} = Normalize(${inputStream}) 
{
	param
		initSamples:		${initSeasonExpression};
		inputTimeSeries: ${timeSeriesAttributeExpression};
	output
		${outputStream}: ${outputExpression};
}
      

Libraries

No description for library.
Library Name: tsatapi
Library Path: ../../../impl/lib
Include Path: ../../../impl/include