tspy.ml.feature_vectors module

tspy.ml.feature_vectors.prepare(data_time_series, label_time_series, anchor, left_delta, right_delta, pos_perc=1.0, neg_perc=0.05, label_range=None, feature_range=None, with_replacement=False, flatten_vector=False)

Prepare feature vectors for training using traditional shallow models or deep learning models

Parameters
data_time_seriesMultiTimeSeries

multi-time-series containing the data vectors

label_time_seriesMultiTimeSeries

multi-time-series containing the labels

anchorfunc or time-series boolean expression

function or expression to denote a negative from positive label

left_deltaint

left delta time ticks to the left of the anchor point

right_deltaint

right delta time ticks to the right of the anchor point

pos_percfloat, optional

positive float between 0 and 1 representing the percentage of positive segments to take (default is 1.0)

neg_percfloat, optional

positive float between 0 and 1 representing the percentage of positive segments to take (default is 1.0)

label_rangetuple, optional

a tuple of the (offset_to_start, offset_to_end) for label. The offset will start from start of the segment (default is simple binary label)

feature_rangetuple, optional

a tuple of the (offset_to_start, offset_to_end) for feature. The offset will start from start of the segment (default is entire segment of vectors)

with_replacementbool, optional

if true, will allow for segments to overlap (default is false)

flatten_vectorbool, optional

if true, will flatten each feature vector and label (if label is a vector) each to a single vector (default is false)

Returns
list

a list of tuples, where each tuple contains the time-series key (str) - the key to the time-series for which the feature was found, label (int or nparray) binary value if no label-range given, otherwise an nparray representing the label vector, feature (nparray) an array representing the feature vector

tspy.ml.feature_vectors.prepare_predictions(data_time_series, left_delta, right_delta, label_range, feature_range=None, label_time_series=None, anchor=None, flatten_vector=False)