# Improve accuracy of ML model

**URL:** <https://discuss.elastic.co/t/improve-accuracy-of-ml-model/186056>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [June 17, 2019, 11:59am UTC](https://discuss.elastic.co/t/improve-accuracy-of-ml-model/186056 "2019-06-17T11:59:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bharath\_Kumar\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bharath_kumar_r/32/45474_2.png) [@Bharath\_Kumar\_R](https://discuss.elastic.co/u/Bharath_Kumar_R)\
**Post date:** [June 17, 2019, 11:59am UTC](https://discuss.elastic.co/t/improve-accuracy-of-ml-model/186056/1 "2019-06-17T11:59:44Z")

</div>

Hey, is there any way to improve the accuracy of my ML model? What parameters need to be tuned in order to increase its accuracy?

---

<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:** [June 17, 2019, 12:44pm UTC](https://discuss.elastic.co/t/improve-accuracy-of-ml-model/186056/2 "2019-06-17T12:44:32Z")

</div>

In general, the model gets more accurate by feeding it more historical data. That's the methodology of unsupervised learning. Of course, you can influence what gets modeled via filtered queries, choice of `bucket_span`, implementation of Custom Rules, etc.

Was this just a generic question or do you have some specific situation in which you believe the model that you are seeing isn't as accurate as you hope?

---

<div class="post-metadata">

**Author:** ![Bharath\_Kumar\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bharath_kumar_r/32/45474_2.png) [@Bharath\_Kumar\_R](https://discuss.elastic.co/u/Bharath_Kumar_R)\
**Post date:** [June 17, 2019, 1:05pm UTC](https://discuss.elastic.co/t/improve-accuracy-of-ml-model/186056/3 "2019-06-17T13:05:31Z")

</div>

![18%20PM](https://us1.discourse-cdn.com/elastic/original/3X/2/1/215e5d7a186e926694274aafcc7fcb314a965486.png)

As you can see here, the lower and upper bounds for the data is irregular. I want my model to have the lower and upper bounds to be as accurate as possible?

---

<div class="post-metadata">

**Author:** ![Bharath\_Kumar\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bharath_kumar_r/32/45474_2.png) [@Bharath\_Kumar\_R](https://discuss.elastic.co/u/Bharath_Kumar_R)\
**Post date:** [June 17, 2019, 1:07pm UTC](https://discuss.elastic.co/t/improve-accuracy-of-ml-model/186056/4 "2019-06-17T13:07:04Z")

</div>

Also, can you suggest me a blog which explains the advanced configuration for creating a ML job? I'm just not clear about it

---

<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:** [June 17, 2019, 1:48pm UTC](https://discuss.elastic.co/t/improve-accuracy-of-ml-model/186056/5 "2019-06-17T13:48:49Z")

</div>

Your model is actually quite accurate until you have the anomalies seen on 2019-06-16. That extended period of time has made the model have a different shape thereafter, but the model will recover after a few more days pass by.

Keep in mind that you only had about 15 days before these drastic anomalies occurred. If you had 100+ days, for example, the impact of those anomalies on the model would have been less.

If those anomalies were part of a known or planned outage, you could have avoided this situation by defining a Scheduled Event under Settings-\>Calendar

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/9/39748fd4d13c33cbc8344aaa436304c3af20d58b.png)

---

<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:** [June 17, 2019, 1:51pm UTC](https://discuss.elastic.co/t/improve-accuracy-of-ml-model/186056/6 "2019-06-17T13:51:32Z")

</div>

A nice article that explains the ins-and-outs of the Advanced Job can be found here:

> **[Elasticsearch machine learning serving cybersecurity needs \[updated\]](https://www.linkedin.com/pulse/elasticsearch-machine-learning-serving-cybersecurity-needs-smirnov/)**
>
> Article has been updated - thanks to Rich Collier from Elastic for some important corrections in the ML formula diagram! Machine learning (ML) in cybersecurity is gaining more and more attention as traditional security systems are reaching their...

I especially like how he created a visual map of how the configuration setup works:

![image](https://us1.discourse-cdn.com/elastic/original/3X/2/8/288ddbbeda718da8fcdae9e961ea4a0d10bf2247.jpeg)

---

<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:** [June 17, 2019, 1:52pm UTC](https://discuss.elastic.co/t/improve-accuracy-of-ml-model/186056/7 "2019-06-17T13:52:53Z")

</div>

If you are interested in learning more about ML you can also look up this book:

> **[Machine Learning with the Elastic Stack](https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-elastic-stack)**
>
> Leverage Elastic Stack’s machine learning features to gain valuable insight from your data

---

<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:** [July 15, 2019, 1:53pm UTC](https://discuss.elastic.co/t/improve-accuracy-of-ml-model/186056/8 "2019-07-15T13:53:01Z")

</div>

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