# Getting bounds for the expected values from ML

**URL:** <https://discuss.elastic.co/t/getting-bounds-for-the-expected-values-from-ml/369292>\
**Category:** Elasticsearch\
**Created:** [October 23, 2024, 3:45pm UTC](https://discuss.elastic.co/t/getting-bounds-for-the-expected-values-from-ml/369292 "2024-10-23T15:45:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gueri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gueri/32/103243_2.png) [@gueri](https://discuss.elastic.co/u/gueri)\
**Post date:** [October 23, 2024, 3:45pm UTC](https://discuss.elastic.co/t/getting-bounds-for-the-expected-values-from-ml/369292/1 "2024-10-23T15:45:49Z")

</div>

Hello

See this ML example from Elastic documentation :

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/0/6/0626de3448fc51a90ee175b668bb14af7da3bb69.png)

I'm creating my own custom viz mixing data with ml results from .ml-anomalies-\* index.

I would like to retireve the bounds for all the expected values (the shaded blue area in the graph) but this data is not present in the .ml-anomalies-\* index.

I suppose this data is the lower\_confidence\_bound and upper\_confidence\_bound from the API results :

```auto
      "anomaly_score_explanation": {
        "single_bucket_impact": 193,
        "lower_confidence_bound": 8.674171626102172,
        "typical_value": 32.943037418742556,
        "upper_confidence_bound": 58.357583586337846,
        "by_field_relative_rarity": 1
      }

```

But :

- it is not an index so I can't use it in my viz
- the values are only given when anomaly occurs, I would like to get data for all buckets

These data are certainly internal to the model but I prefer to ask the question to be sure about that ! Thanks.

Regards

---

<div class="post-metadata">

**Author:** ![gueri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gueri/32/103243_2.png) [@gueri](https://discuss.elastic.co/u/gueri)\
**Post date:** [October 28, 2024, 3:12pm UTC](https://discuss.elastic.co/t/getting-bounds-for-the-expected-values-from-ml/369292/2 "2024-10-28T15:12:20Z")

</div>

Argh!!! My bad! In my last job, I forgot to enable this option :

> "model\_plot\_config": {  
> "enabled": "true"  
> },

---

<div class="post-metadata">

**Author:** ![jessgarson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessgarson/32/129841_2.png) [@jessgarson](https://discuss.elastic.co/u/jessgarson)\
**Post date:** [October 31, 2024, 6:48pm UTC](https://discuss.elastic.co/t/getting-bounds-for-the-expected-values-from-ml/369292/3 "2024-10-31T18:48:16Z")

</div>

Thanks for sharing your solution, @gueri.
