populations.asciidoc 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. [role="xpack"]
  2. [[ml-configuring-pop]]
  3. === Performing population analysis
  4. Entities or events in your data can be considered anomalous when:
  5. * Their behavior changes over time, relative to their own previous behavior, or
  6. * Their behavior is different than other entities in a specified population.
  7. The latter method of detecting outliers is known as _population analysis_. The
  8. {ml} analytics build a profile of what a "typical" user, machine, or other entity
  9. does over a specified time period and then identify when one is behaving
  10. abnormally compared to the population.
  11. This type of analysis is most useful when the behavior of the population as a
  12. whole is mostly homogeneous and you want to identify outliers. In general,
  13. population analysis is not useful when members of the population inherently
  14. have vastly different behavior. You can, however, segment your data into groups
  15. that behave similarly and run these as separate jobs. For example, you can use a
  16. query filter in the {dfeed} to segment your data or you can use the
  17. `partition_field_name` to split the analysis for the different groups.
  18. Population analysis scales well and has a lower resource footprint than
  19. individual analysis of each series. For example, you can analyze populations
  20. of hundreds of thousands or millions of entities.
  21. To specify the population, use the `over_field_name` property. For example:
  22. [source,js]
  23. ----------------------------------
  24. PUT _xpack/ml/anomaly_detectors/population
  25. {
  26. "description" : "Population analysis",
  27. "analysis_config" : {
  28. "bucket_span":"10m",
  29. "influencers": [
  30. "username"
  31. ],
  32. "detectors": [
  33. {
  34. "function": "mean",
  35. "field_name": "bytesSent",
  36. "over_field_name": "username" <1>
  37. }
  38. ]
  39. },
  40. "data_description" : {
  41. "time_field":"@timestamp",
  42. "time_format": "epoch_ms"
  43. }
  44. }
  45. ----------------------------------
  46. //CONSOLE
  47. // TEST[skip:needs-licence]
  48. <1> This `over_field_name` property indicates that the metrics for each user (
  49. as identified by their `username` value) are analyzed relative to other users
  50. in each bucket.
  51. If your data is stored in {es}, you can use the population job wizard in {kib}
  52. to create a job with these same properties. For example, the population job
  53. wizard provides the following job settings:
  54. [role="screenshot"]
  55. image::images/ml-population-job.jpg["Job settings in the population job wizard]
  56. After you open the job and start the {dfeed} or supply data to the job, you can
  57. view the results in {kib}. For example, you can view the results in the
  58. **Anomaly Explorer**:
  59. [role="screenshot"]
  60. image::images/ml-population-results.jpg["Population analysis results in the Anomaly Explorer"]
  61. As in this case, the results are often quite sparse. There might be just a few
  62. data points for the selected time period. Population analysis is particularly
  63. useful when you have many entities and the data for specific entitles is sporadic
  64. or sparse.
  65. If you click on a section in the timeline or swimlanes, you can see more
  66. details about the anomalies:
  67. [role="screenshot"]
  68. image::images/ml-population-anomaly.jpg["Anomaly details for a specific user"]
  69. In this example, the user identified as `antonette` sent a high volume of bytes
  70. on the date and time shown. This event is anomalous because the mean is two times
  71. higher than the expected behavior of the population.