-
11-12-2019 - |
解決
SAX 各ディメンションに別々に変換することができます。各タイムスタンプのシンボル/文字
(x、y、z、t)を取ります。たとえば、t= 1のb,a,c
の組み合わせ、次にT= 2などのa,a,c
を取得します。
そのシンボルを結合して、必要な場合は「Mega-Symbols」を形成することができます。シンボルのセットがSymbols={a,b,c}
であったとします。その後、新しい文字セットは単にデカルト製品SxSxS
(各ディメンション用)です。
つまり、aaa
は、A
としてのaab
、B
、aac
、aba
などです..
編集:
私が念頭に置いていたことを示すためのいくつかのコードです。 SAXアルゴリズムの実装がありませんので、プレースホルダーとして次の機能を使用します(Rubshishを返します):
%# use your actual SAX function instead of this one
my_sax_function = @(x,n,a) randi(a, [n 1]);
.
これはコードです:
%# time series of length=100, with (x,y,z) at each timestamp
data = cumsum(randn(100,3));
%# apply your SAX function to each dimension independently
N = 20; %# number of segments to divide the signal into
A = 3; %# size of alphabet (a,b,c)
dataSAX = zeros(N,3);
for i=1:3
dataSAX(:,i) = my_sax_function(data(:,i), N, A);
end
%# we assume the above function returns integers denoting the symbols
%# therefore row i corresponds to A=3 symbols for each of the 3 x/y/z dimensions
dataSAX(1,:)
%# build cartesian product of all combinations of the A=3 symbols
[x y z] = ndgrid(1:A,1:A,1:A);
cartProd = [x(:) y(:) z(:)];
%# map to the new alphabet with 3*3*3 = 27 symbols
[~,V] = ismember(dataSAX, cartProd, 'rows')
%# A to Z with $ character to make up 27 symbols
oldSymbols = {'a';'b';'c'}; %# 1: a, 2: b, 3: c
newSymbols = cellstr(['A':'Z' '$']'); %# 1: A, ..., 26: Z, 27: $
%# SAX representation of the entire time series as a string
mappedV = char(newSymbols(V))'
. 所属していません StackOverflow