%ML.Model

persistent class %ML.Model extends %Library.Persistent

SQL Table Name: %ML.Model

Definition of a ML model

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties

property CreatedAt as %TimeStamp [ InitialExpression = $ZDATETIME($ZTIMESTAMP,3,1,3) , Required ];
Timestamp for when the model was created (UTC)
Property methods: CreatedAtDisplayToLogical(), CreatedAtGet(), CreatedAtGetStored(), CreatedAtIsValid(), CreatedAtLogicalToDisplay(), CreatedAtNormalize(), CreatedAtOdbcToLogical(), CreatedAtSet()
property DefaultParameters as array of %String (MAXLEN = 1024);
Model parameters
Property methods: DefaultParametersBuildValueArray(), DefaultParametersCollectionToDisplay(), DefaultParametersCollectionToOdbc(), DefaultParametersDisplayToCollection(), DefaultParametersDisplayToLogical(), DefaultParametersGet(), DefaultParametersGetObject(), DefaultParametersGetObjectId(), DefaultParametersGetStored(), DefaultParametersGetSwizzled(), DefaultParametersIsValid(), DefaultParametersLogicalToDisplay(), DefaultParametersLogicalToOdbc(), DefaultParametersNormalize(), DefaultParametersOdbcToCollection(), DefaultParametersSet(), DefaultParametersSetObject(), DefaultParametersSetObjectId()
property DefaultTrainedModel as %ML.TrainedModel;
Default trained model
Property methods: DefaultTrainedModelGet(), DefaultTrainedModelGetObject(), DefaultTrainedModelGetObjectId(), DefaultTrainedModelGetStored(), DefaultTrainedModelGetSwizzled(), DefaultTrainedModelIsValid(), DefaultTrainedModelNewObject(), DefaultTrainedModelSet(), DefaultTrainedModelSetObject(), DefaultTrainedModelSetObjectId(), DefaultTrainedModelUnSwizzle()
property DefaultTrainingQuery as %String (MAXLEN = 32000);
Default training query (SQL)
Property methods: DefaultTrainingQueryDisplayToLogical(), DefaultTrainingQueryGet(), DefaultTrainingQueryGetStored(), DefaultTrainingQueryIsValid(), DefaultTrainingQueryLogicalToDisplay(), DefaultTrainingQueryLogicalToOdbc(), DefaultTrainingQueryNormalize(), DefaultTrainingQuerySet()
property Description as %String (MAXLEN = 8192);
Model description
Property methods: DescriptionDisplayToLogical(), DescriptionGet(), DescriptionGetStored(), DescriptionIsValid(), DescriptionLogicalToDisplay(), DescriptionLogicalToOdbc(), DescriptionNormalize(), DescriptionSet()
property Name as %String (MAXLEN = 256) [ Required ];
Name of the model
Property methods: NameDisplayToLogical(), NameGet(), NameGetStored(), NameIndexCheck(), NameIndexCheckUnique(), NameIndexDelete(), NameIndexExists(), NameIndexOpen(), NameIndexSQLCheckUnique(), NameIndexSQLExists(), NameIndexSQLFindPKeyByConstraint(), NameIndexSQLFindRowIDByConstraint(), NameIsValid(), NameLogicalToDisplay(), NameLogicalToOdbc(), NameNormalize(), NameSet()
property PredictingColumnNames as list of %String (MAXLEN = 128) [ Required ];
Column Name(s) we're predicting
Property methods: PredictingColumnNamesBuildValueArray(), PredictingColumnNamesCollectionToDisplay(), PredictingColumnNamesCollectionToOdbc(), PredictingColumnNamesDisplayToCollection(), PredictingColumnNamesDisplayToLogical(), PredictingColumnNamesGet(), PredictingColumnNamesGetObject(), PredictingColumnNamesGetObjectId(), PredictingColumnNamesGetStored(), PredictingColumnNamesGetSwizzled(), PredictingColumnNamesIsValid(), PredictingColumnNamesLogicalToDisplay(), PredictingColumnNamesLogicalToOdbc(), PredictingColumnNamesNormalize(), PredictingColumnNamesOdbcToCollection(), PredictingColumnNamesSet(), PredictingColumnNamesSetObject(), PredictingColumnNamesSetObjectId()
property PredictingColumnTypes as list of %String (MAXLEN = 128) [ Required ];
Column Types(s) we're predicting
Property methods: PredictingColumnTypesBuildValueArray(), PredictingColumnTypesCollectionToDisplay(), PredictingColumnTypesCollectionToOdbc(), PredictingColumnTypesDisplayToCollection(), PredictingColumnTypesDisplayToLogical(), PredictingColumnTypesGet(), PredictingColumnTypesGetObject(), PredictingColumnTypesGetObjectId(), PredictingColumnTypesGetStored(), PredictingColumnTypesGetSwizzled(), PredictingColumnTypesIsValid(), PredictingColumnTypesLogicalToDisplay(), PredictingColumnTypesLogicalToOdbc(), PredictingColumnTypesNormalize(), PredictingColumnTypesOdbcToCollection(), PredictingColumnTypesSet(), PredictingColumnTypesSetObject(), PredictingColumnTypesSetObjectId()
property WithColumnNames as list of %String (MAXLEN = 128) [ Required ];
Columns names we're predicting using
Property methods: WithColumnNamesBuildValueArray(), WithColumnNamesCollectionToDisplay(), WithColumnNamesCollectionToOdbc(), WithColumnNamesDisplayToCollection(), WithColumnNamesDisplayToLogical(), WithColumnNamesGet(), WithColumnNamesGetObject(), WithColumnNamesGetObjectId(), WithColumnNamesGetStored(), WithColumnNamesGetSwizzled(), WithColumnNamesIsValid(), WithColumnNamesLogicalToDisplay(), WithColumnNamesLogicalToOdbc(), WithColumnNamesNormalize(), WithColumnNamesOdbcToCollection(), WithColumnNamesSet(), WithColumnNamesSetObject(), WithColumnNamesSetObjectId()
property WithColumnText as list of %String (MAXLEN = 512) [ Required ];
Columns text we're predicting using, text from SQL query or with expression
Property methods: WithColumnTextBuildValueArray(), WithColumnTextCollectionToDisplay(), WithColumnTextCollectionToOdbc(), WithColumnTextDisplayToCollection(), WithColumnTextDisplayToLogical(), WithColumnTextGet(), WithColumnTextGetObject(), WithColumnTextGetObjectId(), WithColumnTextGetStored(), WithColumnTextGetSwizzled(), WithColumnTextIsValid(), WithColumnTextLogicalToDisplay(), WithColumnTextLogicalToOdbc(), WithColumnTextNormalize(), WithColumnTextOdbcToCollection(), WithColumnTextSet(), WithColumnTextSetObject(), WithColumnTextSetObjectId()
property WithColumnTypes as list of %String (MAXLEN = 128) [ Required ];
Columns types we're predicting using
Property methods: WithColumnTypesBuildValueArray(), WithColumnTypesCollectionToDisplay(), WithColumnTypesCollectionToOdbc(), WithColumnTypesDisplayToCollection(), WithColumnTypesDisplayToLogical(), WithColumnTypesGet(), WithColumnTypesGetObject(), WithColumnTypesGetObjectId(), WithColumnTypesGetStored(), WithColumnTypesGetSwizzled(), WithColumnTypesIsValid(), WithColumnTypesLogicalToDisplay(), WithColumnTypesLogicalToOdbc(), WithColumnTypesNormalize(), WithColumnTypesOdbcToCollection(), WithColumnTypesSet(), WithColumnTypesSetObject(), WithColumnTypesSetObjectId()

Methods

method %Predict(rowdata As %List, ByRef result As %Double, contextitem As %RawString) as %Status [ Language = objectscript ]
Predict
classmethod %PredictAll(modelname As %String, trainedmodelname As %String = "", tfn As %Integer, argspos As %List, predpos As %List = "", probpos As %List = "", expr As %String = 1) as %Status [ Language = objectscript ]
Bulk Predict arguments: modelname - model name trainedmodelname - name of %ML.TrainedModel, might be different from the DefaultTrainedModel 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(...)
method %Probability(rowdata As %List, ByRef result As %Double, ByRef trainedmodel As %ML.TrainedModel = "", expr As %String = 1) as %Status [ Language = objectscript ]
Probability
method %Purge(days=0) as %Status [ Language = objectscript ]
Purge all trained models
method %Train(data As %SQL.StatementResult, ByRef trainedmodelname As %String, ByRef trainedmodel As %ML.TrainedModel, ByRef trainingrun As %ML.TrainingRun, using As %DynamicObject = $$$NULLOREF, notdefault As %Boolean = 0) as %Status [ Language = objectscript ]
Train an ML model (synchronously)

Indices

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

Triggers

trigger DeleteTrigger (BEFORE event DELETE);
When deleting a model, also delete any %ML.ValidationRun, %ML.ValidationMetric, %ML.TrainingRun and %ML.TrainedModel objects for this Model

Inherited Members

Inherited Methods (Including Private)

Storage

Storage Model: Storage (%ML.Model)

^IRIS.ML.ModelD(ID,"DefaultParameters",n)
=
DefaultParameters(n)

Storage Model: Storage (%ML.Model)

^IRIS.ML.ModelD(ID)
=
%%CLASSNAME
Name
Description
PredictingColumnNames
PredictingColumnTypes
WithColumnNames
WithColumnTypes
DefaultTrainingQuery
CreatedAt
DefaultTrainedModel
WithColumnText
Feedback