how can one check the forecast accuracy in time series?

Assuming you are using accuracy_score from scikit-learn, it is not the correct measure here; accuracy is meant for classification problems, not for numerical prediction ones, such as forecasting problems. From the docs:

Accuracy classification score.

Most common error metrics for forecasting problems are the MSE, RMSE, and MAE; all of them are available in scikit-learn under “Regression” here:

from sklearn.metrics import mean_squared_error, mean_absolute_error

mean_squared_error(df_test['Field1'], df_results['Field1_f'])  # MSE

mean_squared_error(df_test['Field1'], df_results['Field1_f'],
                                      squared=False)           # RMSE

mean_absolute_error(df_test['Field1'], df_results['Field1_f']) # MAE

Keep in mind that, in an ML context, the term “accuracy” does not have the exact same meaning with its every-day usage; in ML it normally means classification accuracy, which, as already said, is applicable to classification problems only – although, to be honest, in forecasting the term is indeed used with its every-day meaning…

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top