-
Notifications
You must be signed in to change notification settings - Fork 5
/
model.xml
128 lines (121 loc) · 5.34 KB
/
model.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<project name='project' pubsub='auto' threads='1' use-tagged-token='true'>
<description>
This example project is a basic demonstration of using the segmented correlation
algorithm. Segmented correlation is similar to autocorrelation. It specifies the
correlation between the elements of a series and others from the same series that
are separated from them by a specified interval. You can use segmented correlation
to find repeating patterns, such as the occurrence of a signal obscured by noise.
The calculate window enables a user to be able to calculate the segmented correlation
of variable values streaming over time.
This project contains a single continuous query composed of the following:
1. A source window that receives the data to be analyzed
2. A calculate window that calculates the segmented correlation of a variable
from an incoming data stream and publishes the results
</description>
<contqueries>
<contquery name='contquery' trace='w_calculate'>
<windows>
<window-source name='w_source' insert-only='true' autogen-key='false' index='pi_EMPTY'>
<description>
This source window receives the included example input data via a file socket
connector. The input stream is placed into four fields for each observation:
an ID that acts as the data stream's key, named id; an x coordinate of data
named x_c; a y coordinate of data named y_c; and an indicator variable named
indicator that signals when a segment of the series begins and ends.
</description>
<schema>
<fields>
<field name='id' type='int64' key='true'/>
<field name='x_c' type='double'/>
<field name='y_c' type='double'/>
<field name='indicator' type='int64'/>
</fields>
</schema>
<connectors>
<connector class='fs' name='publisher'>
<properties>
<property name='type'>pub</property>
<property name='fstype'>csv</property>
<property name='fsname'>input.csv</property>
<property name='transactional'>true</property>
<property name='blocksize'>1</property>
</properties>
</connector>
</connectors>
</window-source>
<window-calculate name="w_calculate" algorithm="SegmentedCorrelation" index='pi_EMPTY'>
<description>
The calculate window, w_calculate receives data events from the source window.
It publishes the calculated autocorrelation of the specified x variable according
to the specified segmented correlation algorithm properties. In this example, the
following algorithm parameters govern the segmented correlation algorithm:
sampleSize: Specifies the number of samples to run the correlation. If
indicator is not specified, then the input data stream is
divided into segments of size sampleSize, and the correlation
is performed on adjacent segments. If indicator is specified,
then the input data stream is first divided into segments on
events when indicator=1. If sampleSize is smaller than 1, then
correlation is performed on all adjacent segments. Otherwise
segments are further divided into subsegments of size sampleSize
(the size of the last subsegment can be smaller than sampleSize).
Then correlation is computed on the first set of subsegments in
adjacent segments, the second set of subsegments, and so on.
minSize: Specifies the lower bound of the number of samples to run the
correlation.
maxSize: Specifies the upper bound of the number of samples to run the
correlation.
Additionally, the following input-map and output-map properties define the segmented
correlation algorithm in this calculate window:
x: Specifies the input variable for the segmented correlation.
indicator: Specifies the input variable for the segment indicator. The variable
value should be 1 when an old segment ends and a new segment begins
and 0 otherwise.
corOut: Specifies the output variable name for the segmented correlation.
The computed segmented correlation values are written to the file result.out via a
file socket connector.
</description>
<schema>
<fields>
<field name='id' type='int64' key='true'/>
<field name='y_c' type='double'/>
<field name='x_c' type='double'/>
<field name='corOut' type='double'/>
</fields>
</schema>
<parameters>
<properties>
<property name="sampleSize">4</property>
<property name="minSize">0</property>
<property name="maxSize">100</property>
</properties>
</parameters>
<input-map>
<properties>
<property name="x">x_c</property>
<property name="indicator">indicator</property>
</properties>
</input-map>
<output-map>
<properties>
<property name="corOut">corOut</property>
</properties>
</output-map>
<connectors>
<connector class='fs' name='sub'>
<properties>
<property name='type'>sub</property>
<property name='fstype'>csv</property>
<property name='fsname'>result.out</property>
<property name='snapshot'>true</property>
<property name='header'>true</property>
</properties>
</connector>
</connectors>
</window-calculate>
</windows>
<edges>
<edge source='w_source' target='w_calculate' role='data'/>
</edges>
</contquery>
</contqueries>
</project>