turicreate.shortest_path.ShortestPathModel — Turi Create API 6.4.1 documentation (original) (raw)
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 duringturicreate.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, useturicreate.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.
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. |