# 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:** 1\
**Showing post:** 2

<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

---

_[View the full topic](https://discuss.elastic.co/t/ml-what-is-the-difference-between-by-field-name-and-partition-field-name/108720)._
