> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gp.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conditional Rubrics

> Enhance evaluation flexibility and complexity with per-row run conditions

## Overview

Rather than a task being applied uniformly across all rows, conditional rubrics allow for
rows to be pre-filtered on some `run_condition`.

Filtered out rows receive a `"skipped"` status. They appear as empty in the evaluation results table
and are excluded from evaluation dashboard calculations.

The following example filters out rows where the `subject` is not `'math'`.

<img src="https://mintcdn.com/scalegp/LGIHuzR06BuFdDZe/images/nextgen-evaluation/conditional-rubrics/eval-result-with-conditional-rubric.png?fit=max&auto=format&n=LGIHuzR06BuFdDZe&q=85&s=0d521d3e7ad4c80abd7315a95df9088f" alt="conditional-rubric-evaluation-results" width="3428" height="1498" data-path="images/nextgen-evaluation/conditional-rubrics/eval-result-with-conditional-rubric.png" />

Run conditions are currently supported via the SDK only for auto evaluations of type `guided_decoding`.

### Format

The `run_condition` object is a discriminated union on `op` with the following properties supported:

* Leaf types: `const`, `var` (item locator references)
* Comparison ops: `eq`, `ne`, `lt`, `lte`, `gt`, `gte`
* Set ops: `in`, `not_in`
* Logical ops: `and`, `or`, `not`, `is_null`, `is_not_null`

### Example

#### Simple `run_condition`

```
"run_condition":{
    "op": "eq",
    "left": { "op": "var", "path": "item.subject" },
    "right": { "op": "const", "value": "math" }
},
```

#### Nested `run_condition`

```
"run_condition": {
  "op": "or",
  "operands": [
    {
      "op": "eq",
      "left":  { "op": "var", "path": "item.Score" },
      "right": { "op": "const", "value": 5 }
    },
    {
      "op": "eq",
      "left":  { "op": "var", "path": "item.Score" },
      "right": { "op": "const", "value": 3 }
    }
  ]
}
```
