Chapter 7. Decision

The end goal of most machine learning applications is not just to extract information and insights, but to make decisions and take actions based on the new knowledge. The services within the Decision category, which we’ll explore in this chapter, aim to enable these goals by providing higher-level capabilities such as detecting anomalies, personalizing recommendations, and identifying inappropriate content. These services are intended to help the user more quickly move from raw data to impactful action.

Anomaly Detector

Many applications need to detect anomalous behavior and know when to take corrective action. Anomaly Detector simplifies the process of detecting anomalies in time series data. The service examines either real-time or historical data to determine whether a data point is an anomaly, automatically selecting the best algorithm for your data to ensure high accuracy for your scenario. Over 200 product teams within Microsoft rely on this service to deliver accurate anomaly detection, and the service is a powerful tool in many use cases such as spotting fraud, alerting when an IoT device is failing, or identifying suspicious user activity. Here’s an example showing how you can integrate the service in just a few lines of code.

First, create a client:

var client = new AnomalyDetectorClient(
  new ApiKeyServiceClientCredentials("Your Subscription Key"))
  {Endpoint = "<Your Service Endpoint>"};

Now create the list of points to analyze. You will need at ...

Get Building Intelligent Apps with Cognitive APIs now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.