Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected keyword argument passed to TabPFNRegressor by default #17

Closed
TheNamesAlex opened this issue Mar 7, 2025 · 3 comments
Closed
Assignees

Comments

@TheNamesAlex
Copy link

TheNamesAlex commented Mar 7, 2025

First off, thanks a lot for the amazing work you've been doing here. I am trying to play around with the package, and ran into the error below when running the code from your colab demo locally.

A TypeError is thrown when running the snipped below:
TypeError: TabPFNRegressor.init() got an unexpected keyword argument 'optimize_metric'

Expected behavior:
default params match expected constructor args

tabpfn versions used:
tabpfn==2.0.6
tabpfn-client==0.0.25
tabpfn_time_series==0.1.1

snipped to reproduce:
`from datasets import load_dataset
from autogluon.timeseries import TimeSeriesDataFrame

from tabpfn_time_series import FeatureTransformer, DefaultFeatures
from tabpfn_time_series.data_preparation import to_gluonts_univariate, generate_test_X
from tabpfn_time_series.plot import plot_actual_ts
from tabpfn_time_series import TabPFNTimeSeriesPredictor, TabPFNMode

dataset_metadata = {
"monash_tourism_monthly": {"prediction_length": 24},
"m4_hourly": {"prediction_length": 48},
}

dataset_choice = "monash_tourism_monthly"
num_time_series_subset = 2

prediction_length = dataset_metadata[dataset_choice]['prediction_length']
dataset = load_dataset("autogluon/chronos_datasets", dataset_choice)

tsdf = TimeSeriesDataFrame(to_gluonts_univariate(dataset['train']))
tsdf = tsdf[tsdf.index.get_level_values('item_id').isin(tsdf.item_ids[:num_time_series_subset])]
train_tsdf, test_tsdf_ground_truth = tsdf.train_test_split(prediction_length=prediction_length)
test_tsdf = generate_test_X(train_tsdf, prediction_length)

plot_actual_ts(train_tsdf, test_tsdf_ground_truth)

selected_features = [
DefaultFeatures.add_running_index,
DefaultFeatures.add_calendar_features,
]

train_tsdf, test_tsdf = FeatureTransformer.add_features(
train_tsdf, test_tsdf, selected_features
)
train_tsdf.head()

predictor = TabPFNTimeSeriesPredictor(
tabpfn_mode=TabPFNMode.LOCAL
)

pred = predictor.predict(train_tsdf, test_tsdf)`

@TheNamesAlex TheNamesAlex changed the title Unexpected keyword argument passed to TabPFNRegressor Unexpected keyword argument passed to TabPFNRegressor by default Mar 7, 2025
@liam-sbhoo
Copy link
Collaborator

@TheNamesAlex

Thanks for being interested!

Could you try again with tabpfn-time-series==0.1.2? That should probably fix the issue.

@liam-sbhoo liam-sbhoo self-assigned this Mar 7, 2025
@liam-sbhoo
Copy link
Collaborator

@TheNamesAlex

Does this solve the issue for you? Let me know :)

@TheNamesAlex
Copy link
Author

Hi @liam-sbhoo, thank you for the swift response. That solved the issue for me!

Thanks, and all the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants