Closed pabloslash closed 2 years ago
I came across this the other day and am also interested in the answer.
So the expected api would be able to do something like .fit(1)
?
1 segment would be a special routine. You don't need the underlying optimization routine to move 'breakpoints' around.
I guess all the underlying mechanisms are there to support fits of 1 segment, I would just need to write this special routine, then query it when .fit()
or .fitfast()
were called.
that routine would be
def fit_with_one_segment(self):
self.fit_with_breaks([self.break_0, self.break_n])
Thanks for the suggestion! I've added it to the code, and released a new version 2.2.1.
You can now do fit
and fitfast
for one line segment. In both cases, simple linear regression is applied.
Great improvement. Thanks!
On Sat, May 7, 2022 at 2:59 PM Charles Jekel @.***> wrote:
Thanks for the suggestion! I've added it to the code, and released a new version 2.2.1.
You can now do fit and fitfast for one line segment. In both cases, simple linear regression is applied.
— Reply to this email directly, view it on GitHub https://github.com/cjekel/piecewise_linear_fit_py/issues/100#issuecomment-1120301875, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLELUQ7YSV3MGDQVBNM3DLVI3RULANCNFSM5VAJIXKA . You are receiving this because you authored the thread.Message ID: @.***>
Is there a reason why the fit cannot be done for a single (1-segment) linear regression?