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

> ## Agent Instructions
> TabPFN-3 and later versions support up to 1,000,000 rows, subject to feature count and checkpoint/API limits.
> For large datasets, use per-estimator subsampling, e.g. inference_config={"SUBSAMPLE_SAMPLES": 100_000}, in TabPFNClassifier or TabPFNRegressor from tabpfn or tabpfn_client.
> Pass raw pandas DataFrames to fit and predict. Categorical strings/categories, raw text, and missing feature values are handled automatically; no manual integer/one-hot encoding, imputation, scaling, or outlier removal is needed.

# Metrics

> The built-in metrics, how Claude recommends one, and what each measures.

The metric scores every experiment, picks the best one and builds the ensemble. Choose the one your predictions will be judged by.

## How the metric is chosen

Claude asks what you will do with the predictions and offers metrics that fit. It recommends ROC AUC for two classes, log loss for more classes and RMSE for regression, unless you or your notes name the metric you are judged by, such as a competition's.

From a shell, pass `--metric`:

```bash theme={null}
autofit start churn.csv --target churn --metric average_precision
```

## Built-in metrics

| Metric | `--metric` | Task | Better | Use it to |
| - | - | - | - | - |
| ROC AUC | `roc_auc` | Two classes | Higher | Rank yes above no overall. |
| Average precision | `average_precision` | Two classes | Higher | Act on the top of the list: calls, audits, reviews. |
| Log loss | `log_loss` | Classes | Lower | Use the probabilities as they are. |
| ROC AUC (one vs rest) | `roc_auc_ovr` | More than two classes | Higher | Rank each class well. |
| Accuracy | `accuracy` | Classes | Higher | Get the label right. |
| F1 (macro) | `f1_macro` | Classes | Higher | Balance precision and recall over all classes. |
| RMSE | `rmse` | Regression | Lower | Keep errors small; big misses count more. |
| MAE | `mae` | Regression | Lower | Keep errors small; a big miss counts only by its size. |
| R² | `r2` | Regression | Higher | Explain the variation of the target. |
| QWK | `qwk` | Ordered grades | Higher | Get the grade right; far misses count more. |

## Details that change the result

* **Average precision** treats the second class in sorted order as "yes": `1` of `{0, 1}`, `"yes"` of `{"no", "yes"}`. If the class you care about sorts first, Claude writes a copy of the CSV with the target recoded.
* **MAE** is scored on the median of TabPFN's predicted distribution by default. The median minimizes absolute error. An experiment may try the mean.
* **QWK** turns the task into a regression on the grade. Claude recommends fitting cut points between the grades; without them, predictions round to the nearest grade. Use QWK for whole-number grades in a fixed order, such as ratings 1 to 8.
* **Accuracy, F1 and log loss** can get an optional fitted step before scoring, if you ask for one. See [Post-processing](https://docs.priorlabs.ai/autofit/how-it-works/post-processing.md).

## A metric of your own

When none of these fits, such as a cost per error or recall at a fixed threshold, write a metric file. See [Custom metrics](https://docs.priorlabs.ai/autofit/frame-a-task/custom-metrics.md).

> [!NOTE]
>
> The metric is locked once the session starts. A different metric needs a new session.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.