%ML.TrainingRun
Class %ML.TrainingRun Extends %Persistent [ ClassType = persistent, System = 4 ]
A model training run
Properties
Model
Property Model As %ML.Model [ Required ];
Model we are training with
Name
Property Name As %String(MAXLEN = 275) [ Required, SqlComputeCode = {if {Name}="" { set {*}=##class(%ML.TrainingRun).GetTrainingRunName({Model}) }}, SqlComputed, SqlComputeOnChange = %%INSERT ];
Training Run name, same as the name for the cooresponding Trained Model
Provider
Property Provider As %String(MAXLEN = 128) [ Required ];
ML Provider that did the training
StartedAt
Property StartedAt As %TimeStamp [ InitialExpression = {$ZDATETIME($ZTIMESTAMP,3,1,3)}, Required ];
Time started (UTC)
CompletedAt
Property CompletedAt As %TimeStamp;
Time completed (UTC)
TrainingDuration
Property TrainingDuration As %Numeric [ SqlComputeCode = {Set {*}=##class({%%CLASSNAME}).GetInterval({StartedAt},{CompletedAt})}, SqlComputed, Transient ];
Training duration (in seconds)
TrainingQuery
Property TrainingQuery As %String(MAXLEN = 32000);
Training query
RunStatus
Property RunStatus As %String(DISPLAYLIST = ",Training,Completed,Failed", VALUELIST = ",training,completed,failed") [ InitialExpression = "training" ];
Training status
StatusCode
Property StatusCode As %Status [ InitialExpression = {$$$OK} ];
Training error (if encountered)
Log
Property Log As %Stream.GlobalCharacter;
Training log output
Settings
Property Settings As %Library.DynamicObject;
Settings for this training run
Configuration
Property Configuration As %SYS.ML.Configuration;
ML Configuration for this training run
TrainingRunLocked
Property TrainingRunLocked As %Boolean [ Calculated, Private, SqlComputeCode = { lock +^IRIS.ML.TrainingRun({%%ID}):0 if $test { set {*}=0 lock -^IRIS.ML.TrainingRun({%%ID}) } else { set {*}=1 }}, SqlComputed ];
TrainingRunLocked 1 if we cannot acquire a locko on this training run, otherwise 0
PID
Property PID As %String [ InitialExpression = {$job} ];
IRIS Process ID that performed the training
Methods
GetInterval
ClassMethod GetInterval(start As %TimeStamp, end As %TimeStamp) As %Numeric
Compute the difference in seconds between two timestamps
GetTrainingRunName
ClassMethod GetTrainingRunName(Model As %BigInt) As %String(MAXLEN=275)
Compute the default name for this training run // Model is the Oid of a Model
LogMsg
Method LogMsg(msg As %String) As %Status [ CodeMode = expression ]
Log a timestamped message to the training log
%Dump
Method %Dump() As %Status
Helper method for debugging etc.