Create a trained model Added in 7.10.0
Enable you to supply a trained model that is not created by data frame analytics.
Path parameters
-
The unique identifier of the trained model.
Query parameters
-
defer_definition_decompression boolean
If set to
true
and acompressed_definition
is provided, the request defers definition decompression and skips relevant validations. -
wait_for_completion boolean
Whether to wait for all child operations (e.g. model download) to complete.
Body Required
-
compressed_definition string
The compressed (GZipped and Base64 encoded) inference definition of the model. If compressed_definition is specified, then definition cannot be specified.
-
definition object
Additional properties are allowed.
-
description string
A human-readable description of the inference trained model.
-
inference_config object
Inference configuration provided when storing the model config
Additional properties are allowed.
-
input object
Additional properties are allowed.
-
metadata object
An object map that contains metadata about the model.
Additional properties are allowed.
-
model_type string
Values are
tree_ensemble
,lang_ident
, orpytorch
. -
model_size_bytes number
The estimated memory usage in bytes to keep the trained model in memory. This property is supported only if defer_definition_decompression is true or the model definition is not supplied.
-
platform_architecture string
The platform architecture (if applicable) of the trained mode. If the model only works on one platform, because it is heavily optimized for a particular processor architecture and OS combination, then this field specifies which. The format of the string must match the platform identifiers used by Elasticsearch, so one of,
linux-x86_64
,linux-aarch64
,darwin-x86_64
,darwin-aarch64
, orwindows-x86_64
. For portable models (those that work independent of processor architecture or OS features), leave this field unset. -
prefix_strings object
Additional properties are allowed.
curl \
-X PUT http://api.example.com/_ml/trained_models/{model_id} \
-H "Content-Type: application/json" \
-d '{"compressed_definition":"string","definition":{"preprocessors":[{"frequency_encoding":{"field":"string","feature_name":"string","frequency_map":{"additionalProperty1":42.0,"additionalProperty2":42.0}},"one_hot_encoding":{"field":"string","hot_map":{"additionalProperty1":"string","additionalProperty2":"string"}},"target_mean_encoding":{"field":"string","feature_name":"string","target_map":{"additionalProperty1":42.0,"additionalProperty2":42.0},"default_value":42.0}}],"trained_model":{"tree":{"classification_labels":["string"],"feature_names":["string"],"target_type":"string","tree_structure":[{"decision_type":"string","default_left":true,"leaf_value":42.0,"left_child":42.0,"node_index":42.0,"right_child":42.0,"split_feature":42.0,"split_gain":42.0,"threshold":42.0}]},"tree_node":{"decision_type":"string","default_left":true,"leaf_value":42.0,"left_child":42.0,"node_index":42.0,"right_child":42.0,"split_feature":42.0,"split_gain":42.0,"threshold":42.0},"ensemble":{"aggregate_output":{"logistic_regression":{"weights":42.0},"weighted_sum":{"weights":42.0},"weighted_mode":{"weights":42.0},"exponent":{"weights":42.0}},"classification_labels":["string"],"feature_names":["string"],"target_type":"string","trained_models":[{}]}}},"description":"string","inference_config":{"regression":{"results_field":"string","num_top_feature_importance_values":42.0},"classification":{"num_top_classes":42.0,"num_top_feature_importance_values":42.0,"prediction_field_type":"string","results_field":"string","top_classes_results_field":"string"},"text_classification":{"num_top_classes":42.0,"tokenization":{"bert":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"mpnet":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"roberta":{"add_prefix_space":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0}},"results_field":"string","classification_labels":["string"]},"zero_shot_classification":{"tokenization":{"bert":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"mpnet":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"roberta":{"add_prefix_space":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0}},"hypothesis_template":"string","classification_labels":["string"],"results_field":"string","multi_label":true,"labels":["string"]},"fill_mask":{"mask_token":"string","num_top_classes":42.0,"tokenization":{"bert":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"mpnet":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"roberta":{"add_prefix_space":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0}},"results_field":"string"},"ner":{"tokenization":{"bert":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"mpnet":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"roberta":{"add_prefix_space":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0}},"results_field":"string","classification_labels":["string"],"vocabulary":{"index":"string"}},"pass_through":{"tokenization":{"bert":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"mpnet":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"roberta":{"add_prefix_space":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0}},"results_field":"string","vocabulary":{"index":"string"}},"text_embedding":{"embedding_size":42.0,"tokenization":{"bert":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"mpnet":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"roberta":{"add_prefix_space":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0}},"results_field":"string"},"text_expansion":{"tokenization":{"bert":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"mpnet":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"roberta":{"add_prefix_space":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0}},"results_field":"string"},"question_answering":{"num_top_classes":42.0,"tokenization":{"bert":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"mpnet":{"do_lower_case":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0},"roberta":{"add_prefix_space":true,"with_special_tokens":true,"max_sequence_length":42.0,"truncate":"first","span":42.0}},"results_field":"string","max_answer_length":42.0}},"input":{"field_names":"string"},"metadata":{},"model_type":"tree_ensemble","model_size_bytes":42.0,"platform_architecture":"string","tags":["string"],"prefix_strings":{"ingest":"string","search":"string"}}'
{
"compressed_definition": "string",
"definition": {
"preprocessors": [
{
"frequency_encoding": {
"field": "string",
"feature_name": "string",
"frequency_map": {
"additionalProperty1": 42.0,
"additionalProperty2": 42.0
}
},
"one_hot_encoding": {
"field": "string",
"hot_map": {
"additionalProperty1": "string",
"additionalProperty2": "string"
}
},
"target_mean_encoding": {
"field": "string",
"feature_name": "string",
"target_map": {
"additionalProperty1": 42.0,
"additionalProperty2": 42.0
},
"default_value": 42.0
}
}
],
"trained_model": {
"tree": {
"classification_labels": [
"string"
],
"feature_names": [
"string"
],
"target_type": "string",
"tree_structure": [
{
"decision_type": "string",
"default_left": true,
"leaf_value": 42.0,
"left_child": 42.0,
"node_index": 42.0,
"right_child": 42.0,
"split_feature": 42.0,
"split_gain": 42.0,
"threshold": 42.0
}
]
},
"tree_node": {
"decision_type": "string",
"default_left": true,
"leaf_value": 42.0,
"left_child": 42.0,
"node_index": 42.0,
"right_child": 42.0,
"split_feature": 42.0,
"split_gain": 42.0,
"threshold": 42.0
},
"ensemble": {
"aggregate_output": {
"logistic_regression": {
"weights": 42.0
},
"weighted_sum": {
"weights": 42.0
},
"weighted_mode": {
"weights": 42.0
},
"exponent": {
"weights": 42.0
}
},
"classification_labels": [
"string"
],
"feature_names": [
"string"
],
"target_type": "string",
"trained_models": [
{}
]
}
}
},
"description": "string",
"inference_config": {
"regression": {
"results_field": "string",
"num_top_feature_importance_values": 42.0
},
"classification": {
"num_top_classes": 42.0,
"num_top_feature_importance_values": 42.0,
"prediction_field_type": "string",
"results_field": "string",
"top_classes_results_field": "string"
},
"text_classification": {
"num_top_classes": 42.0,
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string",
"classification_labels": [
"string"
]
},
"zero_shot_classification": {
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"hypothesis_template": "string",
"classification_labels": [
"string"
],
"results_field": "string",
"multi_label": true,
"labels": [
"string"
]
},
"fill_mask": {
"mask_token": "string",
"num_top_classes": 42.0,
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string"
},
"ner": {
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string",
"classification_labels": [
"string"
],
"vocabulary": {
"index": "string"
}
},
"pass_through": {
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string",
"vocabulary": {
"index": "string"
}
},
"text_embedding": {
"embedding_size": 42.0,
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string"
},
"text_expansion": {
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string"
},
"question_answering": {
"num_top_classes": 42.0,
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string",
"max_answer_length": 42.0
}
},
"input": {
"field_names": "string"
},
"metadata": {},
"model_type": "tree_ensemble",
"model_size_bytes": 42.0,
"platform_architecture": "string",
"tags": [
"string"
],
"prefix_strings": {
"ingest": "string",
"search": "string"
}
}
{
"model_id": "string",
"model_type": "tree_ensemble",
"tags": [
"string"
],
"version": "string",
"compressed_definition": "string",
"created_by": "string",
"": 42.0,
"default_field_map": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"description": "string",
"estimated_heap_memory_usage_bytes": 42.0,
"estimated_operations": 42.0,
"fully_defined": true,
"inference_config": {
"regression": {
"results_field": "string",
"num_top_feature_importance_values": 42.0
},
"classification": {
"num_top_classes": 42.0,
"num_top_feature_importance_values": 42.0,
"prediction_field_type": "string",
"results_field": "string",
"top_classes_results_field": "string"
},
"text_classification": {
"num_top_classes": 42.0,
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string",
"classification_labels": [
"string"
]
},
"zero_shot_classification": {
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"hypothesis_template": "string",
"classification_labels": [
"string"
],
"results_field": "string",
"multi_label": true,
"labels": [
"string"
]
},
"fill_mask": {
"mask_token": "string",
"num_top_classes": 42.0,
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string"
},
"ner": {
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string",
"classification_labels": [
"string"
],
"vocabulary": {
"index": "string"
}
},
"pass_through": {
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string",
"vocabulary": {
"index": "string"
}
},
"text_embedding": {
"embedding_size": 42.0,
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string"
},
"text_expansion": {
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string"
},
"question_answering": {
"num_top_classes": 42.0,
"tokenization": {
"bert": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"mpnet": {
"do_lower_case": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
},
"roberta": {
"add_prefix_space": true,
"with_special_tokens": true,
"max_sequence_length": 42.0,
"truncate": "first",
"span": 42.0
}
},
"results_field": "string",
"max_answer_length": 42.0
}
},
"input": {
"field_names": [
"string"
]
},
"license_level": "string",
"metadata": {
"model_aliases": [
"string"
],
"feature_importance_baseline": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"hyperparameters": [
{
"absolute_importance": 42.0,
"name": "string",
"relative_importance": 42.0,
"supplied": true,
"value": 42.0
}
],
"total_feature_importance": [
{
"feature_name": "string",
"importance": [
{
"mean_magnitude": 42.0,
"max": 42.0,
"min": 42.0
}
],
"classes": [
{
"class_name": "string",
"importance": [
{}
]
}
]
}
]
},
"location": {
"index": {
"name": "string"
}
},
"prefix_strings": {
"ingest": "string",
"search": "string"
}
}