# Help: Create multi metric machine learning job

**URL:** <https://discuss.elastic.co/t/help-create-multi-metric-machine-learning-job/257670>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [December 4, 2020, 3:35pm UTC](https://discuss.elastic.co/t/help-create-multi-metric-machine-learning-job/257670 "2020-12-04T15:35:41Z")\
**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:** [December 4, 2020, 4:12pm UTC](https://discuss.elastic.co/t/help-create-multi-metric-machine-learning-job/257670/2 "2020-12-04T16:12:50Z")

</div>

The likely thing you really want to do here is to leverage the `rare` detector function to find a country that is rare for a user

`rare by source.geo.country_code2.keyword partition=user.name`

See a similar example here: [Dec 4th, 2018: [EN][ML] Rarity Analysis with Machine Learning](https://discuss.elastic.co/t/dec-4th-2018-en-ml-rarity-analysis-with-machine-learning/158979)

Just want to be cognizant of the cardinality of the `user.name` field. If it is really high you'll require a lot of memory utilization for the job.

Also, from your screenshot it seems like your data has empty string for some user names. You might want to filter those out in the datafeed query (??)

---

_[View the full topic](https://discuss.elastic.co/t/help-create-multi-metric-machine-learning-job/257670)._
