2017-04-04 18:26:39 -04:00
|
|
|
[[ml-get-influencer]]
|
|
|
|
==== Get Influencers
|
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
The get influencers API enables you to retrieve information about the influencers
|
2017-04-10 19:14:26 -04:00
|
|
|
in a job.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
===== Request
|
|
|
|
|
|
|
|
`GET _xpack/ml/anomaly_detectors/<job_id>/results/influencers`
|
|
|
|
|
|
|
|
////
|
|
|
|
===== Description
|
|
|
|
|
|
|
|
////
|
|
|
|
===== Path Parameters
|
|
|
|
|
|
|
|
`job_id`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Identifier for the job.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-10 19:14:26 -04:00
|
|
|
===== Request Body
|
|
|
|
|
|
|
|
`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
|
|
|
//TBD: Using the "sort" value?
|
|
|
|
|
|
|
|
`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
|
|
|
|
|
|
|
`from`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(integer) Skips the specified number of influencers.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
|
|
|
`include_interim`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(boolean) If true, the output includes interim results.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
|
|
|
`influencer_score`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(double) Returns influencers with anomaly scores higher than this value.
|
2017-04-10 19:14:26 -04:00
|
|
|
|
|
|
|
`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-04-10 19:14:26 -04:00
|
|
|
//TBD: By default the results are sorted on the influencer score?
|
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-10 19:14:26 -04:00
|
|
|
===== Results
|
|
|
|
|
|
|
|
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-04-10 19:14:26 -04:00
|
|
|
////
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Responses
|
|
|
|
|
|
|
|
200
|
|
|
|
(EmptyResponse) The cluster has been successfully deleted
|
|
|
|
404
|
|
|
|
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found (code: clusters.cluster_not_found)
|
|
|
|
412
|
|
|
|
(BasicFailedReply) The Elasticsearch cluster has not been shutdown yet (code: clusters.cluster_plan_state_error)
|
2017-04-10 19:14:26 -04:00
|
|
|
////
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Examples
|
|
|
|
|
2017-04-10 19:14:26 -04:00
|
|
|
The following example gets influencer information for the `it_ops_new_kpi` job:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET _xpack/ml/anomaly_detectors/it_ops_new_kpi/results/influencers
|
|
|
|
{
|
|
|
|
"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-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,
|
|
|
|
"sequence_num": 2,
|
|
|
|
"bucket_span": 600,
|
|
|
|
"is_interim": false,
|
|
|
|
"timestamp": 1454943600000
|
|
|
|
},
|
|
|
|
...
|
2017-04-04 18:26:39 -04:00
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|