private async Task <AnomalyEntireDetectResult> GetBatchAnomalyDetectionResultAsync()
        {
            AnomalyDetectionRequest dataRequest = new AnomalyDetectionRequest
            {
                Sensitivity     = (int)sensitivitySlider.Value,
                MaxAnomalyRatio = curScenario.MaxAnomalyRatio,
                Granularity     = curScenario.Granularity.ToString(),
                CustomInterval  = curScenario.CustomInterval,
                Period          = curScenario.Period,
                Series          = curScenario.AllData
            };

            return(await AnomalyDetectorHelper.GetBatchDetectionResult(dataRequest));
        }
        private async Task <AnomalyLastDetectResult> GetStreamingAnomalyDetectionResultAsync(int dataPointIndex)
        {
            if (dataPointIndex >= curScenario.MinIndexOfRequiredPoints)
            {
                AnomalyDetectionRequest dataRequest = new AnomalyDetectionRequest
                {
                    Sensitivity     = (int)sensitivitySlider.Value,
                    MaxAnomalyRatio = curScenario.MaxAnomalyRatio,
                    Granularity     = curScenario.Granularity.ToString(),
                    CustomInterval  = curScenario.CustomInterval,
                    Period          = curScenario.Period,
                    Series          = curScenario.AllData.GetRange(dataPointIndex - curScenario.MinIndexOfRequiredPoints, (curScenario.MinIndexOfRequiredPoints + 1))
                };

                return(await AnomalyDetectorHelper.GetStreamingDetectionResult(dataRequest));
            }

            return(null);
        }