puttrainedmodel
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Create a trained model.Enable you to supply a trained model that is not created by data frameanalytics.
Index¶
- Variables
- type NewPutTrainedModel
- type PutTrainedModel
- func (r *PutTrainedModel) CompressedDefinition(compresseddefinition string) *PutTrainedModel
- func (r *PutTrainedModel) DeferDefinitionDecompression(deferdefinitiondecompression bool) *PutTrainedModel
- func (r *PutTrainedModel) Definition(definition *types.Definition) *PutTrainedModel
- func (r *PutTrainedModel) Description(description string) *PutTrainedModel
- func (r PutTrainedModel) Do(providedCtx context.Context) (*Response, error)
- func (r *PutTrainedModel) ErrorTrace(errortrace bool) *PutTrainedModel
- func (r *PutTrainedModel) FilterPath(filterpaths ...string) *PutTrainedModel
- func (r *PutTrainedModel) Header(key, value string) *PutTrainedModel
- func (r *PutTrainedModel) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PutTrainedModel) Human(human bool) *PutTrainedModel
- func (r *PutTrainedModel) InferenceConfig(inferenceconfig *types.InferenceConfigCreateContainer) *PutTrainedModel
- func (r *PutTrainedModel) Input(input *types.Input) *PutTrainedModel
- func (r *PutTrainedModel) Metadata(metadata any) *PutTrainedModel
- func (r *PutTrainedModel) ModelSizeBytes(modelsizebytes int64) *PutTrainedModel
- func (r *PutTrainedModel) ModelType(modeltype trainedmodeltype.TrainedModelType) *PutTrainedModel
- func (r PutTrainedModel) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *PutTrainedModel) PlatformArchitecture(platformarchitecture string) *PutTrainedModel
- func (r *PutTrainedModel) PrefixStrings(prefixstrings *types.TrainedModelPrefixStrings) *PutTrainedModel
- func (r *PutTrainedModel) Pretty(pretty bool) *PutTrainedModel
- func (r *PutTrainedModel) Raw(raw io.Reader) *PutTrainedModel
- func (r *PutTrainedModel) Request(req *Request) *PutTrainedModel
- func (r *PutTrainedModel) Tags(tags ...string) *PutTrainedModel
- func (r *PutTrainedModel) WaitForCompletion(waitforcompletion bool) *PutTrainedModel
- type Request
- type Response
Constants¶
This section is empty.
Variables¶
var ErrBuildPath =errors.New("cannot build path, check for missing path parameters")ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions¶
This section is empty.
Types¶
typeNewPutTrainedModel¶
type NewPutTrainedModel func(modelidstring) *PutTrainedModel
NewPutTrainedModel type alias for index.
funcNewPutTrainedModelFunc¶
func NewPutTrainedModelFunc(tpelastictransport.Interface)NewPutTrainedModel
NewPutTrainedModelFunc returns a new instance of PutTrainedModel with the provided transport.Used in the index of the library this allows to retrieve every apis in once place.
typePutTrainedModel¶
type PutTrainedModel struct {// contains filtered or unexported fields}funcNew¶
func New(tpelastictransport.Interface) *PutTrainedModel
Create a trained model.Enable you to supply a trained model that is not created by data frameanalytics.
https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html
func (*PutTrainedModel)CompressedDefinition¶added inv8.9.0
func (r *PutTrainedModel) CompressedDefinition(compresseddefinitionstring) *PutTrainedModel
CompressedDefinition The compressed (GZipped and Base64 encoded) inference definition of themodel. If compressed_definition is specified, then definition cannot bespecified.API name: compressed_definition
func (*PutTrainedModel)DeferDefinitionDecompression¶
func (r *PutTrainedModel) DeferDefinitionDecompression(deferdefinitiondecompressionbool) *PutTrainedModel
DeferDefinitionDecompression If set to `true` and a `compressed_definition` is provided,the request defers definition decompression and skips relevantvalidations.API name: defer_definition_decompression
func (*PutTrainedModel)Definition¶added inv8.9.0
func (r *PutTrainedModel) Definition(definition *types.Definition) *PutTrainedModel
Definition The inference definition for the model. If definition is specified, thencompressed_definition cannot be specified.API name: definition
func (*PutTrainedModel)Description¶added inv8.9.0
func (r *PutTrainedModel) Description(descriptionstring) *PutTrainedModel
Description A human-readable description of the inference trained model.API name: description
func (PutTrainedModel)Do¶
func (rPutTrainedModel) Do(providedCtxcontext.Context) (*Response,error)
Do runs the request through the transport, handle the response and returns a puttrainedmodel.Response
func (*PutTrainedModel)ErrorTrace¶added inv8.14.0
func (r *PutTrainedModel) ErrorTrace(errortracebool) *PutTrainedModel
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errorswhen they occur.API name: error_trace
func (*PutTrainedModel)FilterPath¶added inv8.14.0
func (r *PutTrainedModel) FilterPath(filterpaths ...string) *PutTrainedModel
FilterPath Comma-separated list of filters in dot notation which reduce the responsereturned by Elasticsearch.API name: filter_path
func (*PutTrainedModel)Header¶
func (r *PutTrainedModel) Header(key, valuestring) *PutTrainedModel
Header set a key, value pair in the PutTrainedModel headers map.
func (*PutTrainedModel)HttpRequest¶
HttpRequest returns the http.Request object built from thegiven parameters.
func (*PutTrainedModel)Human¶added inv8.14.0
func (r *PutTrainedModel) Human(humanbool) *PutTrainedModel
Human When set to `true` will return statistics in a format suitable for humans.For example `"exists_time": "1h"` for humans and`"eixsts_time_in_millis": 3600000` for computers. When disabled the humanreadable values will be omitted. This makes sense for responses beingconsumedonly by machines.API name: human
func (*PutTrainedModel)InferenceConfig¶added inv8.9.0
func (r *PutTrainedModel) InferenceConfig(inferenceconfig *types.InferenceConfigCreateContainer) *PutTrainedModel
InferenceConfig The default configuration for inference. This can be either a regressionor classification configuration. It must match the underlyingdefinition.trained_model's target_type. For pre-packaged models such asELSER the config is not required.API name: inference_config
func (*PutTrainedModel)Input¶added inv8.9.0
func (r *PutTrainedModel) Input(input *types.Input) *PutTrainedModel
Input The input field names for the model definition.API name: input
func (*PutTrainedModel)Metadata¶added inv8.9.0
func (r *PutTrainedModel) Metadata(metadataany) *PutTrainedModel
Metadata An object map that contains metadata about the model.API name: metadata
metadata should be a json.RawMessage or a structureif a structure is provided, the client will defer a json serializationprior to sending the payload to Elasticsearch.
func (*PutTrainedModel)ModelSizeBytes¶added inv8.9.0
func (r *PutTrainedModel) ModelSizeBytes(modelsizebytesint64) *PutTrainedModel
ModelSizeBytes The estimated memory usage in bytes to keep the trained model in memory.This property is supported only if defer_definition_decompression is trueor the model definition is not supplied.API name: model_size_bytes
func (*PutTrainedModel)ModelType¶added inv8.9.0
func (r *PutTrainedModel) ModelType(modeltypetrainedmodeltype.TrainedModelType) *PutTrainedModel
ModelType The model type.API name: model_type
func (PutTrainedModel)Perform¶added inv8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*PutTrainedModel)PlatformArchitecture¶added inv8.11.0
func (r *PutTrainedModel) PlatformArchitecture(platformarchitecturestring) *PutTrainedModel
PlatformArchitecture The platform architecture (if applicable) of the trained mode. If the modelonly works on one platform, because it is heavily optimized for a particularprocessor architecture and OS combination, then this field specifies which.The format of the string must match the platform identifiers used byElasticsearch,so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`,`darwin-aarch64`,or `windows-x86_64`. For portable models (those that work independent ofprocessorarchitecture or OS features), leave this field unset.API name: platform_architecture
func (*PutTrainedModel)PrefixStrings¶added inv8.13.0
func (r *PutTrainedModel) PrefixStrings(prefixstrings *types.TrainedModelPrefixStrings) *PutTrainedModel
PrefixStrings Optional prefix strings applied at inferenceAPI name: prefix_strings
func (*PutTrainedModel)Pretty¶added inv8.14.0
func (r *PutTrainedModel) Pretty(prettybool) *PutTrainedModel
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only usethis option for debugging only.API name: pretty
func (*PutTrainedModel)Raw¶
func (r *PutTrainedModel) Raw(rawio.Reader) *PutTrainedModel
Raw takes a json payload as input which is then passed to the http.RequestIf specified Raw takes precedence on Request method.
func (*PutTrainedModel)Request¶
func (r *PutTrainedModel) Request(req *Request) *PutTrainedModel
Request allows to set the request property with the appropriate payload.
func (*PutTrainedModel)Tags¶added inv8.9.0
func (r *PutTrainedModel) Tags(tags ...string) *PutTrainedModel
Tags An array of tags to organize the model.API name: tags
func (*PutTrainedModel)WaitForCompletion¶added inv8.13.0
func (r *PutTrainedModel) WaitForCompletion(waitforcompletionbool) *PutTrainedModel
WaitForCompletion Whether to wait for all child operations (e.g. model download)to complete.API name: wait_for_completion
typeRequest¶
type Request struct {// CompressedDefinition The compressed (GZipped and Base64 encoded) inference definition of the// model. If compressed_definition is specified, then definition cannot be// specified.CompressedDefinition *string `json:"compressed_definition,omitempty"`// Definition The inference definition for the model. If definition is specified, then// compressed_definition cannot be specified.Definition *types.Definition `json:"definition,omitempty"`// Description A human-readable description of the inference trained model.Description *string `json:"description,omitempty"`// InferenceConfig The default configuration for inference. This can be either a regression// or classification configuration. It must match the underlying// definition.trained_model's target_type. For pre-packaged models such as// ELSER the config is not required.InferenceConfig *types.InferenceConfigCreateContainer `json:"inference_config,omitempty"`// Input The input field names for the model definition.Input *types.Input `json:"input,omitempty"`// Metadata An object map that contains metadata about the model.Metadatajson.RawMessage `json:"metadata,omitempty"`// ModelSizeBytes 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.ModelSizeBytes *int64 `json:"model_size_bytes,omitempty"`// ModelType The model type.ModelType *trainedmodeltype.TrainedModelType `json:"model_type,omitempty"`// PlatformArchitecture 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`,// or `windows-x86_64`. For portable models (those that work independent of// processor// architecture or OS features), leave this field unset.PlatformArchitecture *string `json:"platform_architecture,omitempty"`// PrefixStrings Optional prefix strings applied at inferencePrefixStrings *types.TrainedModelPrefixStrings `json:"prefix_strings,omitempty"`// Tags An array of tags to organize the model.Tags []string `json:"tags,omitempty"`}Request holds the request body struct for the package puttrainedmodel
typeResponse¶added inv8.7.0
type Response struct {CompressedDefinition *string `json:"compressed_definition,omitempty"`// CreateTime The time when the trained model was created.CreateTimetypes.DateTime `json:"create_time,omitempty"`// CreatedBy Information on the creator of the trained model.CreatedBy *string `json:"created_by,omitempty"`// DefaultFieldMap Any field map described in the inference configuration takes precedence.DefaultFieldMap map[string]string `json:"default_field_map,omitempty"`// Description The free-text description of the trained model.Description *string `json:"description,omitempty"`// EstimatedHeapMemoryUsageBytes The estimated heap usage in bytes to keep the trained model in memory.EstimatedHeapMemoryUsageBytes *int `json:"estimated_heap_memory_usage_bytes,omitempty"`// EstimatedOperations The estimated number of operations to use the trained model.EstimatedOperations *int `json:"estimated_operations,omitempty"`// FullyDefined True if the full model definition is present.FullyDefined *bool `json:"fully_defined,omitempty"`// InferenceConfig The default configuration for inference. This can be either a regression,// classification, or one of the many NLP focused configurations. It must match// the underlying definition.trained_model's target_type. For pre-packaged// models such as ELSER the config is not required.InferenceConfig *types.InferenceConfigCreateContainer `json:"inference_config,omitempty"`// Input The input field names for the model definition.Inputtypes.TrainedModelConfigInput `json:"input"`// LicenseLevel The license level of the trained model.LicenseLevel *string `json:"license_level,omitempty"`Location *types.TrainedModelLocation `json:"location,omitempty"`// Metadata An object containing metadata about the trained model. For example, models// created by data frame analytics contain analysis_config and input objects.Metadata *types.TrainedModelConfigMetadata `json:"metadata,omitempty"`// ModelId Identifier for the trained model.ModelIdstring `json:"model_id"`ModelPackage *types.ModelPackageConfig `json:"model_package,omitempty"`ModelSizeBytestypes.ByteSize `json:"model_size_bytes,omitempty"`// ModelType The model typeModelType *trainedmodeltype.TrainedModelType `json:"model_type,omitempty"`PlatformArchitecture *string `json:"platform_architecture,omitempty"`PrefixStrings *types.TrainedModelPrefixStrings `json:"prefix_strings,omitempty"`// Tags A comma delimited string of tags. A trained model can have many tags, or// none.Tags []string `json:"tags"`// Version The Elasticsearch version number in which the trained model was created.Version *string `json:"version,omitempty"`}Response holds the response body struct for the package puttrainedmodel