You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello, I'm trying to create a dataset and one feature I'd like to encode is WEEKDAY as a one-hot encoded vector
I tried: engine.add(factors.filter.OneHotEncoder(factors.WEEKDAY), "weekday")
and engine.add(factors.WEEKDAY.one_hot(), "weekday")
seems to be called and encoded properly, however I get an error saying factors cannot return multiple values.
What's the proper way to use the OneHotEncoder filter?
The text was updated successfully, but these errors were encountered:
OneHotEncoder factor returns multiple values by class, for example, if you encoding [1,2,2,3], it will return 3 values: [1, 0, 0, 0], [0, 1, 1, 0], [0, 0, 0, 1]
So just use slice []:
onehots = factors.WEEKDAY.one_hot()
for i in range(5):
engine.add(onehots[i], "weekday{}".format(i+1))
btw: other factors such as RollingLinearRegression also return multiple values (slope and intercept)
hello, I'm trying to create a dataset and one feature I'd like to encode is WEEKDAY as a one-hot encoded vector
I tried:
engine.add(factors.filter.OneHotEncoder(factors.WEEKDAY), "weekday")
and
engine.add(factors.WEEKDAY.one_hot(), "weekday")
seems to be called and encoded properly, however I get an error saying factors cannot return multiple values.
What's the proper way to use the OneHotEncoder filter?
The text was updated successfully, but these errors were encountered: