Skip to main content

%DeepSee.PMML.Utils

class %DeepSee.PMML.Utils

This class bundles a number of utility methods for running PMML models and managing their results.

Method Inventory

Methods

classmethod %DropAllResults() as %Status
Drops all results for all test IDs from the %DeepSee.PMML.Utils.TempResult table.
classmethod %DropResults(pTestId As %Integer) as %Status
Drops all results for a given test ID from the %DeepSee.PMML.Utils.TempResult table.
classmethod %RunModel(ByRef pResultsId As %Integer, pDefinitionClass As %String, pModelName As %String = "", pDataSource As %String = "", pResultsClass As %String = "%DeepSee.PMML.Utils.TempResult", pTracking As %Boolean = 0) as %Status

Test a DeepSee or SQL-linked PMML model by running the model against all records in the Data Source pDatasource specified in the model definition, defaulting to the first datasource definition found in the model.

Use pResultsClass to define the class (subclass of %DeepSee.PMML.Utils.Result) the results of this batch run will be written to. This defaults to %DeepSee.PMML.Utils.TempResult, which stores its data in the Temp database and therefore gets purged upon restarting the instance.
Results will be stored with their TestId property set to the value of pResultsId if a nonzero, non-null value is provided, or call the GetNewTestId() method of pResultsClass to generate a new one.
If pTracking is true, progress information will be written to ^IRIS.Temp.PMML.BgrTask($job), so this method can be run in the background.

classmethod %RunModelFromPMMLRows(ByRef pResultsId As %Integer, pDefinitionClass As %String, pModelName As %String = "", pResultsClass As %String = "%DeepSee.PMML.Utils.TempResult", pTracking As %Boolean = 0) as %Status

Runs a PMML model against the <ModelVerification> records included in the PMML model definition.

Use pResultsClass to define the class (subclass of %DeepSee.PMML.Utils.Result) the results of this batch run will be written to. This defaults to %DeepSee.PMML.Utils.TempResult, which stores its data in the Temp database and therefore gets purged upon restarting the instance.
Results will be stored with their TestId property set to the value of pResultsId if a nonzero, non-null value is provided, or call the GetNewTestId() method of pResultsClass to generate a new one.
If pTracking is true, progress information will be written to ^IRIS.Temp.PMML.BgrTask($job), so this method can be run in the background.

classmethod %RunModelFromResultSet(ByRef pResultsId As %Integer, pDefinitionClass As %String, pModelName As %String = "", pResultSet As %ResultSet, ByRef pFieldMap, pResultsClass As %String = "%DeepSee.PMML.Utils.TempResult", pTracking As %Boolean = 0) as %Status

Runs a PMML model against all records returned by a user-supplied ResultSet object, looping through all rows and checking the model outcome against the actual value found in the query result. pFieldMap is expected to contain a mapping from this model's %DeepSee.PMML.Data class to the columns (by name) in the supplied result set. If no field map is specified, the resultset is expected to contain columns with names corresponding to the models data fields.

Use pResultsClass to define the class (subclass of %DeepSee.PMML.Utils.Result) the results of this batch run will be written to. This defaults to %DeepSee.PMML.Utils.TempResult, which stores its data in the Temp database and therefore gets purged upon restarting the instance.
Results will be stored with their TestId property set to the value of pResultsId if a nonzero, non-null value is provided, or call the GetNewTestId() method of pResultsClass to generate a new one.
If pTracking is true, progress information will be written to ^IRIS.Temp.PMML.BgrTask($job), so this method can be run in the background.

classmethod %RunModelFromSQL(ByRef pResultsId As %Integer, pDefinitionClass As %String, pModelName As %String = "", pSQL As %String, ByRef pFieldMap, ByRef pSQLParams, pResultsClass As %String = "%DeepSee.PMML.Utils.TempResult", pTracking As %Boolean = 0) as %Status

Runs a PMML model against all records returned by a user-supplied SQL query, looping through the rows and checking the model outcome against the actual value found in the query result. pFieldMap is expected to contain a mapping from this model's %DeepSee.PMML.Data class to the columns (by name) in the supplied result set. If no field map is specified, the resultset is expected to contain columns with names corresponding to the models data fields.

Use pResultsClass to define the class (subclass of %DeepSee.PMML.Utils.Result) the results of this batch run will be written to. This defaults to %DeepSee.PMML.Utils.TempResult, which stores its data in the Temp database and therefore gets purged upon restarting the instance.
Results will be stored with their TestId property set to the value of pResultsId if a nonzero, non-null value is provided, or call the GetNewTestId() method of pResultsClass to generate a new one.
If pTracking is true, progress information will be written to ^IRIS.Temp.PMML.BgrTask($job), so this method can be run in the background.

classmethod CreateFromFile(pFile As %String, pClassName As %String, pOverwrite As %Boolean = 1, pCompile As %Boolean = 1, pVerbose As %Boolean = 1) as %Status
Creates a PMML definition class (%DeepSee.PMML.Definition) based on the PMML definition XML in the supplied pFile
classmethod CreateFromStream(pStream As %Stream.Object, pClassName As %String, pOverwrite As %Boolean = 1, pCompile As %Boolean = 1, pVerbose As %Boolean = 1) as %Status
Creates a PMML definition class (%DeepSee.PMML.Definition) based on the PMML definition XML in the supplied pStream
classmethod CreateFromString(pString As %String, pClassName As %String, pOverwrite As %Boolean = 1, pCompile As %Boolean = 1, pVerbose As %Boolean = 1) as %Status
Creates a PMML definition class (%DeepSee.PMML.Definition) based on the PMML definition XML in the supplied pString
FeedbackOpens in a new tab