# Does applying custom rules on machine learning jobs altert the ML model?

**URL:** <https://discuss.elastic.co/t/does-applying-custom-rules-on-machine-learning-jobs-altert-the-ml-model/283797>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [September 9, 2021, 3:09pm UTC](https://discuss.elastic.co/t/does-applying-custom-rules-on-machine-learning-jobs-altert-the-ml-model/283797 "2021-09-09T15:09:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [September 9, 2021, 3:09pm UTC](https://discuss.elastic.co/t/does-applying-custom-rules-on-machine-learning-jobs-altert-the-ml-model/283797/1 "2021-09-09T15:09:22Z")

</div>

Hi, I was wondering if applying custom rules on machine learning jobs altert the ML model? or the ML model stays the same, just those anomalies are not shown?

---

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [September 9, 2021, 3:42pm UTC](https://discuss.elastic.co/t/does-applying-custom-rules-on-machine-learning-jobs-altert-the-ml-model/283797/2 "2021-09-09T15:42:14Z")

</div>

It can do either/or/both.

Skip result = don't create an anomaly if the condition is met  
Skip model update = don't alter the model if the condition is met

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/f/dfca4161fad291c975000f4a6149e3305d5b6214.jpeg)

---

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [September 9, 2021, 4:33pm UTC](https://discuss.elastic.co/t/does-applying-custom-rules-on-machine-learning-jobs-altert-the-ml-model/283797/3 "2021-09-09T16:33:35Z")

</div>

Thanks Rich, So if in a metric I have values from 1 to 100 and I choose to skip the model update and skip values over and under, in a way ML will "know" that my metric moves in that range and it will give me better anomaly results?

---

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [September 9, 2021, 6:08pm UTC](https://discuss.elastic.co/t/does-applying-custom-rules-on-machine-learning-jobs-altert-the-ml-model/283797/4 "2021-09-09T18:08:45Z")

</div>

not quite understanding your question... If your metric is in the range of 1 to 100 (always?) then it doesn't make sense to skip over/under if they never go over/under. Or maybe, you're trying to protect yourself from badly reported data?

---

<div class="post-metadata">

**Author:** ![tomyui](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@tomyui](https://discuss.elastic.co/u/tomyui)\
**Post date:** [September 15, 2021, 4:17am UTC](https://discuss.elastic.co/t/does-applying-custom-rules-on-machine-learning-jobs-altert-the-ml-model/283797/5 "2021-09-15T04:17:40Z")

</div>

How about:

If the metric NORMALLY is in the range of 1 to 100.  
But sometimes it would go under/over, which is an anomaly.

Does skipping model update give me better result?  
And should we skip model update in case of anomaly? is it a good practice?

---

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [September 15, 2021, 11:17am UTC](https://discuss.elastic.co/t/does-applying-custom-rules-on-machine-learning-jobs-altert-the-ml-model/283797/6 "2021-09-15T11:17:51Z")

</div>

Elastic ML already tries to not let anomalous values overly affect the model - so trying to manage it on your own with custom rules, while possible, is likely not really worth the effort.

However, with that said, if you ever get into a position where you feel like the model is "wrecked" by some unruly data, you can revert the model to a previous snapshot (to a time before your unruly input data): [Model snapshots | Machine Learning in the Elastic Stack [7.14] | Elastic](https://www.elastic.co/guide/en/machine-learning/current/ml-model-snapshots.html)

---

<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:** [October 13, 2021, 11:18am UTC](https://discuss.elastic.co/t/does-applying-custom-rules-on-machine-learning-jobs-altert-the-ml-model/283797/7 "2021-10-13T11:18:17Z")

</div>

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