Skip to content

Deleting

Remove objects from a registry

.ml.registry.delete. registry delete a registry experiment delete an experiment model delete a model parameters delete a parameter file metrics delete a metric table code delete a code file metric delete a metric from a metric table

The ML Registry provides common, versioned storage for models, parameters and metrics. From time to time, you need to delete some.

.ml.registry.delete.code

Delete a code file from a specified model

.ml.registry.delete.code[folderPath;experimentName;modelName;version;codeFile]

Where

argument type description
folderPath string, :: folder path indicating the location of the registry containing the code to delete
experimentName string, :: name of the experiment folder in which the code lives
modelName string name of the model associated with the code
version long[] version of the model to delete code from, major and minor verisons as a pair of longs
codeFile string name of file to delete, with extension e.g. `myfile.py

deletes the code file and returns null.

// Delete code file my.py
.ml.registry.delete.code[::;::;"model1";1 0;"my.py"]

.ml.registry.delete.experiment

Delete an experiment from a specified registry

.ml.registry.delete.experiment[folderPath;experimentName]

Where

argument type description
folderPath string, :: folder path of the registry containing the experiment to delete; if null, the current directory
experimentName string name of the experiment to delete

deletes the experiment, writes confirmation to stdout, and returns null.

Generate a number of models associated with different experiments.

.ml.registry.set.model[::;{x};"model";"q";enlist[`experimentName]!enlist "test"]
.ml.registry.set.model[::;{x+1};"model";"q";enlist[`experimentName]!enlist "test"]
.ml.registry.set.model[::;{x+2};"model1";"q";enlist[`experimentName]!enlist "test1"]
.ml.registry.set.model[::;{x+2};"model1";"q";enlist[`experimentName]!enlist "test1"]

Show current contents of the modelStore.

q)modelStore
registrationTime              experimentName modelName uniqueID              ..
-----------------------------------------------------------------------------..
2021.06.01D10:13:19.517546000 "test"         "model"   38e69f30-8956-24a8-0bc..
2021.06.01D10:13:19.550791000 "test"         "model"   7e1eb13b-aa21-cc7f-800..
2021.06.01D10:13:19.584704000 "test1"        "model1"  466c92d0-f610-dbbd-9da..
2021.06.01D10:13:19.620767000 "test1"        "model1"  d68d2286-01e0-0867-446..

Delete experiment test1.

q).ml.registry.delete.experiment[::;"test1"]
Removing all contents of ./KX_ML_REGISTRY/namedExperiments/test1/
q)modelStore
registrationTime              experimentName modelName uniqueID              ..
-----------------------------------------------------------------------------..
2021.06.01D10:13:19.517546000 "test"         "model"   38e69f30-8956-24a8-0bc..
2021.06.01D10:13:19.550791000 "test"         "model"   7e1eb13b-aa21-cc7f-800..

.ml.registry.delete.metric

Delete a metric from a specified metric table

.ml.registry.delete.metric[folderPath;experimentName;modelName;version;metricName]

Where

argument type description
folderPath string, :: folder path of the registry containing the metric to delete
experimentName string, :: name of the experiment folder in which the metric lives
modelName string name of the model associated with the metric
version long[] version of the model to delete metric from, major and minor versions as a long pair
metricName string name of metric to delete

deletes the metric from the metric table and returns null.

q)// Set metric values
q).ml.registry.log.metric[::;::;"model1";1 0;`metricName1;1]
q).ml.registry.log.metric[::;::;"model1";1 0;`metricName2;2]

q)// Show metric values
q).ml.registry.get.metric[::;::;"model1";1 0;`metricName1`metricName2]
timestamp                     metricName  metricValue
-----------------------------------------------------
2021.06.07D08:49:18.296326000 metricName1 1
2021.06.07D08:49:20.643205000 metricName2 2

q)// Delete first metric
q).ml.registry.delete.metric[::;::;"model1";1 0;"metricName1"]

q)// Show metric values
q).ml.registry.get.metric[::;::;"model1";1 0;`metricName1`metricName2]
timestamp                     metricName  metricValue
-----------------------------------------------------
2021.06.07D08:49:20.643205000 metricName2 2

.ml.registry.delete.metrics

Delete a metric table from a specified model

.ml.registry.delete.metrics[folderPath;experimentName;modelName;version]

Where

argument type description
folderPath string, :: folder path of the registry containing the metrics to delete; if null, current directory
experimentName string, :: name of the experiment folder in which the metrics live
modelName string name of the model associated with the parameters
version long[] version of the model, major and minor versions as a long pair

deletes the metric table and returns null.

q)// Generate a model with a metrics table
q).ml.registry.set.model[::;{x};"model1";"q";::]
q).ml.registry.log.metric[::;::;"model1";1 0;`metricName1;1]
q).ml.registry.log.metric[::;::;"model1";1 0;`metricName2;2]

q)// Get metrics
q).ml.registry.get.metric[::;::;"model1";1 0;`metricName1`metricName2]
timestamp                     metricName  metricValue
-----------------------------------------------------
2021.06.04D17:02:38.200280000 metricName1 1
2021.06.04D17:02:43.723946000 metricName2 2

q)// Delete parameter file
q).ml.registry.delete.metrics[::;::;"model1";1 0]

q)// Get metrics
q).ml.registry.get.metric[::;::;"model1";1 0;`metricName1`metricName2]
'./KX_ML_REGISTRY/unnamedExperiments/model1/1/metrics/metric. OS reports: The system cannot find the path specified.

.ml.registry.delete.model

Delete a model from a specified registry

.ml.registry.delete.model[folderPath;experimentName;modelName;version]

Where

argument type description
folderPath string, :: folder path of the registry containing the model to delete; if null, the current directory
experimentName string` name of the experiment containing the model to delete
modelName string, :: name of the model to delete
version long[], :: version of the model to delete, major and minor versions as a long pair; if null, all versions

deletes the model, writes confirmation to stdout, and returns null.

Generate a number of models within a registry.

.ml.registry.set.model[::;{x};"model1";"q";::]
.ml.registry.set.model[::;{x+1};"model1";"q";::]
.ml.registry.set.model[::;{x+2};"model2";"q";::]
.ml.registry.set.model[::;{x+3};"model3";"q";::]
.ml.registry.set.model[::;{x+4};"model3";"q";::]

Display current registry contents.

q)modelStore
registrationTime              experimentName modelName uniqueID              ..
-----------------------------------------------------------------------------..
2021.06.01D10:22:47.360569000 "undefined"    "model1"  5c279367-6eac-d645-2f0..
2021.06.01D10:22:47.393568000 "undefined"    "model1"  fb56b644-d9f8-22d6-b33..
2021.06.01D10:22:47.420959000 "undefined"    "model2"  c9dfd663-500f-8fbf-77e..
2021.06.01D10:22:47.456099000 "undefined"    "model3"  e56f9d8f-5dc3-a043-cb9..
2021.06.01D10:22:47.491306000 "undefined"    "model3"  fe0f9d6c-f774-9318-941..

Delete all models named model3.

q).ml.registry.delete.model[::;::;"model3";::]
Removing all contents of ./KX_ML_REGISTRY/unnamedExperiments/model3
q)modelStore
-----------------------------------------------------------------------------..
2021.06.01D10:22:47.360569000 "undefined"    "model1"  5c279367-6eac-d645-2f0..
2021.06.01D10:22:47.393568000 "undefined"    "model1"  fb56b644-d9f8-22d6-b33..
2021.06.01D10:22:47.420959000 "undefined"    "model2"  c9dfd663-500f-8fbf-77e..

Delete version 1.0 of model1.

q).ml.registry.delete.model[::;::;"model1";1 0]
Removing all contents of ./KX_ML_REGISTRY/unnamedExperiments/model1/1

q)modelStore
registrationTime              experimentName modelName uniqueID              ..
-----------------------------------------------------------------------------..
2021.06.01D10:22:47.393568000 "undefined"    "model1"  fb56b644-d9f8-22d6-b33..
2021.06.01D10:22:47.420959000 "undefined"    "model2"  c9dfd663-500f-8fbf-77e..

.ml.registry.delete.parameters

Delete a parameter file from a specified model

.ml.registry.delete.parameters
  [folderPath;experimentName;modelName;version;paramFile]

Where

argument type description
folderPath string, :: folder path of the registry containing the parameters to delete; if null, current directory
experimentName string, :: name of the experiment folder in which the parameters live
modelName string name of the model associated with the parameters
version long[] version of the model, major and minor versions as a long pair
paramFile string name of the parameter file to delete

deletes the parameter file and returns null.

q)// Generate a model with a parameter set
q).ml.registry.set.model[::;{x};"model1";"q";::]
q).ml.registry.set.parameters[::;::;"model1";1 0;"paramFile";`param1`param2!1 2]

q)// Get parameter file
q).ml.registry.get.parameters[::;::;"model1";1 0;`paramFile]
param1| 1
param2| 2

q)// Delete parameter file
q).ml.registry.delete.parameters[::;::;"model1";1 0;"paramFile"]

q)// Get parameter file
q).ml.registry.get.parameters[::;::;"model1";1 0;`paramFile]
'./KX_ML_REGISTRY/unnamedExperiments/model1/1/params/paramFile.json. OS reports: The system cannot find the path specified.

.ml.registry.delete.registry

Delete a registry at a specified location

.ml.registry.delete.registry[folderPath;config]

Where

argument type description
folderPath string, :: folder path of the registry to be deleted; if null, the current directory
config :: presently unused

deletes the registry, writes confirmation to stdout, and returns null.

Delete a registry from the present working directory.

q).ml.registry.delete.registry[::;::]
./KX_ML_REGISTRY deleted.

Delete the registry from a specified folder

q).ml.registry.delete.registry["test/directory";::]
test/directory/KX_ML_REGISTRY deleted.