turicreate.shortest_path.ShortestPathModel

class turicreate.shortest_path.ShortestPathModel(model)

Model object containing the distance for each vertex in the graph to a single source vertex, which is specified during turicreate.shortest_path.create().

The model also allows querying for one of the shortest paths from the source vertex to any other vertex in the graph.

Below is a list of queryable fields for this model:

Field Description
graph A new SGraph with the distance as a vertex property
distance An SFrame with each vertex’s distance to the source vertex
weight_field The edge field for weight
source_vid The source vertex id
max_distance Maximum distance between any two vertices
training_time Total training time of the model

This model cannot be constructed directly. Instead, use turicreate.shortest_path.create() to create an instance of this model. A detailed list of parameter options and code samples are available in the documentation for the create function.

See also

create

Methods

ShortestPathModel.get_path(vid[, highlight]) Get the shortest path.
ShortestPathModel.name() Returns the name of the model.
ShortestPathModel.save(location) Save the model.
ShortestPathModel.summary([output]) Print a summary of the model.