Node Classification Model

class graphdatascience.model.node_classification_model.NCModel

Represents a node classification model in the model catalog. Construct this using NCTrainingPipeline.train().

best_parameters() Series[Any]

Get the best parameters for the pipeline model.

Returns:

The best parameters for the pipeline model.

Return type:

Series[Any]

classes() list[int]

Get the classes of the model.

Returns:

The classes of the model.

Return type:

list[int]

creation_time() Any

Get the creation time of the model.

Returns:

The creation time of the model.

Return type:

Any

drop(failIfMissing: bool = False) Series[Any]

Drop the model.

Parameters:

failIfMissing (bool) – If True, an error is thrown if the model does not exist. If False, no error is thrown.

Returns:

The result of the drop operation.

Return type:

Series[Any]

exists() bool

Check whether the model exists.

Returns:

True if the model exists, False otherwise.

Return type:

bool

feature_properties() list[str]

Get the feature properties of the model.

Returns:

The feature properties of the model.

Return type:

list[str]

graph_schema() Series[Any]

Get the graph schema of the model.

Returns:

The graph schema of the model.

Return type:

Series[Any]

loaded() bool

Check whether the model is loaded in memory.

Returns:

True if the model is loaded in memory, False otherwise.

Return type:

bool

metrics() Series[Any]

Get the metrics for the pipeline model.

Returns:

The metrics for the pipeline model.

Return type:

Series[Any]

model_info() dict[str, Any]

Get the model info of the model.

Returns:

The model info of the model.

Return type:

dict[str, Any]

name() str

Get the name of the model.

Returns:

The name of the model.

Return type:

str

node_property_steps() list[NodePropertyStep]

Get the node property steps for the pipeline model.

Returns:

The node property steps for the pipeline model.

Return type:

list[NodePropertyStep]

predict_mutate(G: Graph, **config: Any) Series[Any]

Predict on the given graph using the model and mutate the graph with the results.

Parameters:
  • G (Graph) – The graph to predict on.

  • **config (Any) – The config for the prediction.

Returns:

The result of mutate operation.

Return type:

Series[Any]

predict_mutate_estimate(G: Graph, **config: Any) Series[Any]

Estimate the memory needed to predict on the given graph using the model.

Parameters:
  • G (Graph) – The graph to predict on.

  • **config (Any) – The config for the prediction.

Returns:

The memory needed to predict on the given graph using the model.

Return type:

Series[Any]

predict_stream(G: Graph, **config: Any) DataFrame

Predict on the given graph using the model and stream the results as DataFrame

Parameters:
  • G (Graph) – The graph to predict on.

  • **config (Any) – The config for the prediction.

Returns:

The prediction results as DataFrame.

Return type:

DataFrame

predict_stream_estimate(G: Graph, **config: Any) Series[Any]

Estimate the prediction on the given graph using the model and stream the results as DataFrame

Parameters:
  • G (Graph) – The graph to predict on.

  • **config (Any) – The config for the prediction.

Returns:

The prediction results as DataFrame.

Return type:

Series[Any]

predict_write(G: Graph, **config: Any) Series[Any]

Predict the node labels of a graph and write the results to the database.

Parameters:
  • G (Graph) – The graph to predict on.

  • **config (Any) – The config for the prediction.

Returns:

The result of the write operation.

Return type:

Series[Any]

predict_write_estimate(G: Graph, **config: Any) Series[Any]

Estimate the memory needed to predict the node labels of a graph and write the results to the database.

Parameters:
  • G (Graph) – The graph to predict on.

  • **config (Any) – The config for the prediction.

Returns:

The memory needed to predict the node labels of a graph and write the results to the database.

Return type:

Series[Any]

published() bool

Check whether the model is published.

Returns:

True if the model is published, False otherwise.

Return type:

bool

shared() bool

Check whether the model is shared.

Returns:

True if the model is shared, False otherwise.

Return type:

bool

stored() bool

Check whether the model is stored on disk.

Returns:

True if the model is stored on disk, False otherwise.

Return type:

bool

train_config() Series[Any]

Get the train config of the model.

Returns:

The train config of the model.

Return type:

Series[Any]

type() str

Get the type of the model.

Returns:

The type of the model.

Return type:

str