tspy.data_structures.stream_multi_time_series.SegmentStreamMultiTimeSeries module

class tspy.data_structures.stream_multi_time_series.SegmentStreamMultiTimeSeries.SegmentStreamMultiTimeSeries(tsc, j_stream_mts, trs=None)

Bases: tspy.data_structures.stream_multi_time_series.StreamMultiTimeSeries.StreamMultiTimeSeries

A special form of stream-multi-time-series that consists of observations with a value of type Segment

Methods

add_sink(multi_data_sink)

add a multi-data-sink to this piece of the streaming pipeline.

fillna(interpolator[, null_value])

produce a new stream-multi-time-series which is the result of filling all null values.

filter(func)

produce a new stream-multi-time-series which is the result of filtering by each observation’s value given a filter function.

flatmap(func)

produce a new stream-multi-time-series where each observation’s value in this stream-multi-time-series is mapped to 0 to N new values.

full_join(right_stream_mts[, join_func, …])

join two stream-multi-time-series based on a temporal full join strategy and optionally interpolate missing values

inner_join(right_stream_mts[, join_func])

join two stream-multi-time-series based on a temporal inner join strategy

interval_join(right_stream_mts, filter_func, …)

join two stream-multi-time-series where observations in the right stream lie within an interval of this stream.

left_join(right_stream_mts[, join_func, …])

join two stream-multi-time-series based on a temporal left join strategy and optionally interpolate missing values

left_outer_join(right_stream_mts[, …])

join two stream-multi-time-series based on a temporal left outer join strategy and optionally interpolate missing values

map(func)

produce a new stream-multi-time-series where each observation’s value in this stream-time-series is mapped to a new observation value

map_with_key(func)

produce a new stream-multi-time-series where each observation’s value in this stream-time-series is mapped given a key and value function to a new observation value

partition([num_partitions, …])

partition this stream-multi-time-series such that all partitions can be run on separate threads in parallel

peek()

Optionally get the most recent values in the queue without flushing the queue.

poll([polling_interval])

Get the most recent values in the queue.

resample(periodicity, interpolator)

produce a new stream-muliti-time-series by resampling the current stream-multi-time-series to a given periodicity

right_join(right_stream_mts[, join_func, …])

join two stream-multi-time-series based on a temporal right join strategy and optionally interpolate missing values

right_outer_join(right_stream_mts[, …])

join two stream-multi-time-series based on a temporal right outer join strategy and optionally interpolate missing values

run()

run the streaming pipeline

segment(window[, step])

produce a new segment-multi-time-series from a performing a sliding-based segmentation over each time-series.

segment_by_anchor(func, left_delta, right_delta)

produce a new segment-time-series from performing an anchor-based segmentation over each time-series.

segment_by_time(window[, step])

produce a new segment-time-series from a performing a time-based segmentation over each time-series

to_multi_observation_stream()

Returns

transform(reducer)

transform this stream-multi-time-series of segments into a stream-multi-time-series of values

transform_segments(transform)

produce a new segment-stream-multi-time-series where each segment is transformed to a new segment using a unary transform

with_trs([granularity, start_time])

create a new stream-multi-time-series with its timestamps mapped based on a granularity and start_time.

filter(func)

produce a new stream-multi-time-series which is the result of filtering by each observation’s value given a filter function.

Parameters
funcfunc

the filter on observation’s value function

Returns
StreamMultiTimeSeries

a new stream-multi-time-series

Notes

see filter() for usage

transform(reducer)

transform this stream-multi-time-series of segments into a stream-multi-time-series of values

Parameters
reducerreducer transform

a reducer transform as seen in reducers

Returns
StreamMultiTimeSeries

a new stream-multi-time-series

Notes

Because this observation values are of segment type, a reducer will be used (transform from segment to value)

transform_segments(transform)

produce a new segment-stream-multi-time-series where each segment is transformed to a new segment using a unary transform

Parameters
transformUnaryTransform

the transformation to apply on each segment of this segment-stream-multi-time-series

Returns
SegmentStreamMultiTimeSeries

a new segment-stream-multi-time-series