# Is the document ID likely to change in Machine Learning result index

**URL:** <https://discuss.elastic.co/t/is-the-document-id-likely-to-change-in-machine-learning-result-index/282892>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [August 31, 2021, 9:06am UTC](https://discuss.elastic.co/t/is-the-document-id-likely-to-change-in-machine-learning-result-index/282892 "2021-08-31T09:06:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![OmarDacca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/omardacca/32/68171_2.png) [@OmarDacca](https://discuss.elastic.co/u/OmarDacca)\
**Post date:** [August 31, 2021, 9:06am UTC](https://discuss.elastic.co/t/is-the-document-id-likely-to-change-in-machine-learning-result-index/282892/1 "2021-08-31T09:06:20Z")

</div>

Hi,

Is the document ID likely to change in Machine Learning result index ?

we have an anomaly alerting system, in the alerts I see document id that I can't find in the result index.

so I guess I'm right ?  
if so then why is it changing ?

---

<div class="post-metadata">

**Author:** ![droberts195](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/droberts195/32/17692_2.png) [@droberts195](https://discuss.elastic.co/u/droberts195)\
**Post date:** [August 31, 2021, 9:33am UTC](https://discuss.elastic.co/t/is-the-document-id-likely-to-change-in-machine-learning-result-index/282892/2 "2021-08-31T09:33:48Z")

</div>

There are two reasons why ML results can be changed:

1. Interim results being replaced by final results
2. Renormalization

So it's true that you cannot rely on stable `_id`s in the ML results indices.

There's some information about renormalization [here](https://www.elastic.co/guide/en/machine-learning/current/anomaly-detection-scale.html#renormalization-window). And advice about ignoring interim results for alerting purposes [here](https://discuss.elastic.co/t/ml-alerts-triggering-on-interim-result/158408/5).

---

<div class="post-metadata">

**Author:** ![OmarDacca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/omardacca/32/68171_2.png) [@OmarDacca](https://discuss.elastic.co/u/OmarDacca)\
**Post date:** [August 31, 2021, 11:01am UTC](https://discuss.elastic.co/t/is-the-document-id-likely-to-change-in-machine-learning-result-index/282892/3 "2021-08-31T11:01:32Z")

</div>

Thnaks.  
I'm not sure what is the definition of interim results, I see:

> If `true` , this is an interim result. In other words, the results are calculated based on partial input data.

what partial input data ? the historic data ? its already there, its part of the history and it won't be change, when and why the results calculated based on partial input data ?

---

<div class="post-metadata">

**Author:** ![droberts195](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/droberts195/32/17692_2.png) [@droberts195](https://discuss.elastic.co/u/droberts195)\
**Post date:** [August 31, 2021, 11:52am UTC](https://discuss.elastic.co/t/is-the-document-id-likely-to-change-in-machine-learning-result-index/282892/4 "2021-08-31T11:52:44Z")

</div>

There's a bit more about interim results in [this blog](https://www.elastic.co/blog/explaining-the-bucket-span-in-machine-learning-for-elasticsearch):

> As we receive interim data when using a datafeed, we also calculate interim results at the `frequency` interval. Interim results make adjustments for the fact that only partial data has been seen for the bucket. For functions such as min and max, interim results are very reliable. For functions such as sum, mean and count, then the reliability depends on the characteristics of the data. Adjustments for partial buckets with continuous data can be very accurate. However if your data time stamps are irregular and low volume, then it becomes difficult to assess how much of the bucket has been seen so confidence is less and interim anomalies may not be found (or in the case of `low_count` or `low_sum` functions may be inaccurate).

So basically you might get interim results if your datafeed frequency is smaller than you bucket span. Once all the data for a bucket has been seen those interim results are deleted and replaced with the final results for a bucket.

---

<div class="post-metadata">

**Author:** ![OmarDacca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/omardacca/32/68171_2.png) [@OmarDacca](https://discuss.elastic.co/u/OmarDacca)\
**Post date:** [August 31, 2021, 12:16pm UTC](https://discuss.elastic.co/t/is-the-document-id-likely-to-change-in-machine-learning-result-index/282892/5 "2021-08-31T12:16:58Z")

</div>

yes, this is the case.  
thanks a lot for help 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 28, 2021, 12:17pm UTC](https://discuss.elastic.co/t/is-the-document-id-likely-to-change-in-machine-learning-result-index/282892/6 "2021-09-28T12:17:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
