htmd.projections.kmeanstri module#

class htmd.projections.kmeanstri.KMeansTri(data)#

Bases: object

Class for calculating the KMeans-triangle projections of a MetricData object.

Parameters:

data (MetricData) – The object whose data we wish to project.

Examples

>>> tri = KMeansTri(data)
>>> dataproj = tri.project(50)
project(ndim=None)#

Project the data object given to the constructor onto ndim dimensions.

Parameters:

ndim (int | None) – The number of dimensions (cluster centers) to project the data on.

Returns:

projdata – A new MetricData object containing the projected data.

Return type:

MetricData

Examples

>>> tri = KMeansTri(data)
>>> datatri = tri.project(50)