1
1
[role="xpack"]
2
2
[testenv="platinum"]
3
3
[[put-trained-models-aliases]]
4
- = Put Trained Models Aliases API
4
+ = Create or update trained model aliases API
5
5
[subs="attributes"]
6
6
++++
7
- <titleabbrev>Put Trained Models Aliases </titleabbrev>
7
+ <titleabbrev>Create or update trained model aliases </titleabbrev>
8
8
++++
9
9
10
- Creates a trained models alias. These model aliases can be used instead of the trained model ID
11
- when referencing the model in the stack. Model aliases must be unique, and a trained model can have
12
- more than one model alias referring to it. But a model alias can only refer to a single trained model.
13
-
14
10
beta::[]
15
11
12
+ Creates or updates a trained model alias.
13
+
14
+ A trained model alias is a logical name used to reference a single trained model.
15
+
16
16
[[ml-put-trained-models-aliases-request]]
17
17
== {api-request-title}
18
18
@@ -23,7 +23,7 @@ beta::[]
23
23
== {api-prereq-title}
24
24
25
25
If the {es} {security-features} are enabled, you must have the following
26
- built-in roles and privileges :
26
+ built-in role :
27
27
28
28
* `machine_learning_admin`
29
29
@@ -33,43 +33,51 @@ For more information, see <<built-in-roles>>, <<security-privileges>>, and
33
33
[[ml-put-trained-models-aliases-desc]]
34
34
== {api-description-title}
35
35
36
- This API creates a new model alias to refer to trained models, or updates an existing
37
- trained model's alias.
36
+ You can use aliases instead of trained model identifiers to make it easier to
37
+ reference your models. For example, you can use aliases in {infer} aggregations
38
+ and processors.
39
+
40
+ An alias must be unique and refer to only a single trained model. However,
41
+ you can have multiple aliases for each trained model.
38
42
39
- When updating an existing model alias to a new model ID, this API will return a error if the models
40
- are of different inference types. Example, if attempting to put the model alias
41
- `flights-delay-prediction` from a regression model to a classification model, the API will error.
43
+ If you use this API to update an alias such that it references a different
44
+ trained model ID and the model uses a different type of {dfanalytics}, an error
45
+ occurs. For example, this situation occurs if you have a trained model for
46
+ {reganalysis} and a trained model for {classanalysis}; you cannot reassign an
47
+ alias from one type of trained model to another.
42
48
43
- The API will return a warning if there are very few input fields in common between the old
44
- and new models for the model alias.
49
+ If you use this API to update an alias and there are very few input fields in
50
+ common between the old and new trained models for the model alias, the API
51
+ returns a warning.
45
52
46
53
[[ml-put-trained-models-aliases-path-params]]
47
54
== {api-path-parms-title}
48
55
49
- `model_id `::
56
+ `model_alias `::
50
57
(Required, string)
51
- The trained model ID to which the model alias should refer .
58
+ The alias to create or update. This value cannot end in numbers .
52
59
53
- `model_alias `::
60
+ `model_id `::
54
61
(Required, string)
55
- The model alias to create or update. The model_alias cannot end in numbers .
62
+ The identifier for the trained model that the alias refers to .
56
63
57
64
[[ml-put-trained-models-aliases-query-params]]
58
65
== {api-query-parms-title}
59
66
60
67
`reassign`::
61
68
(Optional, boolean)
62
- Should the `model_alias` get reassigned to the provided `model_id` if it is already
63
- assigned to a model. Defaults to false. The API will return an error if the `model_alias`
64
- is already assigned to a model but this parameter is `false`.
69
+ Specifies whether the alias gets reassigned to the specified trained model if it
70
+ is already assigned to a different model. If the alias is already assigned and
71
+ this parameter is `false`, the API returns an error. Defaults to `false`.
65
72
66
73
[[ml-put-trained-models-aliases-example]]
67
74
== {api-examples-title}
68
75
69
76
[[ml-put-trained-models-aliases-example-new-alias]]
70
- === Creating a new model alias
77
+ === Create a trained model alias
71
78
72
- The following example shows how to create a new model alias for a trained model ID.
79
+ The following example shows how to create an alias (`flight_delay_model`) for a
80
+ trained model (`flight-delay-prediction-1574775339910`):
73
81
74
82
[source,console]
75
83
--------------------------------------------------
@@ -78,9 +86,10 @@ PUT _ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/fligh
78
86
// TEST[skip:setup kibana sample data]
79
87
80
88
[[ml-put-trained-models-aliases-example-put-alias]]
81
- === Updating an existing model alias
89
+ === Update a trained model alias
82
90
83
- The following example shows how to reassign an existing model alias for a trained model ID.
91
+ The following example shows how to reassign an alias (`flight_delay_model`) to a
92
+ different trained model (`flight-delay-prediction-1580004349800`):
84
93
85
94
[source,console]
86
95
--------------------------------------------------
0 commit comments