Esempio n. 1
0
            private protected override void CloneCore(StateBase state)
            {
                base.CloneCore(state);
                Contracts.Assert(state is State);
                var stateLocal = state as State;

                stateLocal.WindowedBuffer        = WindowedBuffer.Clone();
                stateLocal.InitialWindowedBuffer = InitialWindowedBuffer.Clone();
                if (_model != null)
                {
                    _parentAnomalyDetector.Model = _parentAnomalyDetector.Model.Clone();
                    _model = _parentAnomalyDetector.Model;
                }
            }
Esempio n. 2
0
        public SsaAnomalyDetectionBase(SsaArguments args, string name, IHostEnvironment env)
            : base(args.WindowSize, 0, args.Source, args.Name, name, env, args.Side, args.Martingale, args.AlertOn, args.PowerMartingaleEpsilon, args.AlertThreshold)
        {
            Host.CheckUserArg(2 <= args.SeasonalWindowSize, nameof(args.SeasonalWindowSize), "Must be at least 2.");
            Host.CheckUserArg(0 <= args.DiscountFactor && args.DiscountFactor <= 1, nameof(args.DiscountFactor), "Must be in the range [0, 1].");
            Host.CheckUserArg(Enum.IsDefined(typeof(ErrorFunctionUtils.ErrorFunction), args.ErrorFunction), nameof(args.ErrorFunction), ErrorFunctionUtils.ErrorFunctionHelpText);

            SeasonalWindowSize = args.SeasonalWindowSize;
            DiscountFactor     = args.DiscountFactor;
            ErrorFunction      = args.ErrorFunction;
            ErrorFunc          = ErrorFunctionUtils.GetErrorFunction(ErrorFunction);
            IsAdaptive         = args.IsAdaptive;
            // Creating the master SSA model
            Model = new AdaptiveSingularSpectrumSequenceModeler(Host, args.InitialWindowSize, SeasonalWindowSize + 1, SeasonalWindowSize,
                                                                DiscountFactor, AdaptiveSingularSpectrumSequenceModeler.RankSelectionMethod.Exact, null, SeasonalWindowSize / 2, false, false);

            StateRef = new State();
            StateRef.InitState(WindowSize, InitialWindowSize, this, Host);
        }
Esempio n. 3
0
 private protected override void InitializeAnomalyDetector()
 {
     _parentAnomalyDetector = (SsaAnomalyDetectionBase)Parent;
     _model = _parentAnomalyDetector.Model;
 }