Clustering

Clusterization

class galaxywitness.clusterization.Clusterization(points, n_clusters=0, clusters=None)[source]

Class for handling clusterization of a point cloud

Parameters:
  • n_clusters (int) – number of clusters.

  • clusters – collection of clusters, each cluster contains four subarrays:

list of first coordinates, list of second coordinates, list of third coordinates, list of weights. Weights are optional to pass though for convenience __init__() fills the parameter with 1.0 in case it isn’t present :type clusters: list, Iterable, dict, or DataFrame

Parameters:
  • centers_of_mass_computed (bool) – flag is set to False unless centers of mass were computed for clusters.

  • centers_of_mass – collection of computed centers of mass,

info contained about each center: [coord_1, coord_2, coord_3, weight] :type centers_of_mass: list

center_of_mass()[source]

Compute centroids of clusters in clustering

compare_clusterization(other)[source]

Compare two clusterizations (not ready)

Parameters:

other – another clustering

draw_clustering()[source]

Draw clustering of point cloud

draw_projections(num)[source]

Draw projections of clustering of point cloud on the several random planes

Parameters:

num (int) – number of planes

import_clustering(labels)[source]

Import outer clustering

Parameters:

labels (list or np.ndarray) – labels of outer clustering

tomato(max_fil_val=7.5)[source]

Tomato clustering

Parameters:

max_fil_val (float) – maximum value of filtration

Density

class galaxywitness.manual_density.ManualDensity[source]

Class for handling density functions

dtm_density(points)[source]

DTM density function

Parameters:

points (np.array size of n_landmarks x 3) – set of landmarks in \(\mathbb{R}^d\).

random_density(points)[source]

Random density function for testing purposes

Parameters:

points (np.array size of n_landmarks x 3) – set of landmarks in \(\mathbb{R}^d\).