dswah / pyGAM

[HELP REQUESTED] Generalized Additive Models in Python
https://pygam.readthedocs.io
Apache License 2.0
862 stars 159 forks source link

Use of gridsearch fails on DataFrames with TypeError #232

Open iaindinw opened 5 years ago

iaindinw commented 5 years ago

Currently if a DataFrame is passed to gridsearch this returns a TypeError: TypeError: unhashable type: 'slice' This can be avoided by passing dataframe values i.e. gam = LinearGAM.gridsearch(X.values, y) but I think in previous versions handling of DataFrames was automatic. See for example https://codeburst.io/pygam-getting-started-with-generalized-additive-models-in-python-457df5b4705f.

Is this a deliberate design choice or not?

PS thank you for your efforts on pyGAM it's incredibly useful.

dswah commented 5 years ago

hi @iaindinw thanks for the bug report! i think pyGAM should be able to process simple dataframes, so this is annoying. hopefully i can take a look this week!

PS I am very glad you find pyGAM useful :)

iaindinw commented 5 years ago

Great, it may be my configuration that's causing the issue, particularly python version.

Windows 10 Python 3.7 pygam version 0.8.0 pandas version 0.23.4

yzjing commented 5 years ago

I had the same issue with mac OS High Sierra and Python 3.6.