get-dfanalytics-stats.asciidoc 14 KB

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