Specificity Of

Prev Next

Find The: Specificity Of Image

specificity_of

How common the value on the current event is, measured against every value that attribute has taken over the time window. A rare value scores low and a common one scores high, so it answers "is this unusual?" without a threshold having to be set by hand.

Counts come from a Count-Min Sketch rather than an exact tally. Collisions can only push a count up, so a value is never reported as rarer than it really is. A rule that fires on rare values therefore errs towards missing one rather than raising a false one.

Specificity Of or Approximate Velocity Of?

Both count how often a value has been seen and, with Normalize on, divide by the total. What differs is the population: Specificity Of reads counts Darwinium already keeps for that attribute, and Approximate Velocity Of keeps its own. Prefer Approximate Velocity Of unless you need an answer before that history exists.

For example:

  • How common this operating system is across the devices seen in the last month. One in a thousand is worth a look; one in three is not.
  • How common this screen resolution, timezone or user agent is, as a check on a device claiming to be something ordinary.
  • How often this shipping address has been used across the population, rather than by this account.

Configuration

  • Feature Name: The "dictionary" name under which the feature value will be stored and referenced by in rules.

  • Attributes: The attribute to measure. Exactly one attribute is supported, and a second one is rejected when the journey is deployed. There is no restriction on Identifier or Subject; any attribute may be used.

  • Normalize into Fraction of Total: What the Feature returns.

    • true: this value's share of the population, in the range 0..1. The count for this value is divided by the total count of all values that attribute has taken in the window. 0.01 means one event in a hundred carried this value.
    • false: the count itself, so how many times this value has been seen in the window.

    Both come from the same sketch, so true costs nothing extra. Use false where the count is what a rule or model needs, or where you want to divide by something other than the attribute's own total.

Optional Configuration

  • Default Value: A value that can be assigned to the feature if the attributes to calculate the features are not present.
  • Time Window: The period the population is drawn from. Minute, hour, day, week and month windows are honoured. Leaving it out measures against everything counted for that attribute.
  • Calculate Quantile: Publishes a second value to outcome['CHAMPION'].quantiles.general['<feature name>'], ranking this event's result against the spread of values this Feature has produced before. Useful where a share is hard to put a threshold on directly.

Scope does not apply to this Feature Type. The population is whatever Darwinium has counted for that attribute, and a Scope set on the Feature is discarded rather than narrowing it. This is the Feature Type for "how rare is this in general"; to ask how often one entity has used a value, use Velocity Of or Approximate Distinct Count Of with a With The Same.

Nothing about the population can be narrowed, so there is no event type filter and no Condition either. Approximate Velocity Of takes all three, along with several attributes at once or a Query-Language expression, because it keeps a count of its own. The trade is that its count starts empty and means nothing until the Feature has been running for a while.

A Time Window of all is not the same as leaving it out. Left out, the Feature reads the all-time counts. Set to all, it reads a one-year window. An event-count window, a since last event window or a calendar-month window is not supported here and falls back to the all-time figure without reporting an error.

Two cases return the Default Value instead of a measurement: the attribute is not present on this event, and no counts are being kept for that attribute. Neither raises an error, so pick a Default Value a rule can recognise rather than one that reads as a real result.

Use Case 1

Using Specificity Of to determine if the operating system detected by Javascript profiling is an outlier with respect to the general population.

Using the Feature in Rules and Investigations

Find an operating system carried by fewer than one event in a hundred.

feature('spec_js_os_month') <= 0.01

image.png

Implementing In The Feature Editor

image.png

image.png

  - name: spec_js_os_month
    default_value: -1
    time_window:
      months: 1
    find_the:
      specificity_of:
        attributes:
          - profiling.javascript.os
        normalize: true

The two modes, in the Feature Editor
image.png

image.png