get-influencer.asciidoc 2.9 KB

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