Skip to main content

%ML.TrainedModel

persistent class %ML.TrainedModel extends %Library.Persistent

SQL Table Name: %ML.TrainedModel

Base class for a trained model

Property Inventory

Method Inventory

Properties

property Model as %ML.Model [ Required ];
Base model we trained on
Property methods: ModelGet(), ModelGetObject(), ModelGetObjectId(), ModelGetStored(), ModelGetSwizzled(), ModelIsValid(), ModelNewObject(), ModelSet(), ModelSetObject(), ModelSetObjectId(), ModelUnSwizzle()
property ModelInfo as array of %String (MAXLEN = 1024);
Model information
Property methods: ModelInfoBuildValueArray(), ModelInfoCollectionToDisplay(), ModelInfoCollectionToOdbc(), ModelInfoDisplayToCollection(), ModelInfoDisplayToLogical(), ModelInfoGet(), ModelInfoGetObject(), ModelInfoGetObjectId(), ModelInfoGetStored(), ModelInfoGetSwizzled(), ModelInfoIsValid(), ModelInfoLogicalToDisplay(), ModelInfoLogicalToOdbc(), ModelInfoNormalize(), ModelInfoOdbcToCollection(), ModelInfoSet(), ModelInfoSetObject(), ModelInfoSetObjectId()
property ModelName as %String (MAXLEN = 275) [ Required ];
Trained Model name, same as the name for the cooresponding Training Run
Property methods: ModelNameDisplayToLogical(), ModelNameGet(), ModelNameGetStored(), ModelNameIsValid(), ModelNameLogicalToDisplay(), ModelNameLogicalToOdbc(), ModelNameNormalize(), ModelNameSet()
property ModelType as %String (VALUELIST = ",classification,regression,timeseries");
Model type
Property methods: ModelTypeDisplayToLogical(), ModelTypeGet(), ModelTypeGetStored(), ModelTypeIsValid(), ModelTypeLogicalToDisplay(), ModelTypeLogicalToOdbc(), ModelTypeNormalize(), ModelTypeSet()
property Provider as %String (MAXLEN = 128) [ Required ];
ML Provider that did the training
Property methods: ProviderDisplayToLogical(), ProviderGet(), ProviderGetStored(), ProviderIsValid(), ProviderLogicalToDisplay(), ProviderLogicalToOdbc(), ProviderNormalize(), ProviderSet()
property TrainedAt as %TimeStamp [ InitialExpression = $ZDATETIME($ZTIMESTAMP,3,1,3) , Required ];
Timestamp for when the model was trained (UTC)
Property methods: TrainedAtDisplayToLogical(), TrainedAtGet(), TrainedAtGetStored(), TrainedAtIsValid(), TrainedAtLogicalToDisplay(), TrainedAtNormalize(), TrainedAtOdbcToLogical(), TrainedAtSet()
property TrainingRun as %ML.TrainingRun;
Training run
Property methods: TrainingRunGet(), TrainingRunGetObject(), TrainingRunGetObjectId(), TrainingRunGetStored(), TrainingRunGetSwizzled(), TrainingRunIsValid(), TrainingRunNewObject(), TrainingRunSet(), TrainingRunSetObject(), TrainingRunSetObjectId(), TrainingRunUnSwizzle()

Methods

abstract method %Begin() as %Status
Begin model operations
abstract method %End() as %Status
End model operations
abstract method %Predict(data As %List, ByRef results As %List) as %Status
Predict on an ML model
method %PredictAll(tfn As %Integer, argspos As %List, predpos As %List, probpos As %List = "", expr As %String = "") as %Status
Bulk Predict arguments: tfn - tempfile index argspos - Positions of the WithColumns in the temp rows, $list(column-positions) predpos - Position of the predicted value, $list(result-column-positions) probpos - Position of the probability value, $list(result-column-positions) expr - expression for probability returns: $$$OK on success, otherwise a $$$ERROR(...)
abstract method %Probability(expr As %String = 1, data As %List, ByRef results As %List) as %Status
Predict probability on an ML model Arguments: expr: The argument of PROBABILITY's FOR clause, defaults to 1 data: $List of WITH clause values results: PBR, return value

Indexes

index (IDKEY on ) [IdKey, Type = key];
Index methods: IDKEYCheck(), IDKEYDelete(), IDKEYExists(), IDKEYOpen(), IDKEYSQLCheckUnique(), IDKEYSQLExists(), IDKEYSQLFindPKeyByConstraint(), IDKEYSQLFindRowIDByConstraint()
index (NameIndex on ModelName) [Unique];
Index methods: NameIndexCheck(), NameIndexCheckUnique(), NameIndexDelete(), NameIndexExists(), NameIndexOpen(), NameIndexSQLCheckUnique(), NameIndexSQLExists(), NameIndexSQLFindPKeyByConstraint(), NameIndexSQLFindRowIDByConstraint()

Triggers

trigger %DeleteTrainedModelTrigger (BEFORE event DELETE);
When deleting a TrainedModel Purge any cached queries that used this trained model
trigger DeleteTrigger (BEFORE event DELETE);
When deleting a TrainedModel, also delete any %ML.ValidationRun and %ML.ValidationMetric objects for this Model

Inherited Members

Inherited Methods

Storage

Storage Model: Storage (%ML.TrainedModel)

^IRIS.ML.TrainedModelD(ID,"ModelInfo",n)
=
ModelInfo(n)

Storage Model: Storage (%ML.TrainedModel)

^IRIS.ML.TrainedModelD(ID)
=
%%CLASSNAME
Model
Provider
TrainingRun
TrainedAt
ModelName
ModelType
FeedbackOpens in a new tab