Transformations: Add regression analysis transformation (#78457)

* regression analysis first dragt

* Swap to better regression libraries

* fix name

* Interpolate x points instead of using source x points

* clean up ui and add feature toggle

* fix merge error

* change to loop for finding min max, rename resolution

* Add docs

* add docs and tests

* change name to regression analysis

* update docs

* Fix editor labels

* add regression images

* fix docs
This commit is contained in:
Oscar Kilhed
2023-11-24 15:49:16 +01:00
committed by GitHub
parent 7fa73d2b21
commit ab982e7bd3
17 changed files with 714 additions and 0 deletions

View File

@ -1266,6 +1266,19 @@ For each generated **Trend** field value, a calculation function can be selected
> **Note:** This transformation is available in Grafana 9.5+ as an opt-in beta feature. Modify the Grafana [configuration file][] to use it.
### Regression analysis
Use this transformation to create a new data frame containing values predicted by a statistical model. This is useful for finding a trend in chaotic data. It works by fitting a mathematical function to the data, using either linear or polynomial regression. The data frame can then be used in a visualization to display a trendline.
There are two different models:
- **Linear regression** - Fits a linear function to the data.
{{< figure src="/static/img/docs/transformations/linear-regression.png" class="docs-image--no-shadow" max-width= "1100px" >}}
- **Polynomial regression** - Fits a polynomial function to the data.
{{< figure src="/static/img/docs/transformations/polynomial-regression.png" class="docs-image--no-shadow" max-width= "1100px" >}}
> **Note:** This transformation is an experimental feature. Engineering and on-call support is not available. Documentation is either limited or not provided outside of code comments. No SLA is provided. Enable the `regressionTransformation` feature toggle in Grafana to use this feature. Contact Grafana Support to enable this feature in Grafana Cloud.
{{% docs/reference %}}
[Table panel]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/visualizations/table"
[Table panel]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/visualizations/table"