You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After you get a key from your trial subscription or resource, [create an environment variable](../../cognitive-services-apis-create-account.md#configure-an-environment-variable-for-authentication) for the key, named `ANOMALY_DETECTOR_KEY`.
37
+
### Create a new .NET Core application
38
38
39
-
### Create a new C# application
40
-
41
-
Create a new .NET Core application in your preferred editor or IDE.
42
-
43
-
In a console window (such as cmd, PowerShell, or Bash), use the dotnet `new` command to create a new console app with the name `anomaly-detector-quickstart`. This command creates a simple "Hello World" C# project with a single source file: *Program.cs*.
39
+
In a console window (such as cmd, PowerShell, or Bash), use the dotnet `new` command to create a new console app with the name `anomaly-detector-quickstart`. This command creates a simple "Hello World" project with a single C# source file: *Program.cs*.
44
40
45
41
```console
46
42
dotnet new console -n anomaly-detector-quickstart
@@ -62,14 +58,6 @@ Build succeeded.
62
58
...
63
59
```
64
60
65
-
From the project directory, open the *program.cs* file in your preferred editor or IDE. Add the following using `directives`:
In the application's `main()` method, create variables for your resource's Azure location, and your key as an environment variable. If you created the environment variable after application is launched, the editor, IDE, or shell running it will need to be closed and reloaded to access the variable.
In the application's `main()` method, create variables for your resource's Azure location, and your key as an environment variable. If you created the environment variable after application is launched, the editor, IDE, or shell running it will need to be closed and reloaded to access the variable.
Copy file name to clipboardExpand all lines: articles/cognitive-services/Anomaly-Detector/quickstarts/detect-data-anomalies-csharp.md
+16-89Lines changed: 16 additions & 89 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ manager: nitinme
8
8
ms.service: cognitive-services
9
9
ms.subservice: anomaly-detector
10
10
ms.topic: quickstart
11
-
ms.date: 07/26/2019
11
+
ms.date: 10/14/2019
12
12
ms.author: aahi
13
13
---
14
14
@@ -37,23 +37,16 @@ Use this quickstart to start using the Anomaly Detector API's two detection mode
37
37
38
38
- A JSON file containing time series data points. The example data for this quickstart can be found on [GitHub](https://github.com/Azure-Samples/anomalydetector/blob/master/example-data/request-data.json).
2. Create variables for your subscription key and your endpoint. Below are the URIs you can use for anomaly detection. These will be appended to your service endpoint later to create the API request URLs.
59
52
@@ -62,17 +55,7 @@ Use this quickstart to start using the Anomaly Detector API's two detection mode
4. Otherwise, find the positions of anomalies in the data set. The response's `isAnomaly` field contains an array of boolean values, each of which indicates whether a data point is an anomaly. Convert this to a string array with the response object's `ToObject<bool[]>()` function. Iterate through the array, and print the index of any `true` values. These values correspond to the index of anomalous data points, if any were found.
## Detect the anomaly status of the latest data point
139
84
140
85
1. Create a new function called `detectAnomaliesLatest()`. Construct the request and send it by calling the `Request()` function with your endpoint, subscription key, the URL for latest point anomaly detection, and the time series data.
141
86
142
87
2. Deserialize the JSON object, and write it to the console.
>[Streaming anomaly detection with Azure Databricks](../tutorials/anomaly-detection-streaming-databricks.md)
109
+
110
+
* What is the [Anomaly Detector API?](../overview.md)
111
+
*[Best practices](../concepts/anomaly-detection-best-practices.md) when using the Anomaly Detector API.
112
+
* The source code for this sample can be found on [GitHub](https://github.com/Azure-Samples/AnomalyDetector/blob/master/quickstarts/sdk/csharp-sdk-sample.cs).
Copy file name to clipboardExpand all lines: articles/cognitive-services/Anomaly-Detector/quickstarts/detect-data-anomalies-java.md
+15-94Lines changed: 15 additions & 94 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,28 +33,15 @@ Use this quickstart to start using the Anomaly Detector API's two detection mode
33
33
34
34
- A JSON file containing time series data points. The example data for this quickstart can be found on [GitHub](https://github.com/Azure-Samples/anomalydetector/blob/master/example-data/request-data.json).
2. Create variables for your subscription key and your endpoint. Below are the URIs you can use for anomaly detection. These will be appended to your service endpoint later to create the API request URLs.
60
47
@@ -63,23 +50,7 @@ Use this quickstart to start using the Anomaly Detector API's two detection mode
3. Otherwise, find the positions of anomalies in the data set. The response's `isAnomaly` field contains a boolean value relating to whether a given data point is an anomaly. Get the JSON array, and iterate through it, printing the index of any `true` values. These values correspond to the index of anomalous data points, if any were found.
System.out.println("Anomalies found in the following data positions:");
142
-
for (int i =0; i < jsonArray.length(); ++i) {
143
-
if (jsonArray.getBoolean(i))
144
-
System.out.print(i +", ");
145
-
}
146
-
System.out.println();
147
-
}
148
-
}
149
-
}
150
-
```
79
+
[!code-java[Method for batch detection](~/samples-anomaly-detector/quickstarts/java-detect-anomalies.java?name=detectBatch)]
151
80
152
81
## Detect the anomaly status of the latest data point
153
82
154
83
* Create a method called `detectAnomaliesLatest()` to detect the anomaly status of the last data point in the data set. Call the `sendRequest()` method created above with your endpoint, url, subscription key, and json data. Get the result, and print it to the console.
@@ -184,4 +101,8 @@ A successful response is returned in JSON format. Click the links below to view
184
101
## Next steps
185
102
186
103
> [!div class="nextstepaction"]
187
-
> [REST API reference](https://westus2.dev.cognitive.microsoft.com/docs/services/AnomalyDetector/operations/post-timeseries-entire-detect)
104
+
>[Streaming anomaly detection with Azure Databricks](../tutorials/anomaly-detection-streaming-databricks.md)
105
+
106
+
* What is the [Anomaly Detector API?](../overview.md)
107
+
*[Best practices](../concepts/anomaly-detection-best-practices.md) when using the Anomaly Detector API.
108
+
* The source code for this sample can be found on [GitHub](https://github.com/Azure-Samples/AnomalyDetector/blob/master/quickstarts/sdk/csharp-sdk-sample.cs).
0 commit comments