How to include a configurable value in a metric?

#1

I have many RiskScore metrics that return values between 0 and 1. I want to create HighRisk metrics that will return 1 if the risk scores are higher than a threshold value, and 0 otherwise. The threshold value will be used in multiple metrics.

What’s the best place to store this threshold value so it can be

  1. accessible in the metric
  2. configurable on the fly through static console or configurable through code change
0 Likes

#2

One way to do is to use binding where you can provide a threshold for every metric evaluation while having the possibility to define a default value. Check the following thread:

1 Like

#3

Since Metric is Metadata type. any user changes will not be preserved on provision and
to meet your second requirement, ( configurable on the fly through static console), Write limits in new entity type and link that type to your source type and write a metric to get the latest limit values.

if you can do code change( provision) to change limits-> . bindings with defaults( so analytics can process) should do.

0 Likes

#4

Is it a good practice to put the configuration in an enum and use the enum in expressions?

For example, an enum can be defined as

enum type Configs {
  threshold: '0.1'
}
0 Likes