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

Uncertainty intervals of forecast are wrong when it goes negative. #21734

Open
3 tasks done
Dapid opened this issue Oct 7, 2022 · 7 comments
Open
3 tasks done

Uncertainty intervals of forecast are wrong when it goes negative. #21734

Dapid opened this issue Oct 7, 2022 · 7 comments
Assignees
Labels
#bug Bug report

Comments

@Dapid
Copy link

Dapid commented Oct 7, 2022

Uncertainty intervals of forecast never goes negative.

How to reproduce the bug

1 Take any data that includes negative values.
2 Run a forecast, including uncertainty interval

Expected results

I'd expect the uncertainty to be around the forecast.

Actual results

The uncertainty interval is clipped from below at 0, and behaves oddly.

Screenshots

Screenshot 2022-10-07 at 12-48-06 forecast

Environment

(please complete the following information):

  • browser type and version: Firefox 105.0.2
  • superset version: 2.0.0
  • python version: 3.8.14
  • prophet version: 1.1.1
  • any feature flags active: run as per the tutorial

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Here is some data one can use. I used Date as the X axis and min(temperature) for Y (days, weeks, or months, work fine).
Note that using max(temperature) instead yields nice-looking results, since almost all of it is positive.

@Dapid Dapid added the #bug Bug report label Oct 7, 2022
@ShaliniIruvuru
Copy link

Hi it will be very help for us to resolve this issue if you provide detailed information,

@rusackas
Copy link
Member

I'm not sure if this is still an issue in current versions of Superset (3.x). If it is, we can re-open this, or feel free to open a new issue with updated context and a reproducible case using example data. We're no longer supporting Superset 2.x or prior, and it's been a while since this thread saw any activity, so I'm closing this as stale.

@Dapid
Copy link
Author

Dapid commented Feb 26, 2024

The problem is still here in 3.1. You need any data with negative values.

For example, creating a line chart based on this query, and adding a forecast works as expected:

SELECT DATETIME(year, 'start of day') AS year,
       MIN(SP_POP_AG14_MA_IN) AS "MIN(SP_POP_AG14_MA_IN)"
FROM main.wb_health_population
GROUP BY DATETIME(year, 'start of day')
ORDER BY "MIN(SP_POP_AG14_MA_IN)" DESC
LIMIT 10000
OFFSET 0;

image

Changing the sign of the value yields instead:

image

And in fact, plotting MIN(SP_POP_AG14_MA_IN) - 170 works fine:

image

But plotting MIN(SP_POP_AG14_MA_IN) - 172 is odd again, even though there aren't any negative values.

image

@rusackas
Copy link
Member

Ahh, thanks for the context! Re-opening!

@rusackas
Copy link
Member

rusackas commented Jul 9, 2024

This issue has gone stale, but I'm hesitant to close it. Not sure if @villebro took a look at it and/or has any clues to go on.

@Dapid
Copy link
Author

Dapid commented Jul 12, 2024

The problem remains on v4.0.2.

image

I can't find where the plot is actually being done, so I haven' been able to track down the problem further. But I have checked the raw data, and prophet is modelling it correctly, is just the display.

The issue doesn't have much activity, but the bug persists, so I think closing it is wrong.

@rogerlga
Copy link

I'm struggling with this issue as well. Any attention would be greatly appreciated.

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

No branches or pull requests

5 participants