persistent class %ML.TrainedModel
extends %Persistent
Base class for a trained model
• property Model
as %ML.Model [ Required ];
Base model we trained on
• property ModelInfo
as array of %String(MAXLEN=1024);
Model information
• property ModelName
as %String(MAXLEN=275) [ Required ];
Trained Model name, same as the name for the cooresponding Training Run
• property ModelType
as %String(VALUELIST=",classification,regression,timeseries");
Model type
• property Provider
as %String(MAXLEN=128) [ Required ];
ML Provider that did the training
• property TrainedAt
as %TimeStamp [ InitialExpression = $ZDATETIME($ZTIMESTAMP,3,1,3),Required ];
Timestamp for when the model was trained (UTC)
• property TrainingRun
as %ML.TrainingRun;
Training run
• 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
•index (NameIndex on ModelName) [Unique];
•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
Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.