Functions Overview
This page provides a reference of all available functions by aggregation functions and metric functions. Click the linked model type for documentation on a particular model.Aggregation functions
Every User Defined Metric must have one or more aggregation functions or metrics.| Function | Description | Type |
|---|---|---|
COUNT(*) | Counts the number of rows | n/a |
APPROX_COUNT_DISTINCT(exprs) | Counts the unique values of exprs | String |
SUM(exprs) | Sums the value of the expression across rows | Numeric |
AVG(exprs) | Averages the value of the expression across rows | Numeric |
APPROX_QUANTILE(exprs,<decimal>) | Approximate quantile of expres. Second argument must be a numeric literal between 0 and 1 inclusive | Numeric |
MIN(exprs) | Minimum of the value of the expression across rows | Numeric |
MAX(exprs) | Maximum of the value of the expression across rows | Numeric |
Metric functions
Metric functions leverage existing metrics in Arize for use in your custom metric. They also allow you to customize the way existing metrics are calculated. Metric functions can take both positional arguments and keyword arguments. When using both, positional arguments must come before keyword arguments. Keyword arguments can be specified in any order. For classification metrics, the model’s configured positive class is the default value, we will refer to this as defaultPositiveClass in this doc. Note that these functions need actual (a.k.a. ground truth) data to produce results.True Positive
pos_class= is omitted, then the positive class configured for the model is used.
False Positive
pos_class= is omitted, then the positive class configured for the model is used.
True Negative
pos_class= is omitted, then the positive class configured for the model is used.
False Negative
pos_class= is omitted, then the positive class configured for the model is used.
Precision
pos_class= is omitted, then the positive class configured for the model is used.
Recall
pos_class= is omitted, then the positive class configured for the model is used.
F1
pos_class= is omitted, then the positive class configured for the model is used.
F_BETA
beta= parameter for re-weighting precision and recall. Beta is defaulted to 1, which produces the same result as the F-1 score. When beta=0, F-score equals precision, when beta goes to infinity, F-score equals recall. Commonly used values for beta= are 2, which weighs recall higher than precision, and 0.5, which weighs recall lower than precision. If pos_class= is omitted, then the positive class configured for the model is used.
LOG_LOSS
actual= is a string column while predicted= is a numeric column.
ACCURACY
MAE
MAPE
MSE
RMSE
AUC
NDCG
omit_zero_relevance since this will impact the averaging that is implicit in this metric.