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]]
|
2017-12-14 13:52:49 -05:00
|
|
|
=== Get Influencers API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Get Influencers</titleabbrev>
|
|
|
|
++++
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-06-13 16:37:35 -04:00
|
|
|
Retrieves job results for one or more influencers.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Request
|
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
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
//===== Description
|
2017-04-18 18:13:21 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Path Parameters
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`job_id`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Identifier for the job.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Request Body
|
2017-04-10 19:14:26 -04:00
|
|
|
|
|
|
|
`desc`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(boolean) If true, the results are sorted in descending order.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
|
|
|
`end`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Returns influencers with timestamps earlier than this time.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
2017-04-24 13:46:17 -04:00
|
|
|
`exclude_interim`::
|
|
|
|
(boolean) If true, the output excludes interim results.
|
|
|
|
By default, interim results are included.
|
|
|
|
|
2017-04-10 19:14:26 -04:00
|
|
|
`influencer_score`::
|
2017-12-08 11:03:51 -05:00
|
|
|
(double) Returns influencers with anomaly scores greater or equal than this value.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
2017-05-08 09:53:04 -04:00
|
|
|
`page`::
|
|
|
|
`from`:::
|
|
|
|
(integer) Skips the specified number of influencers.
|
|
|
|
`size`:::
|
2017-04-11 22:26:18 -04:00
|
|
|
(integer) Specifies the maximum number of influencers to obtain.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
|
|
|
`sort`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Specifies the sort field for the requested influencers.
|
2017-05-18 11:40:54 -04:00
|
|
|
By default the influencers are sorted by the `influencer_score` value.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-10 19:14:26 -04:00
|
|
|
`start`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Returns influencers with timestamps after this time.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Results
|
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
|
|
|
|
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Authorization
|
2017-04-25 17:08:29 -04:00
|
|
|
|
|
|
|
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 privileges. For more information, see
|
2017-06-19 21:23:58 -04:00
|
|
|
{xpack-ref}/security-privileges.html[Security Privileges] and
|
|
|
|
{xpack-ref}/built-in-roles.html[Built-in Roles].
|
|
|
|
//<<security-privileges>> and <<built-in-roles>>.
|
2017-04-25 17:08:29 -04:00
|
|
|
|
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Examples
|
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:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
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
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// 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
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|