piecewise-regression icon indicating copy to clipboard operation
piecewise-regression copied to clipboard

not having a function to get the y predictions

Open krishnasrujan opened this issue 3 years ago • 3 comments

Hello, It's good to have such a useful package for segmented regression, but I don't see any function to get the predictions directly. Can you just create another function that returns the predictions, the code is already present in plot_fit function inside Fit class.

krishnasrujan avatar Feb 08 '22 03:02 krishnasrujan

Hi. Thank you for the suggestion. It's a nice idea for a feature. It's not a priority but I will add it to potnetial features to implement in the next version.

chasmani avatar Feb 11 '22 10:02 chasmani

That would be great. For me its the main reason to look for a piecewise regression package. I have two large datasets, and I want to use one dataset to correct the other. As the x-values are not identical, I need a fit-function.

natter1 avatar Mar 31 '22 17:03 natter1

Thank you for the library!

Indeed a function to predict new data points would be very convenient. Something like y_pred = pw_fit.predict(X)

placid2000 avatar Aug 08 '22 13:08 placid2000

I vote for Placid2000 suggestion and it is not a nice to have feature, basically ploting does the same but we don't always plot results especially on large data. I add a pull request to do so

thegodone avatar Dec 19 '22 09:12 thegodone

Implemented! fit.predict(x) not does this. Thanks for the suggestion!

chasmani avatar Dec 18 '23 13:12 chasmani