> ## 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.

# Model Parameters

> Tune TabPFN's softmax temperature, metric optimization, and class imbalance handling.

## softmax\_temperature

Controls prediction sharpness (classification only):

* **Lower values** (e.g., `0.7`): sharper, more confident predictions — useful when accuracy is already high
* **Higher values** (e.g., `1.2`): softer, more calibrated predictions — useful when probability calibration matters

```python theme={null}
model = TabPFNClassifier(softmax_temperature=0.8)
```

<Note>
  If you use `tuning_config={"calibrate_temperature": True}`, the temperature is tuned automatically and overrides this value.
</Note>

## Metric Tuning

For metrics that are sensitive to decision thresholds (F1, balanced accuracy, precision, recall), use the built-in [metric tuning](/capabilities/metric-tuning):

```python theme={null}
model = TabPFNClassifier(
    eval_metric="f1",
    tuning_config={
        "calibrate_temperature": True,
        "tune_decision_thresholds": True,
    },
)
```

## Handling Imbalanced Data

* Set `balance_probabilities=True` as a quick heuristic for imbalanced datasets when your evaluation metric weights each class equally regardless of its frequency (e.g. balanced accuracy, balanced log loss).
* For more control, use `eval_metric="balanced_accuracy"` with threshold tuning

<Warning>
  `balance_probabilities` does not always help. In some cases it can balance predictions at the cost of overall predictive power. Test both settings.
</Warning>

## n\_estimators

`n_estimators` controls the number of ensemble members. Each estimator uses a different preprocessing configuration, contributing to ensemble diversity and robustness.

By default (`n_estimators="auto"`), TabPFN starts from 8 estimators and automatically increases the count on wide datasets to ensure full feature coverage — the auto-scaled count is capped at 32. To use exactly the number you specify without any auto-scaling, pass an explicit integer. An explicit value is never auto-scaled; TabPFN warns at fit time if it is too small for every feature to be covered.

```python theme={null}
from tabpfn import TabPFNClassifier

# Use exactly 8 estimators regardless of feature count
model = TabPFNClassifier(n_estimators=8)
```

<Note>
  Passing an explicit `n_estimators` is useful when you need a fixed, predictable computational budget or when comparing models with a controlled number of estimators.
</Note>

<Warning>
  The `auto_scale_n_estimators` argument is deprecated and will be removed in v9. Pass an explicit `n_estimators` instead of setting `auto_scale_n_estimators=False`.
</Warning>
