src.clustering.simple_features_clusterer

Classes

SimpleFeaturesClusterer(**kwargs)

class src.clustering.simple_features_clusterer.SimpleFeaturesClusterer(**kwargs)
Author:

Alberto M. Esmoris Pena

Simple clustering on the feature space \(\pmb{F} \in \mathbb{R}^{m \times n_f}\). It supports generating or extending a cluster such that points satisfying a given set of conditions (through the filters argument) belong to the cluster. The recommended convention is that points that do not belong to the cluster are represented with a zero value, while points belonging to the cluster are represented with a greater than zero integer. Typically, points in the cluster are represented with a one. However, the simple features clusterer might be run several times with different conditions and associating each result with a different label.

Variables:
static extract_clustering_args(spec)

Extract the arguments to initialize/instantiate a SimpleFeaturesClusterer from a key-word specification.

Parameters:

spec – The key-word specification containing the arguments.

Returns:

The arguments to initialize/instantiate a SimpleFeaturesClusterer.

__init__(**kwargs)

Initialize an instance of SimpleFeaturesClusterer.

Parameters:

kwargs – The attributes of the SimpleFeaturesClusterer that will also be passed to the parent.

fit(pcloud)

The SimpleFeaturesClusterer does not require any fit at all. See Clusterer and Clusterer.fit().

cluster(pcloud)

Apply simple features-based clustering to the given point cloud.

See src.clustering.clusterer.Clusterer and src.clustering.clusterer.Clusterer.fit().

static apply_filter(cmask, f, feat)

Apply the given filter to the input cluster mask.

Parameters:
  • cmask (np.ndarray) – The input cluster mask that must be updated depending on the given filter. Note that it is a boolean mask where True means the point belongs to the cluster according to the given filters and False means it does not. Points that will not belong to the cluster will not be updated, instead their value will be kept. This allows chaining multiple src.clustering.simple_features_clusterer.SimpleFeaturesClusterer in the same pipeline.

  • f (dict) – The filter that governs the cluster mask.

  • feat (np.ndarray) – The feature involved in the current filter as a vector whose components give point-wise values.

Returns:

The given input cmask (which is also updated in place).

Return type:

np.ndarray