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

# Classification

> Learn about TabPFN's classification capabilities.

TabPFN provides a comprehensive interface for handling classification tasks on tabular data. The [`TabPFNClassifier`](https://github.com/PriorLabs/tabpfn/blob/main/src/tabpfn/classifier.py) class can be used for binary and multi-class classification problems.

## Getting Started

The following shows a full example of using the `TabPFNClassifier`:

```python theme={null}
from tabpfn import TabPFNClassifier
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, log_loss

X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

model = TabPFNClassifier()
# To use TabPFNv2:
# model = TabPFNClassifier.create_default_for_version(ModelVersion.V2)
model.fit(X_train, y_train)

# Predict class labels
preds = model.predict(X_test)
print("Accuracy:", accuracy_score(y_test, preds))

# Predict class probabilities
probs = model.predict_proba(X_test)
print("Log-Loss:", log_loss(y_test, probs))
```

## Related Extensions

<CardGroup cols={2}>
  <Card title="Many Class Classifier" icon="puzzle" href="/capabilities/many-class">
    Scalable classification for thousands of classes with TabPFN.
  </Card>

  <Card title="Metric Tuning" icon="puzzle" href="/capabilities/metric-tuning">
    Tune scores other than maximum probability prediction such as F1 or balanced accuracy.
  </Card>
</CardGroup>
