Closed Ezibenroc closed 6 years ago
Based on the way it's currently written, I believe it would be possible for different points at the same t
to be modeled with two (or more) different linear segments. From a prediction perspective, this obviously makes no sense. However, it seems possible to prevent this problematic case by making the initialization a little smarter, so that it initializes all points with the same t
s as modeled by the same linear segment. Since it does seem useful to handle this case, I'll take a pass at changing the initialization and creating a test to cover this case. PR to follow....
@Ezibenroc - I've created a PR for this: https://github.com/DataDog/piecewise/pull/6
How does that look?
I've merged the PR, so closing this issue. Feel free to follow-up if I missed anything.
It looks good, thank you!
The code currently has this safety check: https://github.com/DataDog/piecewise/blob/3a15a1c3113cbbecf979bb318f19f2c7fbdc9408/piecewise/regressor.py#L215-L216
This is a problem for me, as I have several occurences of each predictor variable.
I tried to remove this check and run the following code, where each predictor variable is repeated 10 times:
It gives this result, which seems great to me:
So, do you think that we could safely remove this safety check, or is there any corner case I didn't think of?