htmd.projections.kmeanstri module#

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

Bases: object

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

Parameters:

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

Examples

>>> tri = KMeansTri(data)
>>> dataproj = tri.project(50)
project(ndim: int | None = None) MetricData#

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

Parameters:

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

Returns:

projdata – A new MetricData object containing the projected data.

Return type:

MetricData object

Examples

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