Skip to main content

ModelSpec

TL;DR - Model Specs tell Telepath what type of model to create.

A Model Spec is a type of Resource that represents a machine learning model to be created by Telepath. It defines which training data should be used and which column the model should be trained to predict. “Spec” is an abbreviation for “Specification.”

Please note: a Model Spec is not actually a Model, and creating a Model Spec does not automatically train a Model. The Model Spec just defines the type of Model that can be trained during a separate model training process. The same Model Spec may create different Models at different points in time because the training data may change. For example, if a Pipeline is reading training data from the purchases table in your database, then the training data will be different every time a new purchase is added. The changes to the training data will result in different Models being created, but the Model Spec will remain the same.

Example Usage:

import { Pipeline, ModelSpec } from '@telepath/telepath';

// Pipeline is only included as a sample. See the Pipeline docs
// for a valid example of constructing a Pipeline.
const myPipeline = new Pipeline('my-pipeline', { ... });

const myModelSpec = new ModelSpec('my-model-spec', {
// The Pipeline to read training data from
pipelineId: myPipeline.id,
// Name of the column in the Pipeline data that
// the model should learn to predict.
targetColumn: 'purchase_price'
});

Create a ModelSpec Resource

new ModelSpec(name: string, args: ModelSpecArgs, opts?: ComponentResourceOptions);
ArgumentTypeDescription
namestring (required)The unique name of the resource.
argsModelSpecArgs (required)The arguments that define the resource properties.
optsComponentResourceOptionsOptions to control the resource's deployment behavior. Not typically used.