7-TimeSeries/2-ARIMA Bugs

Open Beginner friendly
#1,063 3 comments 0 reactions 0 assignees View on GitHub

@Priyeshshrivastav is already working on this.

Since Nov 6, 2026.

  • #1065 by @Priyeshshrivastav — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
jupyter-notebook, matplotlib, python

Research direction

Open the ARIMA tutorial notebook under 7-TimeSeries/2-ARIMA and review the test_shifted creation and final visualization code blocks. Reproduce both issues in the notebook, then correct the shifted data and plot setup so the results match the guidance and display correctly. Confirm both fixes by rerunning those cells.

Written by the indexing model from the issue text.

Description

I try to follow the tutorial of ARIMAX model to predict the load of energy.

And I encounter two issues as below:

First, the process to creating a test_shifted for model evaluation seems wrong:

the code on guidance is

Image

If you run this code on notebook, you will got the the load+3 column, like this

Image

It's not the same as the original guidance picture ?


The second issue is the last visualization code block.

    fig = plt.figure(figsize=(15, 8))
    ax = plt.plot(plot_df['timestamp'], plot_df['actual'], color='red', linewidth=4.0)
    ax = fig.add_subplot(111)
    for t in range(1, HORIZON+1):
        x = plot_df['timestamp'][(t-1):]
        y = plot_df['t+'+str(t)][0:len(x)]
        ax.plot(x, y, color='blue', linewidth=4*math.pow(.9,t), alpha=math.pow(0.8,t))

    ax.legend(loc='best')

If run this code directly, it will create a wired picture as below (maybe because my matplotlib version)

Image

To fix this problem. Just move the fig.add_subplot() function above the actual plot.

like this

    fig = plt.figure(figsize=(15,8))
    ax = fig.add_subplot(111) # or just omit the parameter as the default will be the same
    ax.plot(plot_df['timestamp'], plot_df['actual'], color='red', linewidth=4.0)
    # the same code
Dominant language
Jupyter Notebook
Stars
91.9k
Forks
22.8k
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/ML-For-Beginners

All issues in microsoft/ML-For-Beginners

Similar issues

More Data Visualization issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.