简体   繁体   English

使用预拟合 lmfit model 预测新数据集中的值

[英]Use pre-fit lmfit model to predict values in new dataset

I trained an lmfit model using the following:我使用以下方法训练了一个 lmfit model:

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.现在我想使用 fitModel 来预测数据集中的下一系列值。 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.我知道我可以 output 最适合 model 的权重并在等式中运行它,但我想知道 lmfit 是否提供了更好的方法。

you can use to predict value你可以用来预测价值

model.eval() 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用新的未经训练的数据集来预测输出值? - How do I use a new untrained, dataset to predict output values? 在LMFIT中拟合负指数模型 - Fit negative exponential model in LMFIT 无法使用 lmfit 拟合自定义 model - ValueError:model function 生成的 NaN 值和拟合中止 - Unable to fit custom model with lmfit - ValueError: The model function generated NaN values and the fit aborted lmfit模型中拟合参数的不同约束 - Different constraints for fit parameter in lmfit model 通过张量流中的预训练模型预测新数据 - predict new data by pre-trained model in tensor-flow Keras:我可以使用model.predict而不使用model.predict_generator来预测是否使用model.fit_generator训练模型 - Keras: can I use model.predict but not model.predict_generator to predict if I train the model with model.fit_generator 使用 statsmodels model 适合另一个数据集 - Use statsmodels model fit on another dataset python lmfit:给定定义模型的离散值数组,如何将具有指定不确定性值的相同长度的数据数组拟合? - python lmfit: Given an array of discrete values that define a model, how to fit a same length array of data with specified uncertainty values? 在迁移学习预训练模型上训练新数据集 - Train new dataset on transfer learning pre-trained model 使用 lmfit 模型来最佳拟合多峰数据 - Using lmfit model to best fit the multiple peaks data
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM