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
I'm working on a task to encode timestamps (more specifically, weekdays) and I noticed RepeatingBasisFunction does not work correctly with weekday=0 and weekday=6: the outputs for both are the same.
Update:
If I add 1 to "wkday" column (so it's 1 to 7 now) and use rbf = RepeatingBasisFunction(n_periods=7, column="wkday", input_range=(0,7), remainder="drop") and call fit and transform, I will get a square matrix with 1.0 on the diagonal which looks correct, but it's different from the documentation.
The text was updated successfully, but these errors were encountered:
Hi, thank you for reporting the issue and sorry for the late reply!
This seems to be unexpected/buggy behavior. My understanding is that some assumptions have been made in the implementation and it may be worth to adjust or clearly state them.
It's a bit confusing, but I think that this is expected behavior. Theinput_range argument is to be understood as an interval that loops on itself at the boundaries, so if you provide (0,6) you assume that 6 is the same as 0, leaving only distinct 6 integers in the range. In this case, you want to provide (0,7), which translates to the interval [0, 7) and does contain 7 distinct integers.
If you think in terms of continuous variables rather than integer, it possibly makes more sense.
Hi,
I'm working on a task to encode timestamps (more specifically, weekdays) and I noticed RepeatingBasisFunction does not work correctly with weekday=0 and weekday=6: the outputs for both are the same.
Here's the code snippet to reproduce the bug:
The output for me is:
Update:
If I add 1 to "wkday" column (so it's 1 to 7 now) and use
rbf = RepeatingBasisFunction(n_periods=7, column="wkday", input_range=(0,7), remainder="drop")
and callfit
andtransform
, I will get a square matrix with 1.0 on the diagonal which looks correct, but it's different from the documentation.The text was updated successfully, but these errors were encountered: