Skip to content

Commit 119af4e

Browse files
authored
[DOCS] Edits trained model alias API (#69491) (#69560)
1 parent 55ada03 commit 119af4e

File tree

2 files changed

+35
-26
lines changed

2 files changed

+35
-26
lines changed

docs/reference/ml/df-analytics/apis/index.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
include::ml-df-analytics-apis.asciidoc[leveloffset=+1]
22
//CREATE
33
include::put-dfanalytics.asciidoc[leveloffset=+2]
4-
include::put-trained-models.asciidoc[leveloffset=+2]
54
include::put-trained-models-aliases.asciidoc[leveloffset=+2]
5+
include::put-trained-models.asciidoc[leveloffset=+2]
66
//UPDATE
77
include::update-dfanalytics.asciidoc[leveloffset=+2]
88
//DELETE

docs/reference/ml/df-analytics/apis/put-trained-models-aliases.asciidoc

+34-25
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[role="xpack"]
22
[testenv="platinum"]
33
[[put-trained-models-aliases]]
4-
= Put Trained Models Aliases API
4+
= Create or update trained model aliases API
55
[subs="attributes"]
66
++++
7-
<titleabbrev>Put Trained Models Aliases</titleabbrev>
7+
<titleabbrev>Create or update trained model aliases</titleabbrev>
88
++++
99

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-
1410
beta::[]
1511

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+
1616
[[ml-put-trained-models-aliases-request]]
1717
== {api-request-title}
1818

@@ -23,7 +23,7 @@ beta::[]
2323
== {api-prereq-title}
2424

2525
If the {es} {security-features} are enabled, you must have the following
26-
built-in roles and privileges:
26+
built-in role:
2727

2828
* `machine_learning_admin`
2929

@@ -33,43 +33,51 @@ For more information, see <<built-in-roles>>, <<security-privileges>>, and
3333
[[ml-put-trained-models-aliases-desc]]
3434
== {api-description-title}
3535

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.
3842

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.
4248

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.
4552

4653
[[ml-put-trained-models-aliases-path-params]]
4754
== {api-path-parms-title}
4855

49-
`model_id`::
56+
`model_alias`::
5057
(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.
5259

53-
`model_alias`::
60+
`model_id`::
5461
(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.
5663

5764
[[ml-put-trained-models-aliases-query-params]]
5865
== {api-query-parms-title}
5966

6067
`reassign`::
6168
(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`.
6572

6673
[[ml-put-trained-models-aliases-example]]
6774
== {api-examples-title}
6875

6976
[[ml-put-trained-models-aliases-example-new-alias]]
70-
=== Creating a new model alias
77+
=== Create a trained model alias
7178

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`):
7381

7482
[source,console]
7583
--------------------------------------------------
@@ -78,9 +86,10 @@ PUT _ml/trained_models/flight-delay-prediction-1574775339910/model_aliases/fligh
7886
// TEST[skip:setup kibana sample data]
7987

8088
[[ml-put-trained-models-aliases-example-put-alias]]
81-
=== Updating an existing model alias
89+
=== Update a trained model alias
8290

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`):
8493

8594
[source,console]
8695
--------------------------------------------------

0 commit comments

Comments
 (0)