# Combining Machine Learning forecasts with Watchers

**URL:** https://discuss.elastic.co/t/combining-machine-learning-forecasts-with-watchers/136318
**Category:** Elasticsearch
**Tags:** elastic-stack-machine-learning
**Created:** [June 18, 2018, 2:07pm UTC](https://discuss.elastic.co/t/combining-machine-learning-forecasts-with-watchers/136318 "2018-06-18T14:07:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Angelos](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Angelos](https://discuss.elastic.co/u/Angelos)
#### Post date: [June 18, 2018, 2:07pm UTC](https://discuss.elastic.co/t/combining-machine-learning-forecasts-with-watchers/136318/1 "2018-06-18T14:07:54Z")

</div>

Hello,

Anyone knows if we can combine forecasts data with watchers. For example, I have created a forecast job that predicts the behavior of a product after 3 weeks. So, now I want gather these data and create a threshold alert using watchers.  
How can I use the data and how can I create an alert?

Thank you very much in advance!  
Angelos

---

<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 18, 2018, 11:21pm UTC](https://discuss.elastic.co/t/combining-machine-learning-forecasts-with-watchers/136318/2 "2018-06-18T23:21:22Z")

</div>

The results from a forecast run will be in the `.ml-anomalies-*` index with `result_type:model_forecast` and `job_id:<jobname>`

The fields `forecast_prediction`, `forecast_upper` and `forcast_lower` are what you're looking for!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/1/1197f5f0d814949c56799c9c49c021e21abd8e8f.png)

corresponds to:

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

In your watch, you'd query this index, potentially with a timeframe of `now+3d` or whatever the amount of time you'd like to look into the future that you have forecast results for.

(I'm assuming you know Watcher basics about querying an index for a particular time range)

---

<div class="post-metadata">

### Author: ![Angelos](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Angelos](https://discuss.elastic.co/u/Angelos)
#### Post date: [June 19, 2018, 7:35am UTC](https://discuss.elastic.co/t/combining-machine-learning-forecasts-with-watchers/136318/3 "2018-06-19T07:35:53Z")

</div>

That was very helpful!  
Thank you very much Rich!

---

<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 17, 2018, 7:35am UTC](https://discuss.elastic.co/t/combining-machine-learning-forecasts-with-watchers/136318/4 "2018-07-17T07:35:58Z")

</div>

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