aaanalysis.AAclustPlot
- class aaanalysis.AAclustPlot(model_class=<class 'sklearn.decomposition._pca.PCA'>, model_kwargs=None, verbose=True, random_state=None)[source]
Bases:
objectPlotting class for
AAclust(Amino Acid clustering) results [Breimann24a].This class performs dimensionality reduction for visualization using decomposition models such as Principal Component Analysis (PCA).
Added in version 0.1.2.
- Parameters:
Methods
centers(X[, labels, component_x, ...])PCA plot of clustering with 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_clustersand clustering metricsBIC,CH, andSCfromdf_seq.medoids(X[, labels, component_x, ...])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_componentsparameter.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
AAclust: the respective computation class.Scikit-learn decomposition model classes.
Examples
The
AAclustPlotobject utilizes Transformer models, such as Principal Component Analysis (PCA), to visualize theAAclustclustering results. Valid models can be provided via themodel_classparameter (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_kwargsparameters:aac_plot = aa.AAclustPlot(model_class=PCA, model_kwargs=dict(svd_solver="full"))