class UniState

Contains the classes used for storing parameters and system states.

class onion_clustering._internal.first_classes.MultiData(matrix)[source]

Bases: object

The input mutivariate signals to cluster.

Parameters:

matrix (ndarray of shape (dims, n_particles, n_frames)) – The values of the signal for each particle at each frame.

dims

The dimension of the space of the signals.

Type:

int

number_of_particles

The number of particles in the system.

Type:

int

num_of_steps

The number of frames in the system.

Type:

int

range

Min and max of the signals along each axes.

Type:

ndarray of shape (dim, 2)

matrix

The values of the signal for each particle at each frame.

Type:

ndarray of shape (n_particles, n_frames, dims)

labels

The cluster labels.

Type:

ndarray of shape (n_particles, n_frames)

class onion_clustering._internal.first_classes.Parameters(tau_window, bins, number_of_sigmas)[source]

Bases: object

Contains the set of parameters for the specific analysis.

Parameters:
  • tau_w (int) – The time resolution for the clustering, corresponding to the length of the windows in which the time-series are segmented.

  • bins (Union[str, int]) – The number of bins used for the construction of the histograms. Can be an integer value, or “auto”. If “auto”, the default of numpy.histogram_bin_edges is used (see https://numpy.org/doc/stable/reference/generated/ numpy.histogram_bin_edges.html#numpy.histogram_bin_edges).

  • tau_window (int)

  • number_of_sigmas (float)

class onion_clustering._internal.first_classes.StateMulti(mean, sigma, area, r_2)[source]

Bases: object

Represents a multifimensional state as a factorized Gaussian.

Parameters:
  • mean (np.ndarray of shape (dim,)) – Mean of the Gaussians.

  • sigma (np.ndarray of shape (dim,)) – Rescaled standard deviation of the Gaussians.

  • area (np.ndarray of shape (dim,)) – Area below the Gaussians.

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

perc

Fraction of data points classified in this state.

Type:

float

axis

The thrasholds of the state.

Type:

ndarray of shape (dim,)

build_boundaries(number_of_sigmas)[source]

Sets the thresholds to classify the data windows inside the state.

Parameters:
  • sigmas (number of) – How many sigmas the thresholds are far from the mean.

  • number_of_sigmas (float)

class onion_clustering._internal.first_classes.StateUni(mean, sigma, area, r_2)[source]

Bases: object

Represents a unidimensional state as a Gaussian.

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 thrashold of the state.

Type:

float

th_sup

Upper thrashold of the state.

Type:

float

build_boundaries(number_of_sigmas)[source]

Sets the thresholds to classify the data windows inside the state.

Parameters:
  • sigmas (number of) – How many sigmas the thresholds are far from the mean.

  • number_of_sigmas (float)

class onion_clustering._internal.first_classes.UniData(matrix)[source]

Bases: object

The input univariate signals to cluster.

Parameters:

matrix (ndarray of shape (n_particles, n_frames)) – The values of the signal for each particle at each frame.

number_of_particles

The number of particles in the system.

Type:

int

num_of_steps

The number of frames in the system.

Type:

int

range

Min and max of the signals.

Type:

ndarray of shape (2,)

labels

The cluster labels.

Type:

ndarray of shape (n_particles, n_frames)