You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
The text was updated successfully, but these errors were encountered:
TheNamesAlex
changed the title
Unexpected keyword argument passed to TabPFNRegressor
Unexpected keyword argument passed to TabPFNRegressor by default
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)`
The text was updated successfully, but these errors were encountered: