Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced visualization for multivariate columns #617

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

skmanzg
Copy link

@skmanzg skmanzg commented Dec 9, 2024

I tried to fix the visualizing and saving process for convenient purposes.

Previous:

  • Multivariate predicted columns are not visualized but the last column
  • Since the name of the column is not available in the result, User had to figure out which columns is visualized
  • Metrics are calculated for the last column only from random samples, which makes it less practical
  • The user had to choose various samples from saved npy files and could not know which one was used for initial visualization.

Now:

  • Multivariate predicted columns are visualized naturally not to mention the case of univariate prediction.
  • The column's name appears in the result pdf to make it easy to interpret.
  • Metrics are calculated for each column and recorded for each when visualization. The text of 'mse, rmse, mae' appears for practical purposes instead of using dtw.
  • The user can use core_true.npy and core_pred.npy to reproduce visualized result while pred.npy and true.npy files are saved separately.

Issue: there might need a test for unexpected bugs because of this code updated

  • 'exp_long_term_forecasting.py' is the only applicable and that means, updated code might not work for the rest.
  • self.args.use_dtw does not appear in the training process nor metrics.npy. Namely, the code below is disconnected.
        if self.args.use_dtw:
            dtw_list = []
            manhattan_distance = lambda x, y: np.abs(x - y)
            for i in range(preds.shape[0]):
                x = preds[i].reshape(-1,1)
                y = trues[i].reshape(-1,1)
                if i % 100 == 0:
                    print("calculating dtw iter:", i)
                d, _, _, _ = accelerated_dtw(x, y, dist=manhattan_distance)
                dtw_list.append(d)
            dtw = np.array(dtw_list).mean()
        else:
            dtw = 'not calculated'

I have tried to preserve the original code and features as much as possible when I update except for this part. I honestly do not know how to handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant