I have fitted a model given a Poly-3 function and extracted the found parameters
model = smf.ols(formula='A ~ B + I(B ** 2.0) + I(B ** 3.0)', data=sp)
poly_3 = model.fit()
params = poly_3.params.values
I want to save the params for later use since I don't want to train the model each time. Params would e.g. be [ 0.09525563, 0.09655527, -0.00946222, 0.00056942]
How can I then, given the formula, the params and some x-values get fitted values? I am thinking of sth. like this:
OLS.predict(x=range(20), params=params, formula='A ~ B + I(B ** 2.0) + I(B ** 3.0)')
I obviously could write the formula in Python itself, but I feel that I don't have to re-invent the wheel here!
Thanks!