How to apply x pack ML job on filtered data and group by field

machine-learning

(Sarvendra Singh) #1

Hi Team,
how to apply filter in x pack ML job..
for example we don't apply to mean(number_of_records) on all records only for some values(for example location="US")..also please let us know how we can apply group by some fild in xpack ML job....like calculate mean(no_of records) group by location

Thanks in advance.

Thanks
Sarvendra


(rich collier) #2

Hi,

You have two choices.

  1. Build the filtered search in Kibana, save it as a "Saved search". Then when creating an ML job, you can use that Saved search as the basis for the job.
  2. When creating an ML job either using the Advanced Job UI or via the API, you can modify the query used in the datafeed to employ elasticsearch DSL - just like the other example we showed you on the scripted fields thread.

(system) #3

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