oraclesai.clustering.LISAHotspotClustering

class LISAHotspotClustering(column=None, spatial_weights_definition=None, max_p_value=None, supported_quadrants=None, seed=None, n_jobs=1)

Hotspot clustering implementation. Identifies spatial clusters of features with high or low values, as well as spatial outliers. For each sample it calculates the local Moran’s I, a p-value, and a label representing the cluster type. The p-value represents the statistical significance of the Moran’s I. There are four different labels.

  • 1 (High-High). A high value surrounded by high values, also called hot spots.

  • 2 (Low-High). A low value surrounded by high values.

  • 3 (Low-Low). A low value surrounded by low values, also called cold spots.

  • 4 (High-Low). A high value surrounded by low values.

Parameters:
  • column – int, default=None. The column that will be used to compute local correlations. In case of None, a single column in X is expected to fit the model.

  • spatial_weights_definition – SpatialWeightsDefinition, default=None. Spatial relationship specification. Defines the criteria used to identify neighbors, for example, KNNWeightsDefinition, DistanceBandWeightsDefinition, etc.

  • max_p_value – float, default=None. Used to label only regions with a p-value below certain value

  • supported_quadrants – list of integers, default=None. Only observations from these quadrants will be labeled. Values indicate quadrant location, 1 (High-High), 2 (Low-High), 3 (Low-Low), 4 (High-Low).

  • seed – int, default=None. Seed to ensure reproducibility of conditional randomizations.

  • n_jobs – int, default=None. The maximum number of concurrently running jobs. None is a a marker for ‘unset’ that will be interpreted as n_jobs=1.

Methods

__init__([column, ...])

fit(X[, y, geometries, spatial_weights, ...])

Calculates the local auto-correlation index based on the column specified.

fit_predict(X[, y, geometries, ...])

Trains the clustering model and returns the labels assigned to each observation.

get_params([deep])

Get parameters for this estimator.

set_params(**params)

Set the parameters of this estimator.

Attributes

Is

Array with the Local Moran's I for each sample.

labels_

Array of integers indicating the quadrant location for each sample.

ps

Array with p-values for each sample.

regions_

Dictionary with quadrants as keys and all contiguous regions formed by samples from the corresponding quadrant as values.