Cluster Decoder

class myHmmPackage.cluster_decoder.ClusterDecoder(n_clusters=4, gamma_init=None, decoding_mats_init=None, method='regression', measure='error', max_iter=100.0, reg_param=1e-05, transition_scheme=None, init_scheme=None)[source]

ClusterDecoder is an Estimator that performs supervised decoding with a predefined number of decoding matrices. A clustering method is used to choose which decoding matrix to use for each sample of each input data. The metaparameters are gamma_(ndarray, shape (n_time_points, n_clusters)) and decoding_mats_(ndarray, shape (n_clusters, n_time_points, n_label_features))

Parameters
  • n_clusters (int) – Number of desired clusters. default=4

  • gamma_init (ndarray) – The initial value of gamma_. shape=(n_time_points, n_clusters) or None. default=None

  • decoding_mats_init (ndarray) – The initial value of decoding_mats_. shape=(n_clusters, n_time_points, n_label_features) or None. default=None

  • method (str) – Name of the decoding method used among ‘sequential’ or ‘regression’. default=’regression’

  • measure (str) – Measure used for the ‘sequential’ method. default=’error’

  • max_iter (int) – Number of iterations. default=100

  • reg_param (float) – Regularization parameter. default=10e-5

  • transition_scheme (ndarray) – Constraints for the cluster transitions. shape=(n_clusters, n_clusters) or None. default=None

  • init_scheme (ndarray) – Initial probability for each cluster. shape=(n_clusters,) or None. default=None

Variables
  • gamma (ndarray) – The tensor containing each cluster’s probability time-course, of shape=(n_time_points, n_clusters).

  • decoding_mats (ndarray) – The tensor containing the decoding matrices associated to each cluster, of shape=(n_clusters, n_time_points, n_label_features).

fit(X, y)[source]

Estimate model parameters.

Parameters
  • X (array-like) – The training input samples (brain data) of shape=(n_samples, n_time_points, n_regions)

  • y (array-like) – The target values, An array of int and of shape=(n_samples, n_time_points, n_label_features)

Returns

Returns self

predict(X)[source]

Find most likely state sequence corresponding to X, then computes y_predict, the predicted labels given X.

Parameters

X – The training input samples (brain data) of shape=(n_samples, n_time_points, n_regions)

Returns

Returns y_predict, the predicted labels in an tensor of shape=(n_samples, n_time_points, n_label_features)