onion_clustering._internal.first_classes.StateUni

class onion_clustering._internal.first_classes.StateUni(mean, sigma, area, r_2)[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.

peak

Maximum value of the Gaussian.

Type:

float

perc

Fraction of data points classified in the state.

Type:

float

th_inf

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. The actual threshold value is stored in th_inf[0].

Type:

float

th_sup

Upper thrashold 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. The actual threshold value is stored in th_sup[0].

Type:

float

Methods

get_attributes

Returns a dictionary containing the attributes of the state.

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