Wrong prediction in Flux query with HoltWinters()

The prediction of my Flux query is wrong and I don’t know why.
I only know that the second calculated “_value” of the holtWinters() output is weird (or wrong calculated):


→ And because of this second calculated “_value” the whole prediction is wrong!

Here my Flux query:

//define variables
window = 1d

data = from(bucket: "telegraf_365d")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r._measurement == "cluster_csv" and r._field == "SizeUsed" and r.Label == "CSV01")
  |> group(columns: ["FileSystemLabel"])
  |> keep(columns: ["_time", "_value", "FileSystemLabel"])
  |> aggregateWindow(every: window, fn: first, createEmpty: false)

data
  |> holtWinters(n: 20, interval: window, withFit: true)
  |> yield(name: "predictive")

data
  |> yield(name: "raw_data")

My Environment InfluxDB v2.0.5 OSS, but the same issue occurs with InfluxDB v.2.1.1 OSS.

My UseCase is very simple: I only want to predict the future like a “trend” does.
I hope someone can help me.

Here additional an output of the raw data and the calculated data from the holtWinters() function:

Hello @fluxator,
I’ve only used holtwinters with influxql. I agree that looks very wrong.
I’ve done some digging and created an issue:

Out of curiosity can you set seasonality: 0 explicitly in your holtWinters() function. Does that change anything?

Hi @Anaisdg
First I am a little relieved, I thought I was too stupid for this. :sweat_smile:
Thanks a lot for creating the GitHub Issue! :blush:
I hope this will fixed soon :thinking:

I tried with seasonality: 0 but unfortunately no difference.

1 Like