-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-constructing Piecewise PWLF #106
Comments
It seems to work that way! With this snippet it seems to be working def create_pwlf_from_coeffs(fit_breaks, beta, slopes):
model = pwlf.PiecewiseLinFit(None, None, degree=2)
model.fit_breaks = fit_breaks
model.beta = beta
model.slopes = slopes
return model I'd still be interested to here you thoughts, as modeling all those variables is more than I'd like. But that might just come with the complexity. Thanks! |
Good question! check out #13 for model persistence and #44 for looking at the individual polynomial equations
Yes you can do that. You just need to be careful about the polynomial expansion. The first (left most) polynomial is independent, the second polynomial would be a combination of the first polynomial. This continues just like it does for piecewise linear models.
def create_pwlf_from_coeffs(fit_breaks, beta, slopes):
model = pwlf.PiecewiseLinFit(None, None, degree=2)
model.fit_breaks = fit_breaks
model.beta = beta
model.slopes = slopes
return model Yup! that will work. So y_hat = my_pwlf_new.predict(x, beta=my_prev_beta, breaks=my_prev_breakpoints) which will set all the correct attributes (at least I think so). Happy to answer any questions! Multiple quadratic polynomials seems like you will get a lot of coefficients quickly. Is that an issue for your Kriging model? Thanks, |
Hello, thanks for your hard work on this library, I've found it very useful! Issue #85 may be referencing this issue, but I would like to construct a PWFL piecewise curve from a modeled set of coefficients.
Essentially I'm creating a Kriging model to predict the coefficients and breakpoints required to construct the curve. For example with something simple like poly1d:
Is there a way to do this with PWFL? Maybe with setting betas and intercepts as mentioned #85? Or is that not available with polynomials? For example, I'll probably try to get something like this to work:
I've been able to successfully do this process with basic non-piecewise polynomial fits and my own
PiecewisePolynomial
class. But PWLF seems to be more robust so I'd like to use it!Thanks!
The text was updated successfully, but these errors were encountered: