Using InfluxDB 2.1.1 on Linux
I am trying to use the statsmodels.linearRegression() function. The problem I am currently struggling with is that the groupings are not considered.
Here is the script:
import "contrib/anaisdg/statsmodels" original = from(bucket: "my_bucket") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == "aht") |> filter(fn: (r) => r["_field"] == "mean" and r._value > 0) |> group(columns: ["application"]) // <-- group by application tag |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false) original |> yield(name: "original") original |> statsmodels.linearRegression() |> yield(name: "lr")
The problem is: the values y_hat do not consider the groups, the linear regression seems to be calculated only for the first group (helpdesk), the values for other groups (ivr, serfselrvice) seems to be ignored.
Maybe I’m doing something wrong?