dswah / pyGAM

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

One-hot encoding factor term #322

Open ilagith opened 2 years ago

ilagith commented 2 years ago

Hi,

I have an array as: [[ '1234' 0.123 'GitHub']]

and I want to pass the third feature as a factor term f(2, coding = 'one-hot'). However, the encoding fails returning this error:

ValueError: X data must be type int or float, but found type: <class 'numpy.object_'> Try transforming data with a LabelEncoder first. as a consequence of utils.check_array

Any suggestion to overcome this issue?