After the event “Building an Anomaly Detector System with a few or no lines of code” at MsftReactor, some people asked for the 2 lines that I used to convert a CSV file to JSON, to be used with Cognitive Services Anomaly Detector, so here they are.
Important: you need Newtonsoft.Json to build the json content.
The input CSV is part of the Machine Learning.Net sample data, and has this sample content:
And as a bonus, the full console project can be downloaded from here.
This project also have a second function which creates the JSON content using simple string, without the need of Newtonsoft.Json.
Greetings @ Burlingon
- Event – Resources used during my session “Building an Anomaly Detector System with a few or no lines of code” @MsftReactor https://elbruno.com/2019/11/22/event-resources-used-during-my-session-building-an-anomaly-detector-system-with-a-few-or-no-lines-of-code-msftreactor/
- Anomaly Detector https://azure.microsoft.com/en-us/services/cognitive-services/anomaly-detector
- Machine Learning .Net Samples http://aka.ms/mlnetsamples
- Newtonsoft Json, create JSON Manually https://www.newtonsoft.com/json/help/html/CreateJsonManually.htm