get-dfanalytics-stats.asciidoc 14 KB

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