internal SsaChangePointDetector(IHostEnvironment env, Options options) : base(new BaseArguments(options), LoaderSignature, env) { switch (InternalTransform.Martingale) { case MartingaleType.None: InternalTransform.AlertThreshold = Double.MaxValue; break; case MartingaleType.Power: InternalTransform.AlertThreshold = Math.Exp(InternalTransform.WindowSize * InternalTransform.LogPowerMartigaleBettingFunc(1 - options.Confidence / 100, InternalTransform.PowerMartingaleEpsilon)); break; case MartingaleType.Mixture: InternalTransform.AlertThreshold = Math.Exp(InternalTransform.WindowSize * InternalTransform.LogMixtureMartigaleBettingFunc(1 - options.Confidence / 100)); break; default: InternalTransform.Host.Assert(!Enum.IsDefined(typeof(MartingaleType), InternalTransform.Martingale)); throw InternalTransform.Host.ExceptUserArg(nameof(options.Martingale), "Value not defined."); } }
internal IidChangePointDetector(IHostEnvironment env, Options options) : base(new BaseArguments(options), LoaderSignature, env) { switch (InternalTransform.Martingale) { case MartingaleType.None: InternalTransform.AlertThreshold = Double.MaxValue; break; case MartingaleType.Power: InternalTransform.AlertThreshold = Math.Exp(InternalTransform.WindowSize * InternalTransform.LogPowerMartigaleBettingFunc(1 - options.Confidence / 100, InternalTransform.PowerMartingaleEpsilon)); break; case MartingaleType.Mixture: InternalTransform.AlertThreshold = Math.Exp(InternalTransform.WindowSize * InternalTransform.LogMixtureMartigaleBettingFunc(1 - options.Confidence / 100)); break; default: throw InternalTransform.Host.ExceptParam(nameof(options.Martingale), "The martingale type can be only (0) None, (1) Power or (2) Mixture."); } }