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

Error when using AutoTabPFNRegressor: TypeError: TabPFNRegressor.init() got an unexpected keyword argument 'random_state' #21

Open
tortueTortue opened this issue Jan 22, 2025 · 1 comment

Comments

@tortueTortue
Copy link

Hi,

I am trying to use AutoTabPFNRegressor:

from tabpfn_extensions.post_hoc_ensembles.sklearn_interface import AutoTabPFNRegressor
reg = AutoTabPFNRegressor()
reg.fit(train_dataset)

I get this error when I run the .fit() function:

Exception has occurred: TypeError
TabPFNRegressor.init() got an unexpected keyword argument 'random_state'

Line 316 from pfn_phe.py:

    self._estimators, model_family_per_estimator = self._collect_base_models(
        categorical_feature_indices=categorical_feature_indices,
    )

Full trace:

TabPFNRegressor.init() got an unexpected keyword argument 'random_state'
File "utils.py", line 65, in init
super().init(*args, **kwargs)
File "pfn_phe.py", line 485, in _get_base_models_from_random_search
bm = model_base(**param)
^^^^^^^^^^^^^^^^^^^
File "pfn_phe.py", line 354, in _collect_base_models
bm_list = _get_base_models_from_random_search(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pfn_phe.py", line 316, in fit
self._estimators, model_family_per_estimator = self.collect_base_models(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "sklearn_interface.py", line 222, in fit
self.predictor.fit(
File "test_tabpfn.py", line 31, in
reg.fit(X_train, y_train)
TypeError: TabPFNRegressor.init() got an unexpected keyword argument 'random_state'

Thank you!

@LeoGrin
Copy link
Collaborator

LeoGrin commented Jan 22, 2025

Hello @tortueTortue! Thanks for the report.
I cannot reproduce this error. Are you using the latest versions of the tabpfn and tabpfn-extensions package? Would also be helpful if you could share some infos about the dataset you're using (some characteristics, ideally the dataset itself if public).

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