2017-06-19 21:23:58 -04:00
|
|
|
[role="xpack"]
|
2018-08-31 19:49:24 -04:00
|
|
|
[testenv="platinum"]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-get-influencer]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Get influencers API
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Get influencers</titleabbrev>
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-30 13:52:23 -04:00
|
|
|
Retrieves {anomaly-job} results for one or more influencers.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-influencer-request]]
|
|
|
|
==== {api-request-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`GET _ml/anomaly_detectors/<job_id>/results/influencers`
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 16:58:42 -04:00
|
|
|
[[ml-get-influencer-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have `monitor_ml`,
|
|
|
|
`monitor`, `manage_ml`, or `manage` cluster privileges to use this API. You also
|
|
|
|
need `read` index privilege on the index that stores the results. The
|
|
|
|
`machine_learning_admin` and `machine_learning_user` roles provide these
|
2019-10-07 18:23:19 -04:00
|
|
|
privileges. See <<security-privileges>> and
|
|
|
|
<<built-in-roles>>.
|
2019-06-27 16:58:42 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-influencer-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`<job_id>`::
|
2019-07-30 13:52:23 -04:00
|
|
|
(Required, string) Identifier for the {anomaly-job}.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-influencer-request-body]]
|
|
|
|
==== {api-request-body-title}
|
2017-04-10 19:14:26 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`desc`::
|
|
|
|
(Optional, boolean) If true, the results are sorted in descending order.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`end`::
|
|
|
|
(Optional, string) Returns influencers with timestamps earlier than this time.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`exclude_interim`::
|
|
|
|
(Optional, boolean) If true, the output excludes interim results. By default,
|
|
|
|
interim results are included.
|
2017-04-24 13:46:17 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`influencer_score`::
|
|
|
|
(Optional, double) Returns influencers with anomaly scores greater than or
|
|
|
|
equal to this value.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`page`::
|
2017-05-08 09:53:04 -04:00
|
|
|
`from`:::
|
2019-07-12 11:26:31 -04:00
|
|
|
(Optional, integer) Skips the specified number of influencers.
|
2017-05-08 09:53:04 -04:00
|
|
|
`size`:::
|
2019-07-12 11:26:31 -04:00
|
|
|
(Optional, integer) Specifies the maximum number of influencers to obtain.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`sort`::
|
|
|
|
(Optional, string) Specifies the sort field for the requested influencers. By
|
|
|
|
default, the influencers are sorted by the `influencer_score` value.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`start`::
|
|
|
|
(Optional, string) Returns influencers with timestamps after this time.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-influencer-results]]
|
|
|
|
==== {api-response-body-title}
|
2017-04-10 19:14:26 -04:00
|
|
|
|
|
|
|
The API returns the following information:
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-10 19:14:26 -04:00
|
|
|
`influencers`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(array) An array of influencer objects.
|
2017-04-10 19:14:26 -04:00
|
|
|
For more information, see <<ml-results-influencers,Influencers>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-influencer-example]]
|
|
|
|
==== {api-examples-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-10 19:14:26 -04:00
|
|
|
The following example gets influencer information for the `it_ops_new_kpi` job:
|
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2017-04-10 19:14:26 -04:00
|
|
|
--------------------------------------------------
|
2018-12-07 15:34:11 -05:00
|
|
|
GET _ml/anomaly_detectors/it_ops_new_kpi/results/influencers
|
2017-04-10 19:14:26 -04:00
|
|
|
{
|
|
|
|
"sort": "influencer_score",
|
|
|
|
"desc": true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[skip:todo]
|
|
|
|
|
|
|
|
In this example, the API returns the following information, sorted based on the
|
|
|
|
influencer score in descending order:
|
2017-04-21 11:23:27 -04:00
|
|
|
[source,js]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
2017-04-11 21:52:47 -04:00
|
|
|
"count": 28,
|
2017-04-10 19:14:26 -04:00
|
|
|
"influencers": [
|
|
|
|
{
|
|
|
|
"job_id": "it_ops_new_kpi",
|
|
|
|
"result_type": "influencer",
|
|
|
|
"influencer_field_name": "kpi_indicator",
|
|
|
|
"influencer_field_value": "online_purchases",
|
|
|
|
"kpi_indicator": "online_purchases",
|
|
|
|
"influencer_score": 94.1386,
|
|
|
|
"initial_influencer_score": 94.1386,
|
|
|
|
"probability": 0.000111612,
|
|
|
|
"bucket_span": 600,
|
|
|
|
"is_interim": false,
|
|
|
|
"timestamp": 1454943600000
|
|
|
|
},
|
|
|
|
...
|
2017-04-04 18:26:39 -04:00
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|