Time Series Search (TSS)
This page describes the Time Series Search (TSS) parameters as part of AI libs.
.ai.tss.tss
The .ai.tss.tss function 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):
|
Returns
Type |
Description |
---|---|
(float[]; long[]) |
List of distances and indexes |
Example
q
q)\l ai-libs/init.q
q).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
The .ai.tss.tssdist
function creates a list of sliding z-normalized distances.
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):
|
Returns
Type |
Description |
---|---|
float[] |
The TSS distances among all possible positions |
Example
q
q)\l ai-libs/init.q
q).ai.tss.tssdist[10?1f;3?1f;::]
0.1624568 0.6407308 0.9527249 0.8994361 0.6351341 0.8521289 0.9975543 0.8938303