5.4 Shape discovery process
With the preparatory work completed, we can now proceed with the shape discovery task.
First, set the parameters:
Let Nm denote the combination of feature index names:
Nm=[f1,f2,…,fm]
where fi is the i-th feature index name.
Let Ag denote the range of values corresponding to the combination of feature indices:
Ag=[[a(1),b(1)], [a(2), b(2)],…, [a(m), b(m)]]
where a(i) and b(i) are the lower and upper limits of the i-th feature index, respectively.
The shape discovery process can be divided into three steps:
1. Parameter projection
Project all parameters in Ag onto the corresponding feature index values. Denote the projection result as Vl.
Vl=[[ F(a(1)), F(b(1))], [[F(a(2)), F(b(2))],…, [[F(a(m)), F(b(m))]]
where F(…) is the projection function.
2. Filter for specified shape curve segments Sp’
Let Id denote the indices of the specified shape curve segments:
Id=T.pselect@a(F(a(1))≤f(1)≤F(b(1))&&…&& F(a(m))≤f(m)≤F(b(m)))
Continuous indices belong to a single segment of the target shape, while discontinuous indices indicate another segment.
Let Ids denote the continuous index segments:
Ids=Id.group(~-#)
where f(i) is the value of the i-th feature index.
3. Filter by curve segment length
After filtering by feature indices, the feature index range may be satisfied, but the curve segment length may be too short or too long. Therefore, we need to filter the curve segments by length range.
Sp’(1)=[xa,xa+1,…,xa+a’-1]
Sp’(2)= [xb,xb+1,…,xb+b’-1]
…
Sp’(p)= [xp,xp+1,…,xp+p’-1]
where Sp’(j) represents the j-th curve segment filtered for the specified shape, and a’,b’,…represent the lengths of the corresponding curve segments.
Let dut denote the shape length range:
dut=[d1,d2]
Let Ids’ denote the continuous index segments that satisfy the length range:
Ids’=Ids.select(d1≤len(Sp’(j))≤d2)
Let Sp denote the curve segments with the specified shape:
Sp=Ids’.(X(~))
Step 1 (parameter projection) is not always necessary. For example, when filtering for curve segments where the original values fall within [90, 95], we only need to set ‘original value’ as the feature and filter by range. Feature indices mainly describe relative sizes, so setting them to values between [-1,1] is sufficient.
SPL Official Website 👉 https://www.esproc.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProcSPL
SPL Learning Material 👉 https://c.esproc.com
SPL Source Code and Package 👉 https://github.com/SPLWare/esProc
Discord 👉 https://discord.gg/sxd59A8F2W
Youtube 👉 https://www.youtube.com/@esProc_SPL