> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.umnai.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.umnai.com/_mcp/server.

# Comparison

The Comparison view compares two trained models.

Use it to understand how a baseline model differs from another trained model, especially after changing training data, schema settings, training configuration, constraints, or model version.

## When to use

| Use case                 | Description                                                                                     |
| ------------------------ | ----------------------------------------------------------------------------------------------- |
| Compare training runs    | Check whether a new training run changed the model structure.                                   |
| Review model changes     | See which modules or partitions were added, deleted, or edited.                                 |
| Inspect structural drift | Compare module and partition changes across two models trained from different data or settings. |
| Support model review     | Use structural differences to guide review before selecting a model for deployment.             |

## Generate the view

Generate the Comparison view from the baseline model.

The model in the path is treated as the baseline model. The request body must include `comparison_model_id`, which identifies the model to compare against the baseline.

```json
{
  "data": [
    {
      "view_type": "MODEL_COMPARISON",
      "comparison_model_id": "comparison-model-id"
    }
  ]
}
```

A Fern example for `MODEL_COMPARISON` should be added before replacing this request body with endpoint snippets.

## Output

The response follows the shared [Response structure](../response-structure) format.

The Comparison view returns multiple named dataframes inside `view_data`.

| Dataframe    | Description                                                                                                          |
| ------------ | -------------------------------------------------------------------------------------------------------------------- |
| `summary`    | High-level differences between the baseline model and comparison model.                                              |
| `modules`    | Module-level differences, including added, deleted, or edited modules and changes to partition and parameter counts. |
| `partitions` | Partition-level differences, including changed rules, intercepts, coefficients, and transformed features.            |

## Interpret the result

The Comparison view is easiest to read from broad differences to detailed differences: start with `summary`, then inspect changed modules, then review changed partitions.

### Start with the summary

Use `summary` to understand which high-level model attributes changed.

The `attributes` column identifies the attribute being compared. `baseline_model` and `comparison_model` show the values on each side. `delta` shows the change, and `edit_operation` describes whether the attribute was added, deleted, or edited.

This is the fastest way to see whether the two models differ in overall structure before inspecting the detailed dataframes.

### Inspect module changes

Use `modules` to understand how the model organisation changed.

The `module_operation` columns identify the module and whether it was added, deleted, or edited. The `baseline_model` and `comparison_model` columns show the module identifiers, indexes, partition counts, parameter counts, and non-zero parameter counts on each side. The `delta` columns show the size of the change.

Focus first on added or deleted modules, then inspect edited modules with large changes in `delta.n_partitions`, `delta.n_params`, or `delta.non_zero_params`.

### Review partition changes

Use `partitions` to inspect changes inside modules.

The `partition_operation` columns identify the rule and edit operation. The `baseline_partition` and `comparison_partition` columns show the module, rule, intercept, coefficients, and transformed features on each side. The `delta` columns show the changes to the rule expression components.

Partition changes are useful when the model appears similar at the module level but behaves differently because the rules inside a module changed.

### Compare models before deployment

Use the Comparison view before deployment when you need to choose between two trained models or understand the impact of a training change.

For prediction-level differences, deploy the relevant model and use deployed model views to compare predictions, attributions, diagnostics, or evaluation results.

## Field reference

The Comparison view returns dataframes, so individual columns are not documented as standalone API schema properties. This section describes the main columns returned in each dataframe.

### `summary`

The `summary` dataframe contains high-level differences between the baseline model and the comparison model.

| Field              | Description                                                                                 |
| ------------------ | ------------------------------------------------------------------------------------------- |
| `attributes`       | Model attribute being compared.                                                             |
| `baseline_model`   | Value of the attribute in the baseline model.                                               |
| `comparison_model` | Value of the attribute in the comparison model.                                             |
| `delta`            | Difference between the baseline and comparison values, when a difference can be calculated. |
| `edit_operation`   | Type of change detected for the attribute, such as added, deleted, or edited.               |

### `modules`

The `modules` dataframe contains module-level differences between the two models.

| Field                                  | Description                                                                     |
| -------------------------------------- | ------------------------------------------------------------------------------- |
| `module_operation.module_stable_label` | Stable label of the module being compared.                                      |
| `module_operation.module_features`     | Features used by the module.                                                    |
| `module_operation.edit_operation`      | Type of change detected for the module, such as added, deleted, or edited.      |
| `baseline_model.module_id`             | Module ID in the baseline model.                                                |
| `baseline_model.module_index`          | Module index in the baseline model.                                             |
| `baseline_model.n_partitions`          | Number of partitions in the baseline model module.                              |
| `baseline_model.n_params`              | Number of parameters in the baseline model module.                              |
| `baseline_model.non_zero_params`       | Number of non-zero parameters in the baseline model module.                     |
| `comparison_model.module_id`           | Module ID in the comparison model.                                              |
| `comparison_model.module_index`        | Module index in the comparison model.                                           |
| `comparison_model.n_partitions`        | Number of partitions in the comparison model module.                            |
| `comparison_model.n_params`            | Number of parameters in the comparison model module.                            |
| `comparison_model.non_zero_params`     | Number of non-zero parameters in the comparison model module.                   |
| `delta.n_partitions`                   | Change in partition count between the baseline and comparison modules.          |
| `delta.n_params`                       | Change in parameter count between the baseline and comparison modules.          |
| `delta.non_zero_params`                | Change in non-zero parameter count between the baseline and comparison modules. |

### `partitions`

The `partitions` dataframe contains partition-level differences between the two models.

| Field                                         | Description                                                                    |
| --------------------------------------------- | ------------------------------------------------------------------------------ |
| `partition_operation.rule_canonical_label`    | Canonical label of the rule being compared.                                    |
| `partition_operation.rule_friendly_condition` | Friendly condition expression for the rule, when available.                    |
| `partition_operation.edit_operation`          | Type of change detected for the partition, such as added, deleted, or edited.  |
| `baseline_partition.module_id`                | Module ID for the partition in the baseline model.                             |
| `baseline_partition.module_index`             | Module index for the partition in the baseline model.                          |
| `baseline_partition.rule_id`                  | Rule ID in the baseline model.                                                 |
| `baseline_partition.intercept`                | Intercept for the partition expression in the baseline model.                  |
| `baseline_partition.coefficients`             | Coefficients for the partition expression in the baseline model.               |
| `baseline_partition.transformed_features`     | Transformed features used by the partition in the baseline model.              |
| `comparison_partition.module_id`              | Module ID for the partition in the comparison model.                           |
| `comparison_partition.module_index`           | Module index for the partition in the comparison model.                        |
| `comparison_partition.rule_id`                | Rule ID in the comparison model.                                               |
| `comparison_partition.intercept`              | Intercept for the partition expression in the comparison model.                |
| `comparison_partition.coefficients`           | Coefficients for the partition expression in the comparison model.             |
| `comparison_partition.transformed_features`   | Transformed features used by the partition in the comparison model.            |
| `delta.intercept`                             | Change in intercept between the baseline and comparison partitions.            |
| `delta.coefficients`                          | Change in coefficients between the baseline and comparison partitions.         |
| `delta.transformed_features`                  | Change in transformed features between the baseline and comparison partitions. |