tropea_clustering._internal.first_classes.StateUni

class tropea_clustering._internal.first_classes.StateUni(mean, sigma, area, r_2, perc=0.0)[source]

Represents a unidimensional state as a Gaussian.

All the parameters and information on the Gaussian states corresponding to the different clusters are stored within this class. The attributes can be acessed using the get_attributes() method.

Parameters:
  • mean (float) – Mean of the Gaussian.

  • sigma (float) – Rescaled standard deviation of the Gaussian.

  • area (float) – Area below the Gaussian.

  • r_2 (float) – Coefficient of determination of the Gaussian fit.

  • perc (float)

peak

Maximum value of the Gaussian.

Type:

float

perc

Fraction of data points classified in the state.

Type:

float

th_inf

_th_inf[0] stores the lower threshold of the state. Considering the Gaussian states oreder with increasing values of the mean, this is the intercsection point (if exists) with the Gaussian before. If there is no intersection, it is the weighted average between the two means. The two cases are distinguished by the value of _th_inf[1], which is “0” in the first case, “1” in the second.

Type:

ndarray of shape (2,)

th_sup

_th_sup[0] stores the upper threshold of the state. Considering the Gaussian states oreder with increasing values of the mean, this is the intercsection point (if exists) with the Gaussian after. If there is no intersection, it is the weighted average between the two means. The two cases are distinguished by the value of _th_sup[1], which is “0” in the first case, “1” in the second.

Type:

ndarray of shape (2,)

Methods

get_attributes

Returns a dictionary containing the attributes of the state.

Attributes

perc

mean

sigma

area

r_2

peak

th_inf

th_sup

get_attributes()[source]

Returns a dictionary containing the attributes of the state.

The attributes “th_inf” and “th_sup” are returned as a single ndarray with the label “th”.

Returns:

attr_list

Return type:

dict