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 in example code / NAMdataset #10

Open
pkopper opened this issue May 22, 2024 · 0 comments
Open

Error in example code / NAMdataset #10

pkopper opened this issue May 22, 2024 · 0 comments

Comments

@pkopper
Copy link

pkopper commented May 22, 2024

The example code is not complete and missing the pandas import call. (import pandas as pd)
Additionally, I suggest to actually import sklearn.datasets explicitly.
If done so, I still cannot source your example code due to an error thrown in NAMdataset.

precisely:

dataset = NAMDataset(config,
                      data_path=dataset,
                      features_columns=dataset.columns[:-1],
                      targets_column=dataset.columns[-1])

results in

Traceback (most recent call last):

  File ~/.../site-packages/nam/data/base.py:76 in __init__
    self.features, self.features_names = transform_data(self.raw_X)

  File ~/.../site-packages/nam/data/utils.py:86 in transform_data
    cat_ohe_step = ('ohe', OneHotEncoder(sparse=False, handle_unknown='ignore'))

TypeError: OneHotEncoder.__init__() got an unexpected keyword argument 'sparse'
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

1 participant