get-influencer.asciidoc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-get-influencer]]
  4. = Get influencers API
  5. ++++
  6. <titleabbrev>Get influencers</titleabbrev>
  7. ++++
  8. Retrieves {anomaly-job} results for one or more influencers.
  9. [[ml-get-influencer-request]]
  10. == {api-request-title}
  11. `GET _ml/anomaly_detectors/<job_id>/results/influencers`
  12. [[ml-get-influencer-prereqs]]
  13. == {api-prereq-title}
  14. Requires the `monitor_ml` cluster privilege. This privilege is included in the
  15. `machine_learning_user` built-in role.`
  16. [[ml-get-influencer-desc]]
  17. == {api-description-title}
  18. Influencers are the entities that have contributed to, or are to blame for,
  19. the anomalies. Influencer results are available only if an
  20. `influencer_field_name` is specified in the job configuration.
  21. [[ml-get-influencer-path-parms]]
  22. == {api-path-parms-title}
  23. `<job_id>`::
  24. (Required, string)
  25. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  26. [[ml-get-influencer-request-body]]
  27. == {api-request-body-title}
  28. `desc`::
  29. (Optional, Boolean)
  30. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=desc-results]
  31. `end`::
  32. (Optional, string) Returns influencers with timestamps earlier than this time.
  33. `exclude_interim`::
  34. (Optional, Boolean)
  35. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=exclude-interim-results]
  36. `influencer_score`::
  37. (Optional, double) Returns influencers with anomaly scores greater than or
  38. equal to this value.
  39. `page`.`from`::
  40. (Optional, integer) Skips the specified number of influencers.
  41. `page`.`size`::
  42. (Optional, integer) Specifies the maximum number of influencers to obtain.
  43. `sort`::
  44. (Optional, string) Specifies the sort field for the requested influencers. By
  45. default, the influencers are sorted by the `influencer_score` value.
  46. `start`::
  47. (Optional, string) Returns influencers with timestamps after this time.
  48. [[ml-get-influencer-results]]
  49. == {api-response-body-title}
  50. The API returns an array of influencer objects, which have the following
  51. properties:
  52. `bucket_span`::
  53. (number)
  54. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=bucket-span-results]
  55. `influencer_score`::
  56. (number) A normalized score between 0-100, which is based on the probability of
  57. the influencer in this bucket aggregated across detectors. Unlike
  58. `initial_influencer_score`, this value will be updated by a re-normalization
  59. process as new data is analyzed.
  60. `influencer_field_name`::
  61. (string) The field name of the influencer.
  62. `influencer_field_value`::
  63. (string) The entity that influenced, contributed to, or was to blame for the
  64. anomaly.
  65. `initial_influencer_score`::
  66. (number) A normalized score between 0-100, which is based on the probability of
  67. the influencer aggregated across detectors. This is the initial value that was
  68. calculated at the time the bucket was processed.
  69. `is_interim`::
  70. (Boolean)
  71. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=is-interim]
  72. `job_id`::
  73. (string)
  74. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  75. `probability`::
  76. (number) The probability that the influencer has this behavior, in the range 0
  77. to 1. For example, 0.0000109783. This value can be held to a high precision of
  78. over 300 decimal places, so the `influencer_score` is provided as a
  79. human-readable and friendly interpretation of this.
  80. `result_type`::
  81. (string) Internal. This value is always set to `influencer`.
  82. `timestamp`::
  83. (date)
  84. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=timestamp-results]
  85. NOTE: Additional influencer properties are added, depending on the fields being
  86. analyzed. For example, if it's analyzing `user_name` as an influencer, then a
  87. field `user_name` is added to the result document. This information enables you to
  88. filter the anomaly results more easily.
  89. [[ml-get-influencer-example]]
  90. == {api-examples-title}
  91. [source,console]
  92. --------------------------------------------------
  93. GET _ml/anomaly_detectors/high_sum_total_sales/results/influencers
  94. {
  95. "sort": "influencer_score",
  96. "desc": true
  97. }
  98. --------------------------------------------------
  99. // TEST[skip:Kibana sample data]
  100. In this example, the API returns the following information, sorted based on the
  101. influencer score in descending order:
  102. [source,js]
  103. ----
  104. {
  105. "count": 189,
  106. "influencers": [
  107. {
  108. "job_id": "high_sum_total_sales",
  109. "result_type": "influencer",
  110. "influencer_field_name": "customer_full_name.keyword",
  111. "influencer_field_value": "Wagdi Shaw",
  112. "customer_full_name.keyword" : "Wagdi Shaw",
  113. "influencer_score": 99.02493,
  114. "initial_influencer_score" : 94.67233079580171,
  115. "probability" : 1.4784807245686567E-10,
  116. "bucket_span" : 3600,
  117. "is_interim" : false,
  118. "timestamp" : 1574661600000
  119. },
  120. ...
  121. ]
  122. }
  123. ----