onion_clustering.OnionMulti¶
- class onion_clustering.OnionMulti(ndims=2, bins='auto', number_of_sigmas=2.0)[source]¶
Performs onion clustering on a data array.
- Parameters:
bins (int, default="auto") – 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).
number_of_sigmas (float, default=2.0) – Sets the thresholds for classifing a signal window inside a state: the window is contained in the state if it is entirely contained inside number_of_sigma * state.sigms times from state.mean.
ndims (int)
- state_list_¶
List of the identified states.
- Type:
List[StateMulti]
- labels_¶
Cluster labels for each point. Unclassified points are given the label -1.
- Type:
ndarray of shape (n_particles * n_windows,)
Methods
Performs onion clustering on the data array 'X'.
Computes clusters on the data array 'X' and returns labels.
Get parameters for this estimator.
Set the parameters of this estimator.
- fit(X, y=None)[source]¶
Performs onion clustering on the data array ‘X’.
- Parameters:
X (ndarray of shape (n_particles * n_windows, tau_window * n_features)) – The raw data. Notice that each signal window is considered as a single data point.
- Returns:
self – A fitted instance of self.
- Return type:
- fit_predict(X, y=None)[source]¶
Computes clusters on the data array ‘X’ and returns labels.
- Parameters:
X (ndarray of shape (n_particles * n_windows, tau_window * n_features)) – The raw data. Notice that each signal window is considered as a single data point.
- Returns:
labels_ – Cluster labels for each point. Unclassified points are given the label -1.
- Return type:
ndarray of shape (n_particles * n_windows,)
- set_params(**params)[source]¶
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline
). The latter have parameters of the form<component>__<parameter>
so that it’s possible to update each component of a nested object.- Parameters:
**params (dict) – Estimator parameters.
- Returns:
self – Estimator instance.
- Return type:
estimator instance