puttrainedmodel

package
v8.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Overview

Creates an inference trained model.

Index

Constants

This section is empty.

Variables

View Source
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

type NewPutTrainedModel

type NewPutTrainedModel func(modelid string) *PutTrainedModel

NewPutTrainedModel type alias for index.

func NewPutTrainedModelFunc

func NewPutTrainedModelFunc(tp elastictransport.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.

type PutTrainedModel

type PutTrainedModel struct {
	// contains filtered or unexported fields
}

func (*PutTrainedModel) DeferDefinitionDecompression

func (r *PutTrainedModel) DeferDefinitionDecompression(b bool) *PutTrainedModel

DeferDefinitionDecompression If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations. API name: defer_definition_decompression

func (PutTrainedModel) Do

Do runs the http.Request through the provided transport.

func (*PutTrainedModel) Header

func (r *PutTrainedModel) Header(key, value string) *PutTrainedModel

Header set a key, value pair in the PutTrainedModel headers map.

func (*PutTrainedModel) HttpRequest

func (r *PutTrainedModel) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*PutTrainedModel) ModelId

func (r *PutTrainedModel) ModelId(v string) *PutTrainedModel

ModelId The unique identifier of the trained model. API Name: modelid

func (*PutTrainedModel) Raw

Raw takes a json payload as input which is then passed to the http.Request If 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.

type Request

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.
	InferenceConfig types.InferenceConfigCreateContainer `json:"inference_config"`
	// Input The input field names for the model definition.
	Input types.Input `json:"input"`
	// Metadata An object map that contains metadata about the model.
	Metadata interface{} `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"`
	// Tags An array of tags to organize the model.
	Tags []string `json:"tags,omitempty"`
}

Request holds the request body struct for the package puttrainedmodel

https://github.com/elastic/elasticsearch-specification/blob/7f49eec1f23a5ae155001c058b3196d85981d5c2/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts#L28-L94

func NewRequest added in v8.5.0

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON added in v8.5.0

func (rb *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL