dswah / pyGAM

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

ImportError: cannot import name 'generate_X_grid' #214

Closed tiago-monge closed 5 years ago

tiago-monge commented 5 years ago

I successfuly installed the pygam package, but when I do

from pygam.utils import generate_X_grid

It gives this error:

Traceback (most recent call last):

  File "<ipython-input-23-58b7fe4be83a>", line 1, in <module>
    from pygam.utils import generate_X_grid

ImportError: cannot import name 'generate_X_grid'

What am doing wrong, or is it a bug? How to solve it?

Thanks

Tiago

dswah commented 5 years ago

@tiago-monge

generate_X_grid was moved. it is now a method of any GAM object, so you can do

gam = GAM().fit(X, y)
gam.generate_X_grid(term=...)

it looks like you are referencing some out-of-date usage. where did you read that?

sorry for the confusion, Dani

dswah commented 5 years ago

ahh is that from the CodeBurst tutorial?

tiago-monge commented 5 years ago

Thanks for the prompt answer. Yes, I was following the CodeBurst tutorial. I'll try with the new approach.

dswah commented 5 years ago

cool, ok we will have to update/change that tutorial.