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); }
public static async Task <AnomalyEntireDetectResult> GetBatchDetectionResult(AnomalyDetectionRequest dataRequest) { return(await HttpClientUtility.PostAsJsonAsync <AnomalyEntireDetectResult>(new Uri(endpoint + BATCH_SERVICE_URL), defaultRequestHeaders, dataRequest)); }
public static async Task <AnomalyLastDetectResult> GetStreamingDetectionResult(AnomalyDetectionRequest dataRequest) { return(await HttpClientUtility.PostAsJsonAsync <AnomalyLastDetectResult>(new Uri(endpoint + STREAMING_SERVICE_URL), defaultRequestHeaders, dataRequest)); }