Model procedures

Listing of all model procedures in the Neo4j Graph Data Science Python Client API. These all assume that an object of GraphDataScience is available as gds.

Deprecated since version 2.5.0: Since GDS server version 2.5.0 you should use the endpoint gds.backup() instead.

gds.alpha.backup(**config) pandas.DataFrame

The back-up procedure persists graphs and models to disk

gds.alpha.model.delete(model: Model) pandas.Series[Any]

Deletes a stored model from disk.

gds.alpha.model.load(model_name: str) Tuple[Model, pandas.Series[Any]]

Load a stored model into main memory.

gds.alpha.model.publish(model: Model) Model

Make a trained model accessible by all users.

gds.alpha.model.store(model: Model, failIfUnsupportedType: bool = True) pandas.Series[Any]

Store the selected model to disk.

Deprecated since version 2.5.0: Since GDS server version 2.5.0 you should use the endpoint gds.restore() instead.

gds.alpha.restore(**config: Any) pandas.DataFrame

The restore procedure reads graphs and models from disk.

gds.backup(**config) pandas.DataFrame

The back-up procedure persists graphs and models to disk

gds.beta.model.drop(model: Model) pandas.Series[Any]

Drops a loaded model and frees up the resources it occupies.

gds.beta.model.exists(model_name: str) pandas.Series[Any]

Checks if a given model exists in the model catalog.

gds.beta.model.list(model: Model | None = None) pandas.DataFrame

Lists all models contained in the model catalog.

gds.model.get(model_name: str) Model

Returns a model from the model catalog.

gds.restore(**config: Any) pandas.DataFrame

The restore procedure reads graphs and models from disk.

gds.model.delete(model: Model) pandas.Series[Any]

Deletes a stored model from disk.

gds.model.load(model_name: str) Tuple[Model, pandas.Series[Any]]

Load a stored model into main memory.

gds.model.publish(model: Model) Model

Make a trained model accessible by all users.

gds.model.store(model: Model, failIfUnsupportedType: bool = True) pandas.Series[Any]

Store the selected model to disk.

gds.model.drop(model: Model) pandas.Series[Any]

Drops a loaded model and frees up the resources it occupies.

gds.model.exists(model_name: str) pandas.Series[Any]

Checks if a given model exists in the model catalog.

gds.model.list(model: Model | None = None) pandas.DataFrame

Lists all models contained in the model catalog.

gds.model.transe.create(G: Graph, node_embedding_property: str, relationship_type_embeddings: Dict[str, List[float]) SimpleRelEmbeddingModel

Create a TransE relationship embedding model

Parameters:
  • G – The Graph object representing the graph the model is trained on

  • node_embedding_property – The name of the node property under which the TransE embeddings are stored

  • relationship_type_embeddings – A dictionary mapping relationship type names to the TransE model’s relationship type embeddings

Returns:

A relationship embedding model that can be used to predict new node pair based on the TransE metric

gds.model.distmult.create(G: Graph, node_embedding_property: str, relationship_type_embeddings: Dict[str, List[float]) SimpleRelEmbeddingModel

Create a DistMult relationship embedding model

Parameters:
  • G – The Graph object representing the graph the model is trained on

  • node_embedding_property – The name of the node property under which the DistMult embeddings are stored

  • relationship_type_embeddings – A dictionary mapping relationship type names to the DistMult model’s relationship type embeddings

Returns:

A relationship embedding model that can be used to predict new node pair based on the DistMult metric