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