Publishing models
This feature is not available in GDS Sessions. |
By default, a trained model is visible only to the user that created it. Making a model accessible to other users can be achieved by publishing it.
Syntax
CALL gds.model.publish(modelName: String)
YIELD
modelName: String,
modelType: String,
modelInfo: Map,
creationTime: DateTime,
trainConfig: Map,
graphSchema: Map,
loaded: Boolean,
stored: Boolean,
published: Boolean
Name | Type | Default | Optional | Description |
---|---|---|---|---|
modelName |
String |
|
no |
The name of a model stored in the catalog. |
Name | Type | Description |
---|---|---|
modelName |
String |
Name of the model. |
modelType |
String |
Type of the model. Indicates what training algorithm was used to train the model. |
modelInfo |
Map |
Detailed type-specific information about the trained model. |
creationTime |
Datetime |
Time when the model was created. |
trainConfig |
Map |
Train configuration used for training the model. |
graphSchema |
Map |
Schema of the graph on which the model was trained. |
loaded |
Boolean |
True, if the model is loaded in the in-memory model catalog. |
stored |
Boolean |
True, if the model is stored on disk. |
published |
Boolean |
True, if the model has been published. |
Examples
In this section we will illustrate how to publish a model.
A pre-requisite for this operation is that a model has already been trained and registered in the model catalog.
We will assume here that two models named my-model1
and my-model2
have already been trained and exist in the model catalog.
Our initial state can be inspected by listing all models in the catalog:
CALL gds.model.list()
YIELD modelName, modelType, modelInfo, loaded, stored, published
modelName | modelType | modelInfo | loaded | stored | published |
---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Publishing a model
All we need to do is to run the procedure and specify the name of the model we want to publish.
CALL gds.model.publish('my-model1')
YIELD modelName, modelType, modelInfo, loaded, stored, published
modelName | modelType | modelInfo | loaded | stored | published |
---|---|---|---|---|---|
"my-model1_public" |
"example-model-type" |
{exampleModelInfo="exampleValue"} |
true |
false |
true |
We can see that the model name is modified with the _public
suffix.
When we now list the models in the catalog we can see that the published model has changed.
CALL gds.model.list()
YIELD modelName, modelType, modelInfo, loaded, stored, published
RETURN modelName, modelType, modelInfo, loaded, stored, published
ORDER BY modelName
modelName | modelType | modelInfo | loaded | stored | published |
---|---|---|---|---|---|
"my-model1_public" |
"example-model-type" |
{exampleModelInfo="exampleValue"} |
true |
false |
true |
"my-model2" |
"example-model-type" |
{number=42} |
true |
false |
false |
The published model is now accessible to all users.