Reputation: 780
I trained an lmfit model using the following:
xList = np.linspace(1, len(dataRowTrain), len(dataRowTrain))
model = LinearModel()
parameters = model.guess(dataRowTrain, x=xList)
fitModel = model.fit(dataRowTrain, parameters, x=xList)
Now I would like to use the fitModel to predict the next series of values in the dataset. How can I do so?
I am aware I can output the weights of the best fit model and run it in the equation, but I am wondering if lmfit offers a better way.
Upvotes: 0
Views: 346
Reputation: 316
you can use to predict value
model.eval()
Example:
result = model.fit(y, params, x=X) # curve fitting
x1 = [1, 2, 3] # input for prediction
a = result.eval(x=x1) # prediction
Upvotes: 2