Time Series Search (TSS)

This page describes the Time Series Search (TSS) parameters as part of AI libs.

 

.ai.tss.tss

.ai.tss.tss[ts;q;k;opts]

Conducts a TSS search with z-normalization and returns K nearest neighbors.

Parameters

Name

Type(s)

Description

ts

short[] | int[] | long[] | float[] | real[]

The data vector

q

short[] | int[] | long[] | float[] | real[]

The query vector

k

short | long | int

The number of nearest neighbors to return

opts

dict

Advanced options (optional):

ignoreErrors (default false): if true, allows K > N (K set to N) and q longer than ts (returns empty).

returnMatches (default false): if true, returns list of distances, indexes, and matched patterns.

normalize (default true): if true, applies z-normalization to query and timeseries windows.

Returns

Type

Description

(float[]; long[])

List of distances and indexes

Example

q

Copy
 .ai.tss.tss[10?1f;3?1f;5;::]

 0.9182925 0.9312366 1.44556 2.310831 2.842262
 2         6         1       4        7

 

.ai.tss.tssdist

.ai.tss.tssdist[ts;q;opts]

Conducts a full TSS distance matrix without z-normalization.

Parameters

Name

Type(s)

Description

ts

short[] | int[] | long[] | float[] | real[]

The data vector

q

short[] | int[] | long[] | float[] | real[]

The query vector

opts

dict

Advanced options (optional):

normalize (default true): if true, applies z-normalization to query and timeseries windows.

Returns

Type

Description

float[]

The TSS distances among all possible positions

Example

q

Copy
 .ai.tss.tssdist[10?1f;3?1f;::]

 0.1624568 0.6407308 0.9527249 0.8994361 0.6351341 0.8521289 0.9975543 0.8938303