get-trained-models.asciidoc 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. [role="xpack"]
  2. [[get-trained-models]]
  3. = Get trained models API
  4. [subs="attributes"]
  5. ++++
  6. <titleabbrev>Get trained models</titleabbrev>
  7. ++++
  8. Retrieves configuration information for a trained model.
  9. [[ml-get-trained-models-request]]
  10. == {api-request-title}
  11. `GET _ml/trained_models/` +
  12. `GET _ml/trained_models/<model_id>` +
  13. `GET _ml/trained_models/_all` +
  14. `GET _ml/trained_models/<model_id1>,<model_id2>` +
  15. `GET _ml/trained_models/<model_id_pattern*>`
  16. [[ml-get-trained-models-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-trained-models-desc]]
  21. //== {api-description-title}
  22. [[ml-get-trained-models-path-params]]
  23. == {api-path-parms-title}
  24. `<model_id>`::
  25. (Optional, string)
  26. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id-or-alias]
  27. +
  28. You can get information for multiple trained models in a single API request by
  29. using a comma-separated list of model IDs or a wildcard expression.
  30. [[ml-get-trained-models-query-params]]
  31. == {api-query-parms-title}
  32. `allow_no_match`::
  33. (Optional, Boolean)
  34. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=allow-no-match-models]
  35. `decompress_definition`::
  36. (Optional, Boolean)
  37. Specifies whether the included model definition should be returned as a JSON map
  38. (`true`) or in a custom compressed format (`false`). Defaults to `true`.
  39. `exclude_generated`::
  40. (Optional, Boolean)
  41. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=exclude-generated]
  42. `from`::
  43. (Optional, integer)
  44. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=from-models]
  45. `include`::
  46. (Optional, string)
  47. A comma delimited string of optional fields to include in the response body. The
  48. default value is empty, indicating no optional fields are included. Valid
  49. options are:
  50. - `definition`: Includes the model definition.
  51. - `feature_importance_baseline`: Includes the baseline for {feat-imp} values.
  52. - `hyperparameters`: Includes the information about hyperparameters used to
  53. train the model. This information consists of the value, the absolute and
  54. relative importance of the hyperparameter as well as an indicator of whether
  55. it was specified by the user or tuned during hyperparameter optimization.
  56. - `total_feature_importance`: Includes the total {feat-imp} for the training
  57. data set.
  58. The baseline and total {feat-imp} values are returned in the `metadata` field
  59. in the response body.
  60. `size`::
  61. (Optional, integer)
  62. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=size-models]
  63. `tags`::
  64. (Optional, string)
  65. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=tags]
  66. [role="child_attributes"]
  67. [[ml-get-trained-models-results]]
  68. == {api-response-body-title}
  69. `trained_model_configs`::
  70. (array)
  71. An array of trained model resources, which are sorted by the `model_id` value in
  72. ascending order.
  73. +
  74. .Properties of trained model resources
  75. [%collapsible%open]
  76. ====
  77. `created_by`:::
  78. (string)
  79. The creator of the trained model.
  80. `create_time`:::
  81. (<<time-units,time units>>)
  82. The time when the trained model was created.
  83. `default_field_map` :::
  84. (object)
  85. A string object that contains the default field map to use when inferring
  86. against the model. For example, {dfanalytics} may train the model on a specific
  87. multi-field `foo.keyword`. The analytics job would then supply a default field
  88. map entry for `"foo" : "foo.keyword"`.
  89. +
  90. Any field map described in the inference configuration takes precedence.
  91. `description`:::
  92. (string)
  93. The free-text description of the trained model.
  94. `model_size_bytes`:::
  95. (integer)
  96. The estimated model size in bytes to keep the trained model in memory.
  97. `estimated_operations`:::
  98. (integer)
  99. The estimated number of operations to use the trained model.
  100. `inference_config`:::
  101. (object)
  102. The default configuration for inference. This can be either a `regression`
  103. or `classification` configuration. It must match the `target_type` of the
  104. underlying `definition.trained_model`.
  105. +
  106. .Properties of `inference_config`
  107. [%collapsible%open]
  108. =====
  109. `classification`::::
  110. (object)
  111. Classification configuration for inference.
  112. +
  113. .Properties of classification inference
  114. [%collapsible%open]
  115. ======
  116. `num_top_classes`:::
  117. (integer)
  118. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-num-top-classes]
  119. `num_top_feature_importance_values`:::
  120. (integer)
  121. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-num-top-feature-importance-values]
  122. `prediction_field_type`:::
  123. (string)
  124. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-prediction-field-type]
  125. `results_field`:::
  126. (string)
  127. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-results-field]
  128. `top_classes_results_field`:::
  129. (string)
  130. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-top-classes-results-field]
  131. ======
  132. `fill_mask`::::
  133. (Optional, object)
  134. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-fill-mask]
  135. +
  136. .Properties of fill_mask inference
  137. [%collapsible%open]
  138. ======
  139. `tokenization`::::
  140. (Optional, object)
  141. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization]
  142. +
  143. .Properties of tokenization
  144. [%collapsible%open]
  145. =======
  146. `bert`::::
  147. (Optional, object)
  148. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert]
  149. +
  150. .Properties of bert
  151. [%collapsible%open]
  152. ========
  153. `do_lower_case`::::
  154. (Optional, boolean)
  155. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case]
  156. `max_sequence_length`::::
  157. (Optional, integer)
  158. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length]
  159. `truncate`::::
  160. (Optional, string)
  161. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-truncate]
  162. `with_special_tokens`::::
  163. (Optional, boolean)
  164. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens]
  165. ========
  166. =======
  167. `vocabulary`::::
  168. (Optional, object)
  169. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary]
  170. +
  171. .Properties of vocabulary
  172. [%collapsible%open]
  173. =======
  174. `index`::::
  175. (Required, string)
  176. The index where the vocabulary is stored.
  177. =======
  178. ======
  179. `ner`::::
  180. (Optional, object)
  181. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-ner]
  182. +
  183. .Properties of ner inference
  184. [%collapsible%open]
  185. ======
  186. `classification_labels`::::
  187. (Optional, string)
  188. An array of classification labels. NER supports only
  189. Inside-Outside-Beginning labels (IOB) and only persons, organizations, locations,
  190. and miscellaneous. For example:
  191. `["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC"]`.
  192. `tokenization`::::
  193. (Optional, object)
  194. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization]
  195. +
  196. .Properties of tokenization
  197. [%collapsible%open]
  198. =======
  199. `bert`::::
  200. (Optional, object)
  201. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert]
  202. +
  203. .Properties of bert
  204. [%collapsible%open]
  205. ========
  206. `do_lower_case`::::
  207. (Optional, boolean)
  208. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case]
  209. `max_sequence_length`::::
  210. (Optional, integer)
  211. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length]
  212. `truncate`::::
  213. (Optional, string)
  214. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-truncate]
  215. `with_special_tokens`::::
  216. (Optional, boolean)
  217. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens]
  218. ========
  219. =======
  220. `vocabulary`::::
  221. (Optional, object)
  222. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary]
  223. +
  224. .Properties of vocabulary
  225. [%collapsible%open]
  226. =======
  227. `index`::::
  228. (Required, string)
  229. The index where the vocabulary is stored
  230. =======
  231. ======
  232. `pass_through`::::
  233. (Optional, object)
  234. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-pass-through]
  235. +
  236. .Properties of pass_through inference
  237. [%collapsible%open]
  238. ======
  239. `tokenization`::::
  240. (Optional, object)
  241. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization]
  242. +
  243. .Properties of tokenization
  244. [%collapsible%open]
  245. =======
  246. `bert`::::
  247. (Optional, object)
  248. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert]
  249. +
  250. .Properties of bert
  251. [%collapsible%open]
  252. ========
  253. `do_lower_case`::::
  254. (Optional, boolean)
  255. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case]
  256. `max_sequence_length`::::
  257. (Optional, integer)
  258. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length]
  259. `truncate`::::
  260. (Optional, string)
  261. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-truncate]
  262. `with_special_tokens`::::
  263. (Optional, boolean)
  264. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens]
  265. ========
  266. =======
  267. `vocabulary`::::
  268. (Optional, object)
  269. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary]
  270. +
  271. .Properties of vocabulary
  272. [%collapsible%open]
  273. =======
  274. `index`::::
  275. (Required, string)
  276. The index where the vocabulary is stored.
  277. =======
  278. ======
  279. `regression`::::
  280. (object)
  281. Regression configuration for inference.
  282. +
  283. .Properties of regression inference
  284. [%collapsible%open]
  285. ======
  286. `num_top_feature_importance_values`:::
  287. (integer)
  288. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-regression-num-top-feature-importance-values]
  289. `results_field`:::
  290. (string)
  291. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-results-field]
  292. ======
  293. `text_classification`::::
  294. (Optional, object)
  295. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-text-classification]
  296. +
  297. .Properties of text_classification inference
  298. [%collapsible%open]
  299. ======
  300. `classification_labels`::::
  301. (Optional, string)
  302. An array of classification labels.
  303. `num_top_classes`::::
  304. (Optional, integer)
  305. Specifies the number of top class predictions to return. Defaults to all classes (-1).
  306. `tokenization`::::
  307. (Optional, object)
  308. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization]
  309. +
  310. .Properties of tokenization
  311. [%collapsible%open]
  312. =======
  313. `bert`::::
  314. (Optional, object)
  315. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert]
  316. +
  317. .Properties of bert
  318. [%collapsible%open]
  319. ========
  320. `do_lower_case`::::
  321. (Optional, boolean)
  322. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case]
  323. `max_sequence_length`::::
  324. (Optional, integer)
  325. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length]
  326. `truncate`::::
  327. (Optional, string)
  328. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-truncate]
  329. `with_special_tokens`::::
  330. (Optional, boolean)
  331. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens]
  332. ========
  333. =======
  334. `vocabulary`::::
  335. (Optional, object)
  336. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary]
  337. +
  338. .Properties of vocabulary
  339. [%collapsible%open]
  340. =======
  341. `index`::::
  342. (Required, string)
  343. The index where the vocabulary is stored.
  344. =======
  345. ======
  346. `text_embedding`::::
  347. (Object, optional)
  348. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-text-embedding]
  349. +
  350. .Properties of text_embedding inference
  351. [%collapsible%open]
  352. ======
  353. `tokenization`::::
  354. (Optional, object)
  355. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization]
  356. +
  357. .Properties of tokenization
  358. [%collapsible%open]
  359. =======
  360. `bert`::::
  361. (Optional, object)
  362. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert]
  363. +
  364. .Properties of bert
  365. [%collapsible%open]
  366. ========
  367. `do_lower_case`::::
  368. (Optional, boolean)
  369. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case]
  370. `max_sequence_length`::::
  371. (Optional, integer)
  372. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length]
  373. `truncate`::::
  374. (Optional, string)
  375. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-truncate]
  376. `with_special_tokens`::::
  377. (Optional, boolean)
  378. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens]
  379. ========
  380. =======
  381. `vocabulary`::::
  382. (Optional, object)
  383. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary]
  384. +
  385. .Properties of vocabulary
  386. [%collapsible%open]
  387. =======
  388. `index`::::
  389. (Required, string)
  390. The index where the vocabulary is stored.
  391. =======
  392. ======
  393. `zero_shot_classification`::::
  394. (Object, optional)
  395. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification]
  396. +
  397. .Properties of zero_shot_classification inference
  398. [%collapsible%open]
  399. ======
  400. `classification_labels`::::
  401. (Required, array)
  402. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-classification-labels]
  403. `hypothesis_template`::::
  404. (Optional, string)
  405. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-hypothesis-template]
  406. `labels`::::
  407. (Optional, array)
  408. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-labels]
  409. `multi_label`::::
  410. (Optional, boolean)
  411. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-multi-label]
  412. `tokenization`::::
  413. (Optional, object)
  414. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization]
  415. +
  416. .Properties of tokenization
  417. [%collapsible%open]
  418. =======
  419. `bert`::::
  420. (Optional, object)
  421. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert]
  422. +
  423. .Properties of bert
  424. [%collapsible%open]
  425. ========
  426. `do_lower_case`::::
  427. (Optional, boolean)
  428. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case]
  429. `max_sequence_length`::::
  430. (Optional, integer)
  431. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length]
  432. `truncate`::::
  433. (Optional, string)
  434. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-truncate]
  435. `with_special_tokens`::::
  436. (Optional, boolean)
  437. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens]
  438. ========
  439. =======
  440. `vocabulary`::::
  441. (Optional, object)
  442. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary]
  443. +
  444. .Properties of vocabulary
  445. [%collapsible%open]
  446. =======
  447. `index`::::
  448. (Required, string)
  449. The index where the vocabulary is stored.
  450. =======
  451. ======
  452. =====
  453. `input`:::
  454. (object)
  455. The input field names for the model definition.
  456. +
  457. .Properties of `input`
  458. [%collapsible%open]
  459. =====
  460. `field_names`::::
  461. (string)
  462. An array of input field names for the model.
  463. =====
  464. // Begin location
  465. `location`::
  466. (Optional, object)
  467. The model definition location. Must be provided if the `definition` or `compressed_definition` are not
  468. provided.
  469. +
  470. .Properties of `location`
  471. [%collapsible%open]
  472. =====
  473. `index`:::
  474. (Required, object)
  475. Indicates that the model definition is stored in an index. It is required to be empty as
  476. the index for storing model definitions is configured automatically.
  477. =====
  478. // End location
  479. `license_level`::
  480. (string)
  481. The license level of the trained model.
  482. `metadata`::
  483. (object)
  484. An object containing metadata about the trained model. For example, models
  485. created by {dfanalytics} contain `analysis_config` and `input` objects.
  486. +
  487. .Properties of metadata
  488. [%collapsible%open]
  489. =====
  490. `feature_importance_baseline`:::
  491. (object)
  492. An object that contains the baseline for {feat-imp} values. For {reganalysis},
  493. it is a single value. For {classanalysis}, there is a value for each class.
  494. `hyperparameters`:::
  495. (array)
  496. List of the available hyperparameters optimized during the
  497. `fine_parameter_tuning` phase as well as specified by the user.
  498. +
  499. .Properties of hyperparameters
  500. [%collapsible%open]
  501. ======
  502. `absolute_importance`::::
  503. (double)
  504. A positive number showing how much the parameter influences the variation of the
  505. {ml-docs}/dfa-regression-lossfunction.html[loss function]. For
  506. hyperparameters with values that are not specified by the user but tuned during
  507. hyperparameter optimization.
  508. `max_trees`::::
  509. (integer)
  510. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=max-trees-trained-models]
  511. `name`::::
  512. (string)
  513. Name of the hyperparameter.
  514. `relative_importance`::::
  515. (double)
  516. A number between 0 and 1 showing the proportion of influence on the variation of
  517. the loss function among all tuned hyperparameters. For hyperparameters with
  518. values that are not specified by the user but tuned during hyperparameter
  519. optimization.
  520. `supplied`::::
  521. (Boolean)
  522. Indicates if the hyperparameter is specified by the user (`true`) or optimized
  523. (`false`).
  524. `value`::::
  525. (double)
  526. The value of the hyperparameter, either optimized or specified by the user.
  527. ======
  528. `total_feature_importance`:::
  529. (array)
  530. An array of the total {feat-imp} for each feature used from
  531. the training data set. This array of objects is returned if {dfanalytics} trained
  532. the model and the request includes `total_feature_importance` in the `include`
  533. request parameter.
  534. +
  535. .Properties of total {feat-imp}
  536. [%collapsible%open]
  537. ======
  538. `feature_name`:::
  539. (string)
  540. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-metadata-feature-importance-feature-name]
  541. `importance`:::
  542. (object)
  543. A collection of {feat-imp} statistics related to the training data set for this particular feature.
  544. +
  545. .Properties of {feat-imp}
  546. [%collapsible%open]
  547. =======
  548. `mean_magnitude`:::
  549. (double)
  550. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-metadata-feature-importance-magnitude]
  551. `max`:::
  552. (integer)
  553. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-metadata-feature-importance-max]
  554. `min`:::
  555. (integer)
  556. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-metadata-feature-importance-min]
  557. =======
  558. `classes`:::
  559. (array)
  560. If the trained model is a classification model, {feat-imp} statistics are gathered
  561. per target class value.
  562. +
  563. .Properties of class {feat-imp}
  564. [%collapsible%open]
  565. =======
  566. `class_name`:::
  567. (string)
  568. The target class value. Could be a string, boolean, or number.
  569. `importance`:::
  570. (object)
  571. A collection of {feat-imp} statistics related to the training data set for this particular feature.
  572. +
  573. .Properties of {feat-imp}
  574. [%collapsible%open]
  575. ========
  576. `mean_magnitude`:::
  577. (double)
  578. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-metadata-feature-importance-magnitude]
  579. `max`:::
  580. (int)
  581. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-metadata-feature-importance-max]
  582. `min`:::
  583. (int)
  584. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-metadata-feature-importance-min]
  585. ========
  586. =======
  587. ======
  588. =====
  589. `model_id`::
  590. (string)
  591. Identifier for the trained model.
  592. `model_type`::
  593. (Optional, string)
  594. The created model type. By default the model type is `tree_ensemble`.
  595. Appropriate types are:
  596. +
  597. --
  598. * `tree_ensemble`: The model definition is an ensemble model of decision trees.
  599. * `lang_ident`: A special type reserved for language identification models.
  600. * `pytorch`: The stored definition is a PyTorch (specifically a TorchScript) model. Currently only
  601. NLP models are supported.
  602. --
  603. `tags`::
  604. (string)
  605. A comma delimited string of tags. A trained model can have many tags, or none.
  606. `version`::
  607. (string)
  608. The {es} version number in which the trained model was created.
  609. ====
  610. [[ml-get-trained-models-response-codes]]
  611. == {api-response-codes-title}
  612. `400`::
  613. If `include_model_definition` is `true`, this code indicates that more than
  614. one models match the ID pattern.
  615. `404` (Missing resources)::
  616. If `allow_no_match` is `false`, this code indicates that there are no
  617. resources that match the request or only partial matches for the request.
  618. [[ml-get-trained-models-example]]
  619. == {api-examples-title}
  620. The following example gets configuration information for all the trained models:
  621. [source,console]
  622. --------------------------------------------------
  623. GET _ml/trained_models/
  624. --------------------------------------------------
  625. // TEST[skip:TBD]