get-dfanalytics-stats.asciidoc 14 KB

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