TypeError:predict()在ARMAX模型中预测值时缺少1个必需的位置参数:“params”

2024-06-10 12:23:07 发布

您现在位置:Python中文网/ 问答频道 /正文

这是我的代码,我在那里安装模型

model_armax = ARIMA(df.productivity, exog = df[['calories_burnt', 'fat_level', 'distance_walked', 'steps',
                                                   'weight', 'water', 'time_to_bed', 'wakeup_time', 'bedtime',
                                                   'asleep', 'sleep_periods', 'sports_total_time', 'food_quality',
                                                   'food_quantity', 'alcohol', 'energy', 'meditation',
                                                   'mood', 'stress', 'soreness', 'fitness', 'engagement',
                                                   'exploration']], order = (3,0,3))
results_armax = model_armax.fit(disp = 0)

这是预测未来趋势的代码

df_armax_forecast = model_armax.predict(start = '2020-02-22', end = '2020-07-01', 
                                          exog = df_test[['calories_burnt', 'fat_level', 'distance_walked', 'steps',
                                                          'weight', 'water', 'time_to_bed', 'wakeup_time', 'bedtime',
                                                          'asleep', 'sleep_periods', 'sports_total_time', 'food_quality',
                                                          'food_quantity', 'alcohol', 'energy', 'meditation',
                                                          'mood', 'stress', 'soreness', 'fitness', 'engagement',
                                                          'exploration']])

这是错误跟踪

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-177-dc09c88b9c6f> in <module>
      5                                                           'food_quantity', 'alcohol', 'energy', 'meditation',
      6                                                           'mood', 'stress', 'soreness', 'fitness', 'engagement',
----> 7                                                           'exploration']])

TypeError: predict() missing 1 required positional argument: 'params'

Tags: dfmodeltimefoodquantityenergyfitnessmood