get-influencer.asciidoc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-get-influencer]]
  4. === Get influencers API
  5. ++++
  6. <titleabbrev>Get influencers</titleabbrev>
  7. ++++
  8. Retrieves 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. * If the {es} {security-features} are enabled, you must have `monitor_ml`,
  15. `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. You also
  16. need `read` index privilege on the index that stores the results. The
  17. `machine_learning_admin` and `machine_learning_user` roles provide these
  18. privileges. See {stack-ov}/security-privileges.html[Security privileges] and
  19. {stack-ov}/built-in-roles.html[Built-in roles].
  20. [[ml-get-influencer-path-parms]]
  21. ==== {api-path-parms-title}
  22. `<job_id>`::
  23. (Required, string) Identifier for the job.
  24. [[ml-get-influencer-request-body]]
  25. ==== {api-request-body-title}
  26. `desc`::
  27. (Optional, boolean) If true, the results are sorted in descending order.
  28. `end`::
  29. (Optional, string) Returns influencers with timestamps earlier than this time.
  30. `exclude_interim`::
  31. (Optional, boolean) If true, the output excludes interim results. By default,
  32. interim results are included.
  33. `influencer_score`::
  34. (Optional, double) Returns influencers with anomaly scores greater than or
  35. equal to this value.
  36. `page`::
  37. `from`:::
  38. (Optional, integer) Skips the specified number of influencers.
  39. `size`:::
  40. (Optional, integer) Specifies the maximum number of influencers to obtain.
  41. `sort`::
  42. (Optional, string) Specifies the sort field for the requested influencers. By
  43. default, the influencers are sorted by the `influencer_score` value.
  44. `start`::
  45. (Optional, string) Returns influencers with timestamps after this time.
  46. [[ml-get-influencer-results]]
  47. ==== {api-response-body-title}
  48. The API returns the following information:
  49. `influencers`::
  50. (array) An array of influencer objects.
  51. For more information, see <<ml-results-influencers,Influencers>>.
  52. [[ml-get-influencer-example]]
  53. ==== {api-examples-title}
  54. The following example gets influencer information for the `it_ops_new_kpi` job:
  55. [source,js]
  56. --------------------------------------------------
  57. GET _ml/anomaly_detectors/it_ops_new_kpi/results/influencers
  58. {
  59. "sort": "influencer_score",
  60. "desc": true
  61. }
  62. --------------------------------------------------
  63. // CONSOLE
  64. // TEST[skip:todo]
  65. In this example, the API returns the following information, sorted based on the
  66. influencer score in descending order:
  67. [source,js]
  68. ----
  69. {
  70. "count": 28,
  71. "influencers": [
  72. {
  73. "job_id": "it_ops_new_kpi",
  74. "result_type": "influencer",
  75. "influencer_field_name": "kpi_indicator",
  76. "influencer_field_value": "online_purchases",
  77. "kpi_indicator": "online_purchases",
  78. "influencer_score": 94.1386,
  79. "initial_influencer_score": 94.1386,
  80. "probability": 0.000111612,
  81. "bucket_span": 600,
  82. "is_interim": false,
  83. "timestamp": 1454943600000
  84. },
  85. ...
  86. ]
  87. }
  88. ----