Skip to main content

Jensen-Shannon divergence

The Jensen-Shannon Divergence (JSD) is a measure of the distance between two probability distributions (denoted as P and Q). It is commonly utilized to evaluate whether the distribution of a variable has remained stable over time. The formula for the Jensen-Shannon divergence is:

The value of M is calculated as the average of P and Q, i.e., M = (P + Q) / 2. The Kullback-Leibler divergence (KL) is another divergence metric used to measure the difference between two probability distributions, P and Q:

The JSD is a symmetric measure, meaning that JSD(P,Q) = JSD(Q,P). It is also bounded between 0 and 1, with 0 indicating that the two distributions are identical and 1 indicating that they are completely different.

By setting a threshold value for the JSD, it is feasible to determine when a variable's distribution has significantly shifted from the reference distribution. If the JSD between the two distributions exceeds the chosen threshold, this indicates that a drift has occurred in the variable's distribution. If the JSD is below the threshold, no drift is detected.

For more details check:

  • Configuration: all the parameters that are available to be adjusted to the user's specific needs.
  • Outputs: understand TIM's outputs.

Engine schema

The build-model method consists of following steps:

  • compute the empirical distribution for both the reference and test data
  • calculate the Jensen-Shannon divergence between the two distributions
  • determine if there is drift in the data by comparing the divergence value with a given threshold

The detect method consists of following steps:

  • retrieve the reference data ranges and the threshold value from the model
  • compute the empirical distribution for both the reference and test data
  • calculate the Jensen-Shannon divergence between the two distributions
  • determine if there is drift in the data by comparing the divergence value with a given threshold

Jobs of types rebuild-model, what-if, rca and upload model are currently not supported for jobs with drift approach.