1
0

get-dfanalytics-stats.asciidoc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[get-dfanalytics-stats]]
  4. = Get {dfanalytics-jobs} statistics API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Get {dfanalytics-jobs} stats</titleabbrev>
  8. ++++
  9. Retrieves usage information for {dfanalytics-jobs}.
  10. [[ml-get-dfanalytics-stats-request]]
  11. == {api-request-title}
  12. `GET _ml/data_frame/analytics/<data_frame_analytics_id>/_stats` +
  13. `GET _ml/data_frame/analytics/<data_frame_analytics_id>,<data_frame_analytics_id>/_stats` +
  14. `GET _ml/data_frame/analytics/_stats` +
  15. `GET _ml/data_frame/analytics/_all/_stats` +
  16. `GET _ml/data_frame/analytics/*/_stats`
  17. [[ml-get-dfanalytics-stats-prereq]]
  18. == {api-prereq-title}
  19. Requires the `monitor_ml` cluster privilege. This privilege is included in the
  20. `machine_learning_user` built-in role.
  21. [[ml-get-dfanalytics-stats-path-params]]
  22. == {api-path-parms-title}
  23. `<data_frame_analytics_id>`::
  24. (Optional, string)
  25. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-data-frame-analytics-default]
  26. [[ml-get-dfanalytics-stats-query-params]]
  27. == {api-query-parms-title}
  28. `allow_no_match`::
  29. (Optional, Boolean)
  30. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=allow-no-match]
  31. `from`::
  32. (Optional, integer)
  33. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=from]
  34. `size`::
  35. (Optional, integer)
  36. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=size]
  37. `verbose`::
  38. (Optional, Boolean)
  39. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=verbose]
  40. [role="child_attributes"]
  41. [[ml-get-dfanalytics-stats-response-body]]
  42. == {api-response-body-title}
  43. `data_frame_analytics`::
  44. (array)
  45. An array of objects that contain usage information for {dfanalytics-jobs}, which
  46. are sorted by the `id` value in ascending order.
  47. +
  48. .Properties of {dfanalytics-job} usage resources
  49. [%collapsible%open]
  50. ====
  51. //Begin analysis_stats
  52. `analysis_stats`:::
  53. (object)
  54. An object containing information about the analysis job.
  55. +
  56. .Properties of `analysis_stats`
  57. [%collapsible%open]
  58. =====
  59. //Begin classification_stats
  60. `classification_stats`::::
  61. (object)
  62. An object containing information about the {classanalysis} job.
  63. +
  64. .Properties of `classification_stats`
  65. [%collapsible%open]
  66. ======
  67. //Begin class_hyperparameters
  68. `hyperparameters`::::
  69. (object)
  70. An object containing the parameters of the {classanalysis} job.
  71. +
  72. .Properties of `hyperparameters`
  73. [%collapsible%open]
  74. =======
  75. `alpha`::::
  76. (double)
  77. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-alpha]
  78. `class_assignment_objective`::::
  79. (string)
  80. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=class-assignment-objective]
  81. `downsample_factor`::::
  82. (double)
  83. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-downsample-factor]
  84. `eta`::::
  85. (double)
  86. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=eta]
  87. `eta_growth_rate_per_tree`::::
  88. (double)
  89. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-eta-growth]
  90. `feature_bag_fraction`::::
  91. (double)
  92. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=feature-bag-fraction]
  93. `gamma`::::
  94. (double)
  95. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=gamma]
  96. `lambda`::::
  97. (double)
  98. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=lambda]
  99. `max_attempts_to_add_tree`::::
  100. (integer)
  101. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-max-attempts]
  102. `max_optimization_rounds_per_hyperparameter`::::
  103. (integer)
  104. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-max-optimization-rounds]
  105. `max_trees`::::
  106. (integer)
  107. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=max-trees]
  108. `num_folds`::::
  109. (integer)
  110. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-num-folds]
  111. `num_splits_per_feature`::::
  112. (integer)
  113. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-num-splits]
  114. `soft_tree_depth_limit`::::
  115. (double)
  116. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-soft-limit]
  117. `soft_tree_depth_tolerance`::::
  118. (double)
  119. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-soft-tolerance]
  120. =======
  121. //End class_hyperparameters
  122. `iteration`::::
  123. (integer)
  124. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-iteration]
  125. `timestamp`::::
  126. (date)
  127. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timestamp]
  128. //Begin class_timing_stats
  129. `timing_stats`::::
  130. (object)
  131. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timing-stats]
  132. +
  133. .Properties of `timing_stats`
  134. [%collapsible%open]
  135. =======
  136. `elapsed_time`::::
  137. (integer)
  138. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timing-stats-elapsed]
  139. `iteration_time`::::
  140. (integer)
  141. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timing-stats-iteration]
  142. =======
  143. //End class_timing_stats
  144. //Begin class_validation_loss
  145. `validation_loss`::::
  146. (object)
  147. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-validation-loss]
  148. +
  149. .Properties of `validation_loss`
  150. [%collapsible%open]
  151. =======
  152. `fold_values`::::
  153. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-validation-loss-fold]
  154. `loss_type`::::
  155. (string)
  156. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-validation-loss-type]
  157. =======
  158. //End class_validation_loss
  159. ======
  160. //End classification_stats
  161. //Begin outlier_detection_stats
  162. `outlier_detection_stats`::::
  163. (object)
  164. An object containing information about the {oldetection} job.
  165. +
  166. .Properties of `outlier_detection_stats`
  167. [%collapsible%open]
  168. ======
  169. //Begin parameters
  170. `parameters`::::
  171. (object)
  172. The list of job parameters specified by the user or determined by algorithmic
  173. heuristics.
  174. +
  175. .Properties of `parameters`
  176. [%collapsible%open]
  177. =======
  178. `compute_feature_influence`::::
  179. (Boolean)
  180. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=compute-feature-influence]
  181. `feature_influence_threshold`::::
  182. (double)
  183. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=feature-influence-threshold]
  184. `method`::::
  185. (string)
  186. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=method]
  187. `n_neighbors`::::
  188. (integer)
  189. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=n-neighbors]
  190. `outlier_fraction`::::
  191. (double)
  192. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=outlier-fraction]
  193. `standardization_enabled`::::
  194. (Boolean)
  195. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=standardization-enabled]
  196. =======
  197. //End parameters
  198. `timestamp`::::
  199. (date)
  200. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timestamp]
  201. //Begin od_timing_stats
  202. `timing_stats`::::
  203. (object)
  204. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timing-stats]
  205. +
  206. .Property of `timing_stats`
  207. [%collapsible%open]
  208. =======
  209. `elapsed_time`::::
  210. (integer)
  211. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timing-stats-elapsed]
  212. =======
  213. //End od_timing_stats
  214. ======
  215. //End outlier_detection_stats
  216. //Begin regression_stats
  217. `regression_stats`::::
  218. (object)
  219. An object containing information about the {reganalysis} job.
  220. +
  221. .Properties of `regression_stats`
  222. [%collapsible%open]
  223. ======
  224. //Begin reg_hyperparameters
  225. `hyperparameters`::::
  226. (object)
  227. An object containing the parameters of the {reganalysis} job.
  228. +
  229. .Properties of `hyperparameters`
  230. [%collapsible%open]
  231. =======
  232. `alpha`::::
  233. (double)
  234. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-alpha]
  235. `downsample_factor`::::
  236. (double)
  237. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-downsample-factor]
  238. `eta`::::
  239. (double)
  240. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=eta]
  241. `eta_growth_rate_per_tree`::::
  242. (double)
  243. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-eta-growth]
  244. `feature_bag_fraction`::::
  245. (double)
  246. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=feature-bag-fraction]
  247. `gamma`::::
  248. (double)
  249. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=gamma]
  250. `lambda`::::
  251. (double)
  252. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=lambda]
  253. `max_attempts_to_add_tree`::::
  254. (integer)
  255. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-max-attempts]
  256. `max_optimization_rounds_per_hyperparameter`::::
  257. (integer)
  258. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-max-optimization-rounds]
  259. `max_trees`::::
  260. (integer)
  261. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=max-trees]
  262. `num_folds`::::
  263. (integer)
  264. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-num-folds]
  265. `num_splits_per_feature`::::
  266. (integer)
  267. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-num-splits]
  268. `soft_tree_depth_limit`::::
  269. (double)
  270. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-soft-limit]
  271. `soft_tree_depth_tolerance`::::
  272. (double)
  273. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-soft-tolerance]
  274. =======
  275. //End reg_hyperparameters
  276. `iteration`::::
  277. (integer)
  278. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-iteration]
  279. `timestamp`::::
  280. (date)
  281. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timestamp]
  282. //Begin reg_timing_stats
  283. `timing_stats`::::
  284. (object)
  285. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timing-stats]
  286. +
  287. .Propertis of `timing_stats`
  288. [%collapsible%open]
  289. =======
  290. `elapsed_time`::::
  291. (integer)
  292. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timing-stats-elapsed]
  293. `iteration_time`::::
  294. (integer)
  295. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-timing-stats-iteration]
  296. =======
  297. //End reg_timing_stats
  298. //Begin reg_validation_loss
  299. `validation_loss`::::
  300. (object)
  301. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-validation-loss]
  302. +
  303. .Properties of `validation_loss`
  304. [%collapsible%open]
  305. =======
  306. `fold_values`::::
  307. (array of strings)
  308. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-validation-loss-fold]
  309. `loss_type`::::
  310. (string)
  311. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=dfas-validation-loss-type]
  312. =======
  313. //End reg_validation_loss
  314. ======
  315. //End regression_stats
  316. =====
  317. //End analysis_stats
  318. `assignment_explanation`:::
  319. (string)
  320. For running jobs only, contains messages relating to the selection of a node to
  321. run the job.
  322. //Begin data_counts
  323. `data_counts`:::
  324. (object)
  325. An object that provides counts for the quantity of documents skipped, used in
  326. training, or available for testing.
  327. +
  328. .Properties of `data_counts`
  329. [%collapsible%open]
  330. =====
  331. `skipped_docs_count`::::
  332. (integer)
  333. The number of documents that are skipped during the analysis because they
  334. contained values that are not supported by the analysis. For example,
  335. {oldetection} does not support missing fields so it skips documents with missing
  336. fields. Likewise, all types of analysis skip documents that contain arrays with
  337. more than one element.
  338. `test_docs_count`::::
  339. (integer)
  340. The number of documents that are not used for training the model and can be used
  341. for testing.
  342. `training_docs_count`::::
  343. (integer)
  344. The number of documents that are used for training the model.
  345. =====
  346. //End data_counts
  347. `id`:::
  348. (string)
  349. The unique identifier of the {dfanalytics-job}.
  350. `memory_usage`:::
  351. (Optional, object)
  352. An object describing memory usage of the analytics. It is present only after the
  353. job is started and memory usage is reported.
  354. +
  355. .Properties of `memory_usage`
  356. [%collapsible%open]
  357. =====
  358. `memory_reestimate_bytes`::::
  359. (long)
  360. This value is present when the `status` is `hard_limit` and it
  361. is a new estimate of how much memory the job needs.
  362. `peak_usage_bytes`::::
  363. (long)
  364. The number of bytes used at the highest peak of memory usage.
  365. `status`::::
  366. (string)
  367. The memory usage status. May have one of the following values:
  368. +
  369. --
  370. * `ok`: usage stayed below the limit.
  371. * `hard_limit`: usage surpassed the configured memory limit.
  372. --
  373. `timestamp`::::
  374. (date)
  375. The timestamp when memory usage was calculated.
  376. =====
  377. `node`:::
  378. (object)
  379. Contains properties for the node that runs the job. This information is
  380. available only for running jobs.
  381. +
  382. .Properties of `node`
  383. [%collapsible%open]
  384. =====
  385. `attributes`::::
  386. (object)
  387. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-attributes]
  388. `ephemeral_id`::::
  389. (string)
  390. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-ephemeral-id]
  391. `id`::::
  392. (string)
  393. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-id]
  394. `name`::::
  395. (string)
  396. The node name.
  397. `transport_address`::::
  398. (string)
  399. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-transport-address]
  400. =====
  401. `progress`:::
  402. (array) The progress report of the {dfanalytics-job} by phase.
  403. +
  404. .Properties of phase objects
  405. [%collapsible%open]
  406. =====
  407. `phase`::::
  408. (string) Defines the phase of the {dfanalytics-job}. Possible phases:
  409. * `reindexing`,
  410. * `loading_data`,
  411. * `computing_outliers` (for {oldetection} only),
  412. * `feature_selection` (for {regression} and {classification} only),
  413. * `coarse_parameter_search` (for {regression} and {classification} only),
  414. * `fine_tuning_parameters` (for {regression} and {classification} only),
  415. * `final_training` (for {regression} and {classification} only),
  416. * `writing_results`,
  417. * `inference` (for {regression} and {classification} only).
  418. +
  419. To learn more about the different phases, refer to
  420. {ml-docs}/ml-dfa-phases.html[How a {dfanalytics} job works].
  421. `progress_percent`::::
  422. (integer) The progress that the {dfanalytics-job} has made expressed in
  423. percentage.
  424. =====
  425. `state`:::
  426. (string) The status of the {dfanalytics-job}, which can be one of the following
  427. values: `failed`, `started`, `starting`,`stopping`, `stopped`.
  428. ====
  429. //End of data_frame_analytics
  430. [[ml-get-dfanalytics-stats-response-codes]]
  431. == {api-response-codes-title}
  432. `404` (Missing resources)::
  433. If `allow_no_match` is `false`, this code indicates that there are no
  434. resources that match the request or only partial matches for the request.
  435. [[ml-get-dfanalytics-stats-example]]
  436. == {api-examples-title}
  437. The following API retrieves usage information for the
  438. {ml-docs}/ml-dfa-finding-outliers.html#ecommerce-outliers[{oldetection} {dfanalytics-job} example]:
  439. [source,console]
  440. --------------------------------------------------
  441. GET _ml/data_frame/analytics/ecommerce/_stats
  442. --------------------------------------------------
  443. // TEST[skip:Kibana sample data]
  444. [source,console-result]
  445. ----
  446. {
  447. "count" : 1,
  448. "data_frame_analytics" : [
  449. {
  450. "id" : "ecommerce",
  451. "state" : "stopped",
  452. "progress" : [
  453. {
  454. "phase" : "reindexing",
  455. "progress_percent" : 100
  456. },
  457. {
  458. "phase" : "loading_data",
  459. "progress_percent" : 100
  460. },
  461. {
  462. "phase" : "analyzing",
  463. "progress_percent" : 100
  464. },
  465. {
  466. "phase" : "writing_results",
  467. "progress_percent" : 100
  468. }
  469. ],
  470. "data_counts" : {
  471. "training_docs_count" : 3321,
  472. "test_docs_count" : 0,
  473. "skipped_docs_count" : 0
  474. },
  475. "memory_usage" : {
  476. "timestamp" : 1586905058000,
  477. "peak_usage_bytes" : 279484
  478. },
  479. "analysis_stats" : {
  480. "outlier_detection_stats" : {
  481. "timestamp" : 1586905058000,
  482. "parameters" : {
  483. "n_neighbors" : 0,
  484. "method" : "ensemble",
  485. "compute_feature_influence" : true,
  486. "feature_influence_threshold" : 0.1,
  487. "outlier_fraction" : 0.05,
  488. "standardization_enabled" : true
  489. },
  490. "timing_stats" : {
  491. "elapsed_time" : 245
  492. }
  493. }
  494. }
  495. }
  496. ]
  497. }
  498. ----