-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
EntireDetectResponse.cs
182 lines (170 loc) · 8.3 KB
/
EntireDetectResponse.cs
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.CognitiveServices.AnomalyDetector.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public partial class EntireDetectResponse
{
/// <summary>
/// Initializes a new instance of the EntireDetectResponse class.
/// </summary>
public EntireDetectResponse()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the EntireDetectResponse class.
/// </summary>
/// <param name="period">Frequency extracted from the series, zero
/// means no recurrent pattern has been found.</param>
/// <param name="expectedValues">ExpectedValues contain expected value
/// for each input point. The index of the array is consistent with the
/// input series.</param>
/// <param name="upperMargins">UpperMargins contain upper margin of
/// each input point. UpperMargin is used to calculate upperBoundary,
/// which equals to expectedValue + (100 - marginScale)*upperMargin.
/// Anomalies in response can be filtered by upperBoundary and
/// lowerBoundary. By adjusting marginScale value, less significant
/// anomalies can be filtered in client side. The index of the array is
/// consistent with the input series.</param>
/// <param name="lowerMargins">LowerMargins contain lower margin of
/// each input point. LowerMargin is used to calculate lowerBoundary,
/// which equals to expectedValue - (100 - marginScale)*lowerMargin.
/// Points between the boundary can be marked as normal ones in client
/// side. The index of the array is consistent with the input
/// series.</param>
/// <param name="isAnomaly">IsAnomaly contains anomaly properties for
/// each input point. True means an anomaly either negative or positive
/// has been detected. The index of the array is consistent with the
/// input series.</param>
/// <param name="isNegativeAnomaly">IsNegativeAnomaly contains anomaly
/// status in negative direction for each input point. True means a
/// negative anomaly has been detected. A negative anomaly means the
/// point is detected as an anomaly and its real value is smaller than
/// the expected one. The index of the array is consistent with the
/// input series.</param>
/// <param name="isPositiveAnomaly">IsPositiveAnomaly contain anomaly
/// status in positive direction for each input point. True means a
/// positive anomaly has been detected. A positive anomaly means the
/// point is detected as an anomaly and its real value is larger than
/// the expected one. The index of the array is consistent with the
/// input series.</param>
public EntireDetectResponse(int period, IList<double> expectedValues, IList<double> upperMargins, IList<double> lowerMargins, IList<bool> isAnomaly, IList<bool> isNegativeAnomaly, IList<bool> isPositiveAnomaly)
{
Period = period;
ExpectedValues = expectedValues;
UpperMargins = upperMargins;
LowerMargins = lowerMargins;
IsAnomaly = isAnomaly;
IsNegativeAnomaly = isNegativeAnomaly;
IsPositiveAnomaly = isPositiveAnomaly;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets frequency extracted from the series, zero means no
/// recurrent pattern has been found.
/// </summary>
[JsonProperty(PropertyName = "period")]
public int Period { get; set; }
/// <summary>
/// Gets or sets expectedValues contain expected value for each input
/// point. The index of the array is consistent with the input series.
/// </summary>
[JsonProperty(PropertyName = "expectedValues")]
public IList<double> ExpectedValues { get; set; }
/// <summary>
/// Gets or sets upperMargins contain upper margin of each input point.
/// UpperMargin is used to calculate upperBoundary, which equals to
/// expectedValue + (100 - marginScale)*upperMargin. Anomalies in
/// response can be filtered by upperBoundary and lowerBoundary. By
/// adjusting marginScale value, less significant anomalies can be
/// filtered in client side. The index of the array is consistent with
/// the input series.
/// </summary>
[JsonProperty(PropertyName = "upperMargins")]
public IList<double> UpperMargins { get; set; }
/// <summary>
/// Gets or sets lowerMargins contain lower margin of each input point.
/// LowerMargin is used to calculate lowerBoundary, which equals to
/// expectedValue - (100 - marginScale)*lowerMargin. Points between the
/// boundary can be marked as normal ones in client side. The index of
/// the array is consistent with the input series.
/// </summary>
[JsonProperty(PropertyName = "lowerMargins")]
public IList<double> LowerMargins { get; set; }
/// <summary>
/// Gets or sets isAnomaly contains anomaly properties for each input
/// point. True means an anomaly either negative or positive has been
/// detected. The index of the array is consistent with the input
/// series.
/// </summary>
[JsonProperty(PropertyName = "isAnomaly")]
public IList<bool> IsAnomaly { get; set; }
/// <summary>
/// Gets or sets isNegativeAnomaly contains anomaly status in negative
/// direction for each input point. True means a negative anomaly has
/// been detected. A negative anomaly means the point is detected as an
/// anomaly and its real value is smaller than the expected one. The
/// index of the array is consistent with the input series.
/// </summary>
[JsonProperty(PropertyName = "isNegativeAnomaly")]
public IList<bool> IsNegativeAnomaly { get; set; }
/// <summary>
/// Gets or sets isPositiveAnomaly contain anomaly status in positive
/// direction for each input point. True means a positive anomaly has
/// been detected. A positive anomaly means the point is detected as an
/// anomaly and its real value is larger than the expected one. The
/// index of the array is consistent with the input series.
/// </summary>
[JsonProperty(PropertyName = "isPositiveAnomaly")]
public IList<bool> IsPositiveAnomaly { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (ExpectedValues == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ExpectedValues");
}
if (UpperMargins == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "UpperMargins");
}
if (LowerMargins == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "LowerMargins");
}
if (IsAnomaly == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "IsAnomaly");
}
if (IsNegativeAnomaly == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "IsNegativeAnomaly");
}
if (IsPositiveAnomaly == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "IsPositiveAnomaly");
}
}
}
}