Skip to main content
Kinetica provides support for Machine Learning (ML) container registry & model creation and management in SQL. A Docker registry serves as a container for ML models, while an ML model represents a function from which an inference can be computed.
For statistical analysis functions that don’t require a model, see ML Functions.
Container registry features accessible via SQL include: ML model features accessible via SQL include:

CREATE CONTAINER REGISTRY

Creates a new reference to a Docker container registry for accessing ML models.
CREATE CONTAINER REGISTRY Syntax

Parameters

OR REPLACE

Any existing container registry reference with the same name will be dropped before creating this one

<registry name>

Name of the reference to the container registry, which can be referenced in subsequent commands

URI

The URI to the container registry itself

CREDENTIAL

Name of the credential to use to authenticate to the container registry

Examples

CREATE CONTAINER REGISTRY Example

DROP CONTAINER REGISTRY

Removes an existing Docker container registry reference.
DROP CONTAINER REGISTRY Syntax

Parameters

<registry name>

Name of the reference to the container registry to remove; has no effect on the container registry itself

Examples

DROP CONTAINER REGISTRY Example

SHOW CONTAINER REGISTRY

Outputs the DDL statement required to reconstruct the given Docker container registry reference.
SHOW CONTAINER REGISTRY Syntax
The response to SHOW CONTAINER REGISTRY is a single-column result set with the DDL statement as the value in the DDL column.

Parameters

<registry name>

Name of the existing reference to the container registry for which the DDL will be output. Use * instead to output the DDL of all references to container registries.

Examples

SHOW CONTAINER REGISTRY Example
SHOW CONTAINER REGISTRY Example (All Registries)

IMPORT MODEL

Imports an ML model from a Docker container registry into the database.
IMPORT MODEL Syntax

Parameters

<model name>

Name of the ML model to import via the given container registry reference

REGISTRY

Name of the reference to the container registry from which to import the ML model

CONTAINER

The full path to the ML model container within the container registry

RUN_FUNCTION

Name of the function within the ML model to execute when running inferences against it

Examples

IMPORT MODEL Example

EVALUATE_MODEL

Runs an inference against an ML model. There are two methods to evaluate a model:
  • By Query - An ML model can be queried, where the inference is returned as the result set.
  • By Execution - An ML model can be run with the EXECUTE FUNCTION command, where the inference is persisted to a specified table.
EVALUATE_MODEL Table Function Syntax
EVALUATE_MODEL EXECUTE FUNCTION Syntax

Parameters

MODEL

Name of the ML model on which to run an inference

DEPLOYMENT_MODE

Scheme used in making inferences on the ML model:
  • BATCH - inference tests are run against a batch of data in an existing table all at once
  • CONTINUOUS - inference tests are run automatically against records being streamed into an input table; inference results are inserted into an output table, which will be updated upon each subsequent inference
    Continuous deployment mode is only available when using the EXECUTE FUNCTION syntax, as it creates a destination table with the continuously updated results.

REPLICATIONS

The number of replicas to launch on Kubernetes

SOURCE_TABLE

Table or query to use as input to the ML model, specified with either of these two forms:
  • INPUT_TABLE(<table name>) - Use the given table or view as input; e.g.:
  • INPUT_TABLE(<query>) - Use the given query as input; e.g.:

DESTINATION_TABLE

Only applicable when using EXECUTE FUNCTION syntax. Name of the table in which to store the results of the inference, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria

Examples

EVALUATE_MODEL Table Function Example
EVALUATE_MODEL EXECUTE FUNCTION Example

ALTER MODEL

Modifies the source of an ML model and re-imports it from that new location. Either the container registry or the container path can be modified.

Parameters

<model name>

Name of the ML model to modify

REGISTRY

Name of the reference to the container registry from which to import the ML model

CONTAINER

The full path to the ML model container within the container registry

Examples

ALTER MODEL Registry Example
ALTER MODEL Container Path Example

REFRESH MODEL

Refreshes an ML model from its source.
REFRESH MODEL Syntax

Examples

REFRESH MODEL Example

DROP MODEL

Removes an ML model.
DROP MODEL Syntax

Examples

DROP MODEL Example

SHOW MODEL

Displays the statement used to create an ML model.
SHOW MODEL Syntax

Parameters

<model name>

Name of the existing reference to the model for which the DDL will be output. Use * instead to output the DDL of all references to models.

Examples

SHOW MODEL Example
SHOW MODEL Example (All Models)

DESCRIBE MODEL

Displays the configuration of an ML model.
DESCRIBE MODEL Syntax

Parameters

<model name>

Name of the existing model for which the configuration will be output. Use * instead to output the configuration of all models.

Response

The response to DESCRIBE MODEL is a four-column result set:

Examples

DESCRIBE MODEL Example
DESCRIBE MODEL Example (All Models)