# ML What is the difference between by\_field\_name and partition\_field\_name

**URL:** <https://discuss.elastic.co/t/ml-what-is-the-difference-between-by-field-name-and-partition-field-name/108720>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [November 22, 2017, 1:35pm UTC](https://discuss.elastic.co/t/ml-what-is-the-difference-between-by-field-name-and-partition-field-name/108720 "2017-11-22T13:35:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hym](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hym/32/22399_2.png) [@hym](https://discuss.elastic.co/u/hym)\
**Post date:** [November 22, 2017, 1:35pm UTC](https://discuss.elastic.co/t/ml-what-is-the-difference-between-by-field-name-and-partition-field-name/108720/1 "2017-11-22T13:35:31Z")

</div>

Hi,  
In detector object configuration we have two fields  
by\_field\_name: used to split the data  
partition\_field\_name : used to segment the analyses

what is the difference between them?

Thanks in advance

---

<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:** [November 29, 2017, 5:28pm UTC](https://discuss.elastic.co/t/ml-what-is-the-difference-between-by-field-name-and-partition-field-name/108720/2 "2017-11-29T17:28:54Z")

</div>

- Both methods split data to establish separate baselines.
- Can be used separately or applied together in one detector (i.e. count by error\_type partition\_field=host)

If you want to “hard split” the analysis, select an “partition\_field\_name”

- The field chosen should have \< 10,000 distinct values per job, in general as more memory is required to partition
- Each instance of the field is like an independent variable
- Scoring of anomalies is more independent

If you want a “soft split”, select a “by\_field\_name”

- The field chosen should have \<100,000 distinct values per job, in general
- More appropriate for attributes of an entity (dependent variables)
- Scoring considers history of other by-fields

---

<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:** [December 27, 2017, 5:28pm UTC](https://discuss.elastic.co/t/ml-what-is-the-difference-between-by-field-name-and-partition-field-name/108720/3 "2017-12-27T17:28:58Z")

</div>

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