Skip to content

Instantly share code, notes, and snippets.

@chrisking
Last active January 14, 2022 20:28
Show Gist options
  • Save chrisking/4097bf915ecb65847ca90028a1582270 to your computer and use it in GitHub Desktop.
Save chrisking/4097bf915ecb65847ca90028a1582270 to your computer and use it in GitHub Desktop.
Thinking about l4m

Learning to Communicate with Lookout for Metrics

Intro

Amazon Lookout for Metrics uses machine learning (ML) to automatically detect and diagnose anomalies (i.e. outliers from the norm) in business and operational data, such as a sudden dip in sales revenue or customer acquisition rates. In a couple of clicks, you can connect Amazon Lookout for Metrics to popular data stores like Amazon S3, Amazon Redshift, and Amazon Relational Database Service (RDS), as well as third-party SaaS applications, such as Salesforce, Servicenow, Zendesk, and Marketo, and start monitoring metrics that are important to your business.

That said, it is still a computer system and at the end of the day it will respond accordingly to the specific inputs it is given. This is designed to be a short guide to help you think through the data you provide Lookout for Metrics and to better understand what the results from Lookout for Metrics mean. This will be done using a few real world-esque scenarios.

What Exactly Is A Metric?

If you are going to be looking out for them, it would help to know what they are at first. Within Lookout for Metrics there are 3 components to your datasets, together they help shape your Metrics.

They are:

  1. Timestamp - This is required, all entries in this service are required to start with a timestamp of when the remaining columns were relevant or occurred.
  2. Dimensions - These are categorical columns, you can have up to 5 of them, keep in mind they are combined together to refer to a specific entity. For example, if your domains are location and emergency type your data could look like this:
timestamp location emergency type
01/10/2022 10:00:00 123 Interesting Ave smoke_alarm
01/10/2022 10:00:00 123 Interesting Ave water_sensor
01/10/2022 10:00:00 745 Interesting Ave smoke_alarm
01/10/2022 10:00:00 745 Interesting Ave water_sensor

From this dataset we have 2 dimensions(location and emergency type) and when we start to think about the total number of possible metrics(full calculation to come) we can see there are 2 distinct locations and 2 distinct emergency types.

  1. Measures - These are the numerical columns where real observable numbers are placed. These numbers are bound to a specific unique set of domains. You can also have up to 5 of these columns. Now expanding our earlier dataset with 2 additional numerical columns of total and fixed.
timestamp location emergency type total fixed
01/10/2022 10:00:00 123 Interesting Ave smoke_alarm 10 8
01/10/2022 10:00:00 123 Interesting Ave water_sensor 10 10
01/10/2022 10:00:00 745 Interesting Ave smoke_alarm 10 10
01/10/2022 10:00:00 745 Interesting Ave water_sensor 10 7

Lookout for Metrics with this dataset has 8 metrics. How did we get this number?

A Metric is a unique combination of categorial entries and 1 numerical value.

How to Calculate the Total Number of Metrics

The formula to calculate the total number of metris is: Unique(domain1) * Unique(domain2) * Number of measures. So in this case that would be:

2 * 2 * 2 or 8.

At present Lookout for Metrics can support a maximum of 50,000 metrics per Detector, which is the trained model assigned to a particular set of data. So if you wanted to track more of them than 50,000, you would simply segment your data into multiple Detectors.

What Can Lookout for Metrics Tell Me From My Data

Like all great things powered by Machine Learning: It depends!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment