vuecore.decomposition module

vuecore.decomposition module#

Decompositon plots like pca, umap, tsne, etc.

vuecore.decomposition.pca_grid(PCs: DataFrame, meta_column: Series, n_components: int = 4, meta_col_name: str | None = None, figsize=(6, 8)) Figure[source]#

Plot a grid of scatter plots for the first n_components of PCA, per default 4.

Parameters:
  • PCs (pd.DataFrame) – DataFrame with the principal components as columns.

  • meta_column (pd.Series) – Series with categorical data to color the scatter plots.

  • n_components (int, optional) – Number of first n components to plot, by default 4

  • meta_col_name (Optional[str], optional) – If another name than the default series name shoudl be used, by default None

Returns:

Matplotlib figure with the scatter plots.

Return type:

plt.Figure

vuecore.decomposition.plot_explained_variance(pca: PCA, ax: Axes | None = None) Axes[source]#

Plot explained variance of PCA from scikit-learn.