2 writes to Host
Microsoft.ML.TimeSeries (2)
SequentialTransformerBase.cs (2)
359
Host
= host;
385
Host
= host;
161 references to Host
Microsoft.ML.TimeSeries (161)
IidAnomalyDetectionBase.cs (8)
106
StateRef.InitState(WindowSize, InitialWindowSize, this,
Host
);
113
Host
.CheckDecode(InitialWindowSize == 0);
115
StateRef.InitState(this,
Host
);
121
Host
.CheckValue(inputSchema, nameof(inputSchema));
124
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "input", InputColumnName);
128
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "input", InputColumnName, NumberDataViewType.Single.ToString(), colType.ToString());
130
return Transform(new EmptyDataView(
Host
, inputSchema)).Schema;
141
Host
.Assert(InitialWindowSize == 0);
IidChangePointDetector.cs (7)
114
clone.InternalTransform.StateRef.InitState(clone.InternalTransform, InternalTransform.
Host
);
133
throw InternalTransform.
Host
.ExceptParam(nameof(options.Martingale),
164
InternalTransform.
Host
.CheckDecode(InternalTransform.ThresholdScore == AlertingScore.MartingaleScore);
165
InternalTransform.
Host
.CheckDecode(InternalTransform.Side == AnomalySide.TwoSided);
175
InternalTransform.
Host
.CheckValue(ctx, nameof(ctx));
179
InternalTransform.
Host
.Assert(InternalTransform.ThresholdScore == AlertingScore.MartingaleScore);
180
InternalTransform.
Host
.Assert(InternalTransform.Side == AnomalySide.TwoSided);
IidSpikeDetector.cs (4)
110
clone.InternalTransform.StateRef.InitState(clone.InternalTransform, InternalTransform.
Host
);
146
InternalTransform.
Host
.CheckDecode(InternalTransform.ThresholdScore == AlertingScore.PValueScore);
156
InternalTransform.
Host
.CheckValue(ctx, nameof(ctx));
160
InternalTransform.
Host
.Assert(InternalTransform.ThresholdScore == AlertingScore.PValueScore);
SequentialAnomalyDetectionTransformBase.cs (35)
173
Host
.CheckUserArg(Enum.IsDefined(typeof(MartingaleType), martingale), nameof(ArgumentsBase.Martingale), "Value is undefined.");
174
Host
.CheckUserArg(Enum.IsDefined(typeof(AnomalySide), anomalySide), nameof(ArgumentsBase.Side), "Value is undefined.");
175
Host
.CheckUserArg(Enum.IsDefined(typeof(AlertingScore), alertingScore), nameof(ArgumentsBase.AlertOn), "Value is undefined.");
176
Host
.CheckUserArg(martingale != MartingaleType.None || alertingScore != AlertingScore.MartingaleScore, nameof(ArgumentsBase.Martingale), "A martingale type should be specified if alerting is based on the martingale score.");
177
Host
.CheckUserArg(windowSize > 0 || alertingScore == AlertingScore.RawScore, nameof(ArgumentsBase.AlertOn),
180
Host
.CheckUserArg(0 < powerMartingaleEpsilon && powerMartingaleEpsilon < 1, nameof(ArgumentsBase.PowerMartingaleEpsilon), "Should be in (0,1).");
181
Host
.CheckUserArg(alertThreshold >= 0, nameof(ArgumentsBase.AlertThreshold), "Must be non-negative.");
182
Host
.CheckUserArg(alertingScore != AlertingScore.PValueScore || (0 <= alertThreshold && alertThreshold <= 1), nameof(ArgumentsBase.AlertThreshold), "Must be in [0,1].");
189
OutputLength = GetOutputLength(ThresholdScore,
Host
);
211
Host
.CheckDecode(Enum.IsDefined(typeof(MartingaleType), temp));
215
Host
.CheckDecode(Enum.IsDefined(typeof(AlertingScore), temp));
218
Host
.CheckDecode(Martingale != MartingaleType.None || ThresholdScore != AlertingScore.MartingaleScore);
219
Host
.CheckDecode(WindowSize > 0 || ThresholdScore == AlertingScore.RawScore);
222
Host
.CheckDecode(Enum.IsDefined(typeof(AnomalySide), temp));
226
Host
.CheckDecode(0 < PowerMartingaleEpsilon && PowerMartingaleEpsilon < 1);
229
Host
.CheckDecode(AlertThreshold >= 0);
230
Host
.CheckDecode(ThresholdScore != AlertingScore.PValueScore || (0 <= AlertThreshold && AlertThreshold <= 1));
232
OutputLength = GetOutputLength(ThresholdScore,
Host
);
237
Host
.CheckValue(ctx, nameof(ctx));
240
Host
.Assert(Enum.IsDefined(typeof(MartingaleType), Martingale));
241
Host
.Assert(Enum.IsDefined(typeof(AlertingScore), ThresholdScore));
242
Host
.Assert(Martingale != MartingaleType.None || ThresholdScore != AlertingScore.MartingaleScore);
243
Host
.Assert(WindowSize > 0 || ThresholdScore == AlertingScore.RawScore);
244
Host
.Assert(Enum.IsDefined(typeof(AnomalySide), Side));
245
Host
.Assert(0 < PowerMartingaleEpsilon && PowerMartingaleEpsilon < 1);
246
Host
.Assert(AlertThreshold >= 0);
247
Host
.Assert(ThresholdScore != AlertingScore.PValueScore || (0 <= AlertThreshold && AlertThreshold <= 1));
274
Host
.Assert(MinPValue > 0);
275
Host
.Assert(MaxPValue < 1);
276
Host
.Assert(MinPValue <= p && p <= MaxPValue);
277
Host
.Assert(0 < epsilon && epsilon < 1);
290
Host
.Assert(MinPValue > 0);
291
Host
.Assert(MaxPValue < 1);
292
Host
.Assert(MinPValue <= p && p <= MaxPValue);
298
internal override IStatefulRowMapper MakeRowMapper(DataViewSchema schema) => new Mapper(
Host
, this, schema);
SequentialForecastingTransformBase.cs (2)
85
Host
.CheckValue(ctx, nameof(ctx));
95
internal override IStatefulRowMapper MakeRowMapper(DataViewSchema schema) => new Mapper(
Host
, this, schema);
SequentialTransformerBase.cs (20)
360
Host
.CheckParam(initialWindowSize >= 0, nameof(initialWindowSize), "Must be non-negative.");
361
Host
.CheckParam(windowSize >= 0, nameof(windowSize), "Must be non-negative.");
364
Host
.CheckNonEmpty(inputColumnName, nameof(PercentileThresholdTransform.Arguments.Source));
365
Host
.CheckNonEmpty(outputColumnName, nameof(PercentileThresholdTransform.Arguments.Source));
386
Host
.CheckValue(ctx, nameof(ctx));
396
Host
.CheckDecode(windowSize >= 0);
399
Host
.CheckDecode(initialWindowSize >= 0);
411
BinarySaver bs = new BinarySaver(
Host
, new BinarySaver.Arguments());
419
Host
.CheckValue(ctx, nameof(ctx));
420
Host
.Assert(InitialWindowSize >= 0);
421
Host
.Assert(WindowSize >= 0);
436
var bs = new BinarySaver(
Host
, new BinarySaver.Arguments());
446
Host
.CheckValue(input, nameof(input));
447
return new SequentialDataTransform(
Host
, this, input, MakeRowMapper(input.Schema));
459
Host
.CheckValue(inputSchema, nameof(inputSchema));
460
return new TimeSeriesRowToRowMapperTransform(
Host
, new EmptyDataView(
Host
, inputSchema), MakeRowMapper(inputSchema));
478
: base(parent.
Host
, input)
482
_transform = CreateLambdaTransform(_parent.
Host
, input, _parent.InputColumnName,
560
state.InitState(_parent.WindowSize, _parent.InitialWindowSize, _parent, _parent.
Host
);
SrCnnAnomalyDetectionBase.cs (6)
98
StateRef.InitState(WindowSize, InitialWindowSize, this,
Host
);
106
StateRef.InitState(this,
Host
);
112
Host
.CheckValue(inputSchema, nameof(inputSchema));
115
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "input", InputColumnName);
119
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "input", InputColumnName, NumberDataViewType.Single.ToString(), colType.ToString());
121
return Transform(new EmptyDataView(
Host
, inputSchema)).Schema;
SRCNNAnomalyDetector.cs (2)
146
clone.InternalTransform.StateRef.InitState(clone.InternalTransform, InternalTransform.
Host
);
167
InternalTransform.
Host
.CheckValue(ctx, nameof(ctx));
SrCnnTransformBase.cs (19)
73
Host
.CheckUserArg(backAddWindowSize > 0, nameof(SrCnnArgumentBase.BackAddWindowSize), "Must be non-negative");
74
Host
.CheckUserArg(lookaheadWindowSize > 0 && lookaheadWindowSize <= windowSize, nameof(SrCnnArgumentBase.LookaheadWindowSize), "Must be non-negative and not larger than window size");
75
Host
.CheckUserArg(averagingWindowSize > 0 && averagingWindowSize <= windowSize, nameof(SrCnnArgumentBase.AvergingWindowSize), "Must be non-negative and not larger than window size");
76
Host
.CheckUserArg(judgementWindowSize > 0 && judgementWindowSize <= windowSize, nameof(SrCnnArgumentBase.JudgementWindowSize), "Must be non-negative and not larger than window size");
77
Host
.CheckUserArg(alertThreshold > 0 && alertThreshold < 1, nameof(SrCnnArgumentBase.Threshold), "Must be in (0,1)");
96
Host
.CheckDecode(BackAddWindowSize > 0);
100
Host
.CheckDecode(LookaheadWindowSize > 0);
104
Host
.CheckDecode(AvergingWindowSize > 0);
108
Host
.CheckDecode(JudgementWindowSize > 0);
111
Host
.CheckDecode(AlertThreshold >= 0 && AlertThreshold <= 1);
122
Host
.CheckValue(ctx, nameof(ctx));
125
Host
.Assert(WindowSize > 0);
126
Host
.Assert(InitialWindowSize == WindowSize);
127
Host
.Assert(BackAddWindowSize > 0);
128
Host
.Assert(LookaheadWindowSize > 0);
129
Host
.Assert(AvergingWindowSize > 0);
130
Host
.Assert(JudgementWindowSize > 0);
131
Host
.Assert(AlertThreshold >= 0 && AlertThreshold <= 1);
141
internal override IStatefulRowMapper MakeRowMapper(DataViewSchema schema) => new Mapper(
Host
, this, schema);
SsaAnomalyDetectionBase.cs (21)
194
Host
.CheckUserArg(2 <= options.SeasonalWindowSize, nameof(options.SeasonalWindowSize), "Must be at least 2.");
195
Host
.CheckUserArg(0 <= options.DiscountFactor && options.DiscountFactor <= 1, nameof(options.DiscountFactor), "Must be in the range [0, 1].");
196
Host
.CheckUserArg(Enum.IsDefined(typeof(ErrorFunction), options.ErrorFunction), nameof(options.ErrorFunction), ErrorFunctionUtils.ErrorFunctionHelpText);
204
Model = new AdaptiveSingularSpectrumSequenceModelerInternal(
Host
, options.InitialWindowSize, SeasonalWindowSize + 1, SeasonalWindowSize,
208
StateRef.InitState(WindowSize, InitialWindowSize, this,
Host
);
223
Host
.CheckDecode(InitialWindowSize == 0);
226
Host
.CheckDecode(2 <= SeasonalWindowSize);
229
Host
.CheckDecode(0 <= DiscountFactor && DiscountFactor <= 1);
233
Host
.CheckDecode(Enum.IsDefined(typeof(ErrorFunction), temp));
241
Host
.CheckDecode(Model != null);
242
StateRef.InitState(this,
Host
);
247
Host
.CheckValue(inputSchema, nameof(inputSchema));
250
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "input", InputColumnName);
254
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "input", InputColumnName, "Single", colType.ToString());
256
return Transform(new EmptyDataView(
Host
, inputSchema)).Schema;
266
Host
.CheckValue(ctx, nameof(ctx));
269
Host
.Assert(InitialWindowSize == 0);
270
Host
.Assert(2 <= SeasonalWindowSize);
271
Host
.Assert(0 <= DiscountFactor && DiscountFactor <= 1);
272
Host
.Assert(Enum.IsDefined(typeof(ErrorFunction), ErrorFunction));
273
Host
.Assert(Model != null);
SsaChangePointDetector.cs (12)
124
clone.InternalTransform.StateRef.InitState(clone.InternalTransform, InternalTransform.
Host
);
143
InternalTransform.
Host
.Assert(!Enum.IsDefined(typeof(MartingaleType), InternalTransform.Martingale));
144
throw InternalTransform.
Host
.ExceptUserArg(nameof(options.Martingale), "Value not defined.");
174
InternalTransform.
Host
.CheckDecode(InternalTransform.ThresholdScore == AlertingScore.MartingaleScore);
175
InternalTransform.
Host
.CheckDecode(InternalTransform.Side == AnomalySide.TwoSided);
176
InternalTransform.
Host
.CheckDecode(InternalTransform.DiscountFactor == 1);
177
InternalTransform.
Host
.CheckDecode(InternalTransform.IsAdaptive == false);
182
InternalTransform.
Host
.CheckValue(ctx, nameof(ctx));
186
InternalTransform.
Host
.Assert(InternalTransform.ThresholdScore == AlertingScore.MartingaleScore);
187
InternalTransform.
Host
.Assert(InternalTransform.Side == AnomalySide.TwoSided);
188
InternalTransform.
Host
.Assert(InternalTransform.DiscountFactor == 1);
189
InternalTransform.
Host
.Assert(InternalTransform.IsAdaptive == false);
SSaForecasting.cs (4)
165
clone.InternalTransform.StateRef.InitState(clone.InternalTransform, InternalTransform.
Host
);
184
InternalTransform.
Host
.CheckDecode(InternalTransform.IsAdaptive == false);
189
InternalTransform.
Host
.CheckValue(ctx, nameof(ctx));
193
InternalTransform.
Host
.Assert(InternalTransform.IsAdaptive == false);
SsaForecastingBase.cs (13)
133
Host
.CheckUserArg(0 <= options.DiscountFactor && options.DiscountFactor <= 1, nameof(options.DiscountFactor), "Must be in the range [0, 1].");
138
Model = new AdaptiveSingularSpectrumSequenceModelerInternal(
Host
, options.TrainSize, options.SeriesLength, options.WindowSize,
143
StateRef.InitState(WindowSize, InitialWindowSize, this,
Host
);
157
Host
.CheckDecode(InitialWindowSize == 0);
165
Host
.CheckDecode(Model != null);
166
StateRef.InitState(this,
Host
);
171
Host
.CheckValue(inputSchema, nameof(inputSchema));
174
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "input", InputColumnName);
178
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "input", InputColumnName, "Single", colType.ToString());
180
return Transform(new EmptyDataView(
Host
, inputSchema)).Schema;
190
Host
.CheckValue(ctx, nameof(ctx));
193
Host
.Assert(InitialWindowSize == 0);
194
Host
.Assert(Model != null);
SsaSpikeDetector.cs (8)
137
clone.InternalTransform.StateRef.InitState(clone.InternalTransform, InternalTransform.
Host
);
157
InternalTransform.
Host
.CheckDecode(InternalTransform.ThresholdScore == AlertingScore.PValueScore);
158
InternalTransform.
Host
.CheckDecode(InternalTransform.DiscountFactor == 1);
159
InternalTransform.
Host
.CheckDecode(InternalTransform.IsAdaptive == false);
164
InternalTransform.
Host
.CheckValue(ctx, nameof(ctx));
168
InternalTransform.
Host
.Assert(InternalTransform.ThresholdScore == AlertingScore.PValueScore);
169
InternalTransform.
Host
.Assert(InternalTransform.DiscountFactor == 1);
170
InternalTransform.
Host
.Assert(InternalTransform.IsAdaptive == false);