среда, 18 марта 2020 г.

Machine Learning with Loud ML and Grafana

Once upon a time I have discovered a Loud ML AI solution on a web. It's written in Python and use Keras as a backend. Loud ML use donut unsupervised learning based models type. it is great for being able to produce ML results in near-real time.

One may create a model by simply POST to http://loudml_server:8077/models

{
        "bucket_interval": "5m",
        "default_bucket": "telegraf_autogen_cpu",
        "features": [
            {
                "name": "mean_usage_user",
                "measurement": "cpu",
                "field": "usage_user",
                "metric": "mean",
                "io": "io",
                "default": null,
                "match_all": [
                    {
                        "tag": "cpu",
                        "value": "cpu-total"
                    },
                    {
                        "tag": "host",
                        "value": "macbook4823"
                    }
                ]
            }
        ],
        "interval": "60s",
        "max_evals": 10,
        "name": "telegraf_cpu_mean_usage_user_cpu_cpu_total_host_macbook4823_5m",
        "offset": "10s",
        "span": 100,
        "type": "donut"
    }

So I have spent a bit of free time to play with these ML models.

Grafana has an easy to start example for graph panel. I have added a button "Create Baseline" to get current data selection and POST it to Loud ML server.

These are screenshots of setup.

On the top is my Loud ML panel with 3 series - 1st one is for original data (input). Series 2nd and 3rd are prediction results from Loud ML model. Bottom panel is Grafana's built-in graph and it has ability to show annotations - anomalies detected by Loud ML model.

This is screenshot of Loud ML specific options setup in panel. Next one is a Queries settings - Query A is original data from InfluxDB; Query B are predictions stored in output database.


And for reference, here is a details for model created. Model have options for GroupBy, Tags and Fill values.

Source code for Grafana panel is on GitHub: https://github.com/vsergeyev/loudml-grafana-app

It may be installed as a regular plugin, please see Grafana documentation.

Комментариев нет:

Отправить комментарий