# Anomaly Detection transactions financial data

**URL:** <https://discuss.elastic.co/t/anomaly-detection-transactions-financial-data/330207>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [April 18, 2023, 9:16am UTC](https://discuss.elastic.co/t/anomaly-detection-transactions-financial-data/330207 "2023-04-18T09:16:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maretti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maretti/32/118976_2.png) [@Maretti](https://discuss.elastic.co/u/Maretti)\
**Post date:** [April 18, 2023, 9:16am UTC](https://discuss.elastic.co/t/anomaly-detection-transactions-financial-data/330207/1 "2023-04-18T09:16:02Z")

</div>

I have a data set that holds data like this:

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

I want to create an anomaly detection job that alerts about suspicious large transactions but when I create a anomaly detection job it always looks at for example 1 day and not at every single transaction separately

Any Idea how I can make a anomaly detection rule that looks at a single transaction?

---

<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:** [April 18, 2023, 4:30pm UTC](https://discuss.elastic.co/t/anomaly-detection-transactions-financial-data/330207/2 "2023-04-18T16:30:41Z")

</div>

Anomaly Detection jobs fundamentally work off the concept of time-slices (called [bucket\_span](https://www.elastic.co/blog/explaining-the-bucket-span-in-machine-learning-for-elasticsearch)). The user has the ability to make the `bucket_span` small, but that does not guarantee one transaction per bucket.

If unsupervised ML is still desired, an alternative approach is to use [population analysis](https://www.elastic.co/blog/temporal-vs-population-analysis-in-elastic-machine-learning) such that each entity (perhaps the sending or the receiving account) is defined as the population. Then, model a feature like the `high_sum` of the transaction amounts. In this way, you could find accounts that send/receive amounts that are much larger than the collective norm.

Alternatively, if you already know what constitutes a "large transaction" then just build a threshold rule - no ML required.

---

<div class="post-metadata">

**Author:** ![Maretti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maretti/32/118976_2.png) [@Maretti](https://discuss.elastic.co/u/Maretti)\
**Post date:** [April 19, 2023, 7:57am UTC](https://discuss.elastic.co/t/anomaly-detection-transactions-financial-data/330207/3 "2023-04-19T07:57:05Z")

</div>

Thanks for the response!

---

<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:** [May 17, 2023, 7:57am UTC](https://discuss.elastic.co/t/anomaly-detection-transactions-financial-data/330207/4 "2023-05-17T07:57:29Z")

</div>

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