get-trained-models.asciidoc 20 KB

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