class turicreate.triangle_counting.TriangleCountingModel(model)

Model object containing the triangle count for each vertex, and the total number of triangles. The model ignores the edge directions in that it assumes there are no multiple edges between the same source ang target pair and ignores bidirectional edges.

The triangle count of individual vertex characterizes the importance of the vertex in its neighborhood. The total number of triangles characterizes the density of the graph. It can also be calculated using

>>> m['triangle_count']['triangle_count'].sum() / 3.

Below is a list of queryable fields for this model:

Field Description
triangle_count An SFrame with each vertex’s id and triangle count
num_triangles Total number of triangles in the graph
graph A new SGraph with the triangle count as a vertex property
training_time Total training time of the model

This model cannot be constructed directly. Instead, use turicreate.triangle_counting.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



TriangleCountingModel.name() Returns the name of the model.
TriangleCountingModel.save(location) Save the model.
TriangleCountingModel.summary([output]) Print a summary of the model.