@azure-rest/ai-anomaly-detector 1.0.0-alpha.20250110.1 → 1.0.0-alpha.20250113.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,12 +90,12 @@ The following section provides several code snippets covering some of the most c
|
|
|
90
90
|
### Batch detection
|
|
91
91
|
|
|
92
92
|
```ts snippet:batch_detection
|
|
93
|
-
import {
|
|
93
|
+
import AnomalyDetector, {
|
|
94
94
|
TimeSeriesPoint,
|
|
95
|
-
AnomalyDetector,
|
|
96
95
|
DetectUnivariateEntireSeriesParameters,
|
|
97
96
|
isUnexpected,
|
|
98
97
|
} from "@azure-rest/ai-anomaly-detector";
|
|
98
|
+
import { readFileSync } from "node:fs";
|
|
99
99
|
import { parse } from "csv-parse/sync";
|
|
100
100
|
import { AzureKeyCredential } from "@azure/core-auth";
|
|
101
101
|
|
|
@@ -105,7 +105,7 @@ const timeSeriesDataPath = "./samples-dev/example-data/request-data.csv";
|
|
|
105
105
|
|
|
106
106
|
function read_series_from_file(path: string): Array<TimeSeriesPoint> {
|
|
107
107
|
const result = Array<TimeSeriesPoint>();
|
|
108
|
-
const input =
|
|
108
|
+
const input = readFileSync(path).toString();
|
|
109
109
|
const parsed = parse(input, { skip_empty_lines: true });
|
|
110
110
|
parsed.forEach(function (e: Array<string>) {
|
|
111
111
|
result.push({ timestamp: new Date(e[0]), value: Number(e[1]) });
|
|
@@ -149,12 +149,12 @@ if (result.body.isAnomaly) {
|
|
|
149
149
|
### Streaming Detection
|
|
150
150
|
|
|
151
151
|
```ts snippet:streaming_detection
|
|
152
|
-
import {
|
|
152
|
+
import AnomalyDetector, {
|
|
153
153
|
TimeSeriesPoint,
|
|
154
|
-
AnomalyDetector,
|
|
155
154
|
DetectUnivariateLastPointParameters,
|
|
156
155
|
isUnexpected,
|
|
157
156
|
} from "@azure-rest/ai-anomaly-detector";
|
|
157
|
+
import { readFileSync } from "node:fs";
|
|
158
158
|
import { parse } from "csv-parse/sync";
|
|
159
159
|
import { AzureKeyCredential } from "@azure/core-auth";
|
|
160
160
|
|
|
@@ -164,7 +164,7 @@ const timeSeriesDataPath = "./samples-dev/example-data/request-data.csv";
|
|
|
164
164
|
|
|
165
165
|
function read_series_from_file(path: string): Array<TimeSeriesPoint> {
|
|
166
166
|
const result = Array<TimeSeriesPoint>();
|
|
167
|
-
const input =
|
|
167
|
+
const input = readFileSync(path).toString();
|
|
168
168
|
const parsed = parse(input, { skip_empty_lines: true });
|
|
169
169
|
parsed.forEach(function (e: Array<string>) {
|
|
170
170
|
result.push({ timestamp: new Date(e[0]), value: Number(e[1]) });
|
|
@@ -205,12 +205,12 @@ if (result.body.isAnomaly) {
|
|
|
205
205
|
### Detect change points
|
|
206
206
|
|
|
207
207
|
```ts snippet:detect_change_points
|
|
208
|
-
import {
|
|
208
|
+
import AnomalyDetector, {
|
|
209
209
|
TimeSeriesPoint,
|
|
210
|
-
AnomalyDetector,
|
|
211
210
|
DetectUnivariateChangePointParameters,
|
|
212
211
|
isUnexpected,
|
|
213
212
|
} from "@azure-rest/ai-anomaly-detector";
|
|
213
|
+
import { readFileSync } from "node:fs";
|
|
214
214
|
import { parse } from "csv-parse/sync";
|
|
215
215
|
import { AzureKeyCredential } from "@azure/core-auth";
|
|
216
216
|
|
|
@@ -220,7 +220,7 @@ const timeSeriesDataPath = "./samples-dev/example-data/request-data.csv";
|
|
|
220
220
|
|
|
221
221
|
function read_series_from_file(path: string): Array<TimeSeriesPoint> {
|
|
222
222
|
const result = Array<TimeSeriesPoint>();
|
|
223
|
-
const input =
|
|
223
|
+
const input = readFileSync(path).toString();
|
|
224
224
|
const parsed = parse(input, { skip_empty_lines: true });
|
|
225
225
|
parsed.forEach(function (e: Array<string>) {
|
|
226
226
|
result.push({ timestamp: new Date(e[0]), value: Number(e[1]) });
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/ai-anomaly-detector",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "1.0.0-alpha.
|
|
5
|
+
"version": "1.0.0-alpha.20250113.1",
|
|
6
6
|
"description": "A generated SDK for AnomalyDetectorRest.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|