Skip to content

Feature Request for Regression Tasks - Custom Loss Functions and Embedding Utilization #560

@hexuwei-epri

Description

@hexuwei-epri

Describe the workflow you want to enable

Hi TabPFN Development Team,

First, thank you for this amazing work! I'm currently exploring TabPFN for renewable energy power prediction tasks and have some questions regarding regression functionality.

Background Context:
I'm working on solar/wind power forecasting where evaluation metrics like MAPE (Mean Absolute Percentage Error) are more meaningful than standard MSE/MAE, due to the specific characteristics of energy data.

Questions:

Custom Loss Functions for Regression:
Currently, when using TabPFNRegressor.fit(), is it possible to use custom loss functions like MAPE instead of the default loss? If not, would this be a feature you'd consider adding in future releases?

Alternative Approach - Embedding + Custom Head:
If direct custom loss functions aren't supported, could we use the get_embedding functionality to obtain intermediate feature embeddings, then build our own MLP output head with custom loss functions? For example:

python
embeddings = tabpfn_model.get_embedding(X_train)

Then build custom MLP head with MAPE loss

Use Case Justification:
In energy forecasting, MAPE is particularly important because:

It provides percentage-based errors that are more interpretable for stakeholders

It handles the intermittent nature of renewable generation better

Industry standards often require MAPE reporting

Additional Considerations:

Would either approach affect TabPFN's inference speed advantages?

Are there any limitations on embedding dimensions or compatibility issues to consider?

Thank you for your time and consideration. Looking forward to your insights!

Best regards,

Describe your proposed solution

TabPFNRegressor.fit() add custom_loss paramater

Describe alternatives you've considered, if relevant

If direct custom loss functions aren't supported, could we use the get_embedding functionality to obtain intermediate feature embeddings, then build our own MLP output head with custom loss functions? For example:

python
embeddings = tabpfn_model.get_embedding(X_train)

Then build custom MLP head with MAPE loss

Additional context

No response

Impact

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions