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