get-dfanalytics-stats.asciidoc 14 KB

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