Fiddler Query Language
Overview
Custom Metrics and Segments are defined using the Fiddler Query Language (FQL), a flexible set of constants, operators, and functions which can accommodate a large variety of metrics.
Definitions
Term | Definition |
---|---|
Row-level function | A function which executes row-wise for a set of data. Returns a value for each row. |
Aggregate function | A function which executes across rows. Returns a single value for a given set of rows. |
FQL Rules
Column names can be referenced by name either with double quotes ("my_column") or with no quotes (my_column).
Single quotes (') are used to represent string values.
Data Types
FQL distinguishes between three data types:
Data type | Supported values | Examples | Supported Model Schema Data Types |
---|---|---|---|
Number | Any numeric value (integers and floats are both included) |
| |
Boolean | Only |
| |
String | Any value wrapped in single quotes ( |
|
Constants
Symbol | Description |
---|---|
| Boolean constant for true expressions |
| Boolean constant for false expressions |
Operators
Symbol | Description | Syntax | Returns | Examples |
---|---|---|---|---|
| Exponentiation |
|
|
|
| Unary negation |
|
|
|
| Multiplication |
|
|
|
| Division |
|
|
|
| Modulo |
|
|
|
| Addition |
|
|
|
| Subtraction |
|
|
|
| Less than |
|
|
|
| Less than or equal to |
|
|
|
| Greater than |
|
|
|
| Greater than or equal to |
|
|
|
| Equals |
|
|
|
| Does not equal |
|
|
|
| Logical NOT |
|
|
|
| Logical AND |
|
|
|
| Logical OR |
|
|
|
Constant functions
Symbol | Description | Syntax | Returns | Examples |
---|---|---|---|---|
| Base of the natural logarithm |
|
|
|
| The ratio of a circle's circumference to its diameter |
|
|
|
Row-level functions
Row-level functions can be applied either to a single value or to a column/row expression (in which case they are mapped element-wise to each value in the column/row expression).
Symbol | Description | Syntax | Returns | Examples |
---|---|---|---|---|
| Evaluates |
|
|
|
| Returns the length of string |
|
|
|
| Converts a value |
|
|
|
| Returns |
|
|
|
| Returns a substring of |
|
|
|
| Returns |
|
|
|
| Returns |
|
|
|
| Returns |
|
|
|
| Returns the absolute value of number |
|
|
|
| Returns |
|
|
|
| Returns the natural logarithm (base |
|
|
|
| Returns the binary logarithm (base |
|
|
|
| Returns the binary logarithm (base |
|
|
|
| Returns the positive square root of number |
|
|
|
Aggregate functions
Every Custom Metric must be wrapped in an aggregate function or be a combination of aggregate functions.
Symbol | Description | Syntax | Returns | Examples |
---|---|---|---|---|
| Returns the sum of a numeric column or row expression |
|
|
|
| Returns the arithmetic mean/average value of a numeric column or row expression |
|
|
|
| Returns the number of non-null rows of a column or row expression |
|
|
|
Built-in metric functions
Symbol | Description | Syntax | Returns | Examples |
---|---|---|---|---|
| The Jensen-Shannon distance of column |
|
|
|
| The population stability index of column |
|
|
|
| Number of rows with null values in column |
|
|
|
| Number of rows with out-of-range values in column |
|
|
|
| Number of rows with invalid data types in column |
|
|
|
| Number of rows with at least one Data Integrity violation in |
|
|
|
| Total row count. Includes null rows. |
|
|
|
| True positive count. Available for binary classification and multiclass classification models. For multiclass, |
|
|
|
| True negative count. Available for binary classification and multiclass classification models. For multiclass, |
|
|
|
| False positive count. Available for binary classification and multiclass classification models. For multiclass, |
|
|
|
| False negative count. Available for binary classification and multiclass classification models. For multiclass, |
|
|
|
| Precision between target and output. Available for binary classification model tasks.
If |
|
|
|
| Recall between target and output. Available for binary classification model tasks.
If |
|
|
|
| F1 score between target and output. Available for binary classification model tasks.
If |
|
|
|
| False positive rate between target and output. Available for binary classification model tasks.
If |
|
|
|
| Area under the ROC curve between target and output. Available for binary classification model tasks.
If |
|
|
|
| Geometric mean score between target and output. Available for binary classification model tasks.
If |
|
|
|
| Expected calibration error between target and output. Available for binary classification model tasks.
If |
|
|
|
| Log loss (binary cross entropy) between target and output. Available for binary classification model tasks.
If |
|
|
|
| Optimal threshold value for a high TPR and a low FPR. Available for binary classification model tasks.
If |
|
|
|
| Accuracy score between target and outputs. Available for multiclass classification model tasks.
If |
|
|
|
| Log loss score between target and outputs. Available for multiclass classification model tasks.
If |
|
|
|
| R-squared score between target and output. Available for regression model tasks.
If |
|
|
|
| Mean squared error between target and output. Available for regression model tasks.
If |
|
|
|
| Mean absolute error between target and output. Available for regression model tasks.
If |
|
|
|
| Mean absolute percentage error between target and output. Available for regression model tasks.
If |
|
|
|
| Weighted mean absolute percentage error between target and output. Available for regression model tasks.
If |
|
|
|
| Mean average precision score. Available for ranking model tasks.
If |
|
|
|
| Mean normalized discounted cumulative gain score. Available for ranking model tasks.
If |
|
|
|
| Count of ranking queries. Available for ranking model tasks.
If |
|
|
|
Last updated