Secilia-Cxy / SOFTS

Official implement for "SOFTS: Efficient Multivariate Time Series Forecasting with Series-Core Fusion" in PyTorch.

Home Page:https://arxiv.org/abs/2404.14197

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Data standardization / scaling and inverse_transform on predicted series

carusyte opened this issue · comments

To be honest, I'm not a data scientist. Just curious: if standardization is applied on the inputs:

"scaler = StandardScaler()\n",
"if 'date' in train_data.columns:\n",
" scaler.fit(train_data.iloc[:, 1:])\n",
" train_data.iloc[:, 1:] = scaler.transform(train_data.iloc[:, 1:])\n",
" vali_data.iloc[:, 1:] = scaler.transform(vali_data.iloc[:, 1:])\n",
" test_data.iloc[:, 1:] = scaler.transform(test_data.iloc[:, 1:])\n",
"else:\n",
" scaler.fit(train_data.iloc[:, :])\n",
" train_data.iloc[:, :] = scaler.transform(train_data.iloc[:, :])\n",
" vali_data.iloc[:, :] = scaler.transform(vali_data.iloc[:, :])\n",
" test_data.iloc[:, :] = scaler.transform(test_data.iloc[:, :])"

Would it be necessary or better off to perform inverse_transformation on the predictions?

"# get predictions\n",
"predictions = Exp.predict(setting=setting, pred_data=test_data)\n",
"print(predictions.shape)"

E.g.
scaler.inverse_transform(predictions)

In practical applications, it is indeed possible to use inverse_transform on the predictions. However, the reason we do not use inverse_transform in this context is that when calculating the Mean Squared Error (MSE), applying the inverse transformation can cause the MSE of certain channels to be particularly large due to the inherently high values in those channels. This would not accurately reflect the model's average predictive performance across all channels. Therefore, we choose to compute MSE on the standardized data to better assess the overall predictive ability of the model.

In practical applications, it is indeed possible to use inverse_transform on the predictions. However, the reason we do not use inverse_transform in this context is that when calculating the Mean Squared Error (MSE), applying the inverse transformation can cause the MSE of certain channels to be particularly large due to the inherently high values in those channels. This would not accurately reflect the model's average predictive performance across all channels. Therefore, we choose to compute MSE on the standardized data to better assess the overall predictive ability of the model.

This is a research convention to ensure a fair comparison among channels of different scales. See the first paper to come up with the benchmark and its code.