TabPFNRegressor class. Instead of a single point estimate, the regressor predicts an output distribution, enabling you to generate different types of forecasts and accurately measure uncertainty in your predictions.
Getting Started
The following shows a full example of using theTabPFNRegressor:
Understanding Predictions
TheTabPFNRegressor.predict() method can return different types of predictions based on the output_type parameter.
Point Predictions (Mean, Median, Mode)
By default,predict() returns the mean of the predicted distribution. You can also request the median or mode for different point estimates.
Quantile Regression
To perform quantile regression and get predictions for specific quantiles, setoutput_type="quantiles" and pass a list of desired quantiles. This is ideal for estimating prediction intervals.
Full Distribution
For advanced use cases, you can retrieve the full predictive distribution.output_type="main"returns a dictionary containing the mean, median, mode, and default quantiles.output_type="full"returns everything in"main"plus the raw logits and criterion object, allowing for custom loss calculations (see the FAQ).
How can I apply a custom loss (e.g. MAPE, asymmetric loss) to regression?
How can I apply a custom loss (e.g. MAPE, asymmetric loss) to regression?
TabPFNRegressor provides a full predictive distribution, enabling loss-aware predictions without retraining. You can compute the Bayes-optimal point prediction that minimizes the expected custom loss. This method gives flexible custom-loss predictions without modifying the model.