AAclustPlot

class AAclustPlot(model_class=<class 'sklearn.decomposition._pca.PCA'>, model_kwargs=None, verbose=True, random_state=None)[source]

Bases: object

Plotting class for AAclust (Amino Acid clustering) results, providing dimensionality-reduction scatter plots, correlation heatmaps, and clustering evaluation charts [Breimann24a].

Dimensionality reduction is performed using decomposition models such as Principal Component Analysis (PCA).

Added in version 0.1.2.

Parameters:

Methods

centers([X, df_scales, component_x, ...])

Create a Principal Component Analysis (PCA) plot of clustering results with cluster centers highlighted.

correlation(df_corr, labels[, labels_ref, ...])

Heatmap for correlation matrix with colored sidebar to label clusters.

eval(df_eval[, figsize, dict_xlims])

Plots evaluation of n_clusters and clustering metrics Bayesian Information Criterion (BIC), Calinski-Harabasz (CH), and Silhouette Coefficient (SC) from df_eval.

medoids([X, df_scales, component_x, ...])

Principal Component Analysis (PCA) plot of clustering with medoids highlighted.

__init__(model_class=<class 'sklearn.decomposition._pca.PCA'>, model_kwargs=None, verbose=True, random_state=None)[source]
Parameters:
  • model_class (Type[TransformerMixin], default=PCA) – A decomposition model class with n_components parameter.

  • model_kwargs (dict, optional) – Keyword arguments to pass to the selected decomposition model.

  • verbose (bool, default=True) – If True, verbose outputs are enabled.

  • random_state (int, optional) – The seed used by the random number generator. If a positive integer, results of stochastic processes are consistent, enabling reproducibility. If None, stochastic processes will be truly random.

See also

Examples

The AAclustPlot object utilizes Transformer models, such as Principal Component Analysis (PCA), to visualize the AAclust clustering results. Valid models can be provided via the model_class parameter (default=PCA):

import aaanalysis as aa
# Valid transformer models
from sklearn.decomposition import PCA, KernelPCA, FastICA, TruncatedSVD, NMF
from sklearn.manifold import LocallyLinearEmbedding, Isomap
# Initialize AAclustPlot with PCA
aac_plot = aa.AAclustPlot(model_class=PCA)

Arguments of the transformer model can be set using the model_kwargs parameters:

aac_plot = aa.AAclustPlot(model_class=PCA, model_kwargs=dict(svd_solver="full"))

Further parameters. AAclustPlot.__init__ also accepts: verbose; random_state.