from pyPLNmodels import load_scrna
rna = load_scrna(dim=10)
print('Data: ', rna.keys())Returning scRNA dataset of size (400, 10)
Data: dict_keys(['endog', 'labels', 'labels_1hot'])
This guide introduces the basics of multivariate count data analysis using the pyPLNmodels package. For complex datasets, traditional models like Poisson regression and Zero-Inflated Poisson Regression (ZIP) may fail to capture important insights, such as correlations between counts (i.e. variables). The pyPLNmodels package provides two key models to address these challenges:
Pln model (documentation)PlnPCA model (documentation)The PlnPCA model extends the functionality of the Pln model to handle high-dimensional data, though it may slightly compromise parameter estimation accuracy.
Both models are built on the following assumptions for a given count matrix \(Y\) (Aitchison and Ho 1989):
\[ Y_{ij}| Z_{ij} \sim \mathcal P(\exp(o_{ij} + Z_{ij})), \quad Z_{i}\sim \mathcal N(X_i^{\top} B, \Sigma),\] where the input data includes:
endog): the \(j\)-th count for the \(i\)-th observationexog): covariates for the \(i\)-th observation (if available)offsets): offset for the \(i\)-th observation (if available)and the model parameters are:
coef): a matrix of regression coefficientscovariance): the covariance matrix of the latent variables \(Z_i\)These models aim to capture the structure of the data through the latent variables \(Z\).
The Pln model assumes \(\Sigma\) has full rank, while the PlnPCA model assumes \(\Sigma\) has a low rank, which must be specified by the user. A lower rank introduces a trade-off, reducing computational complexity but potentially compromising parameter estimation accuracy.
The pyPLNmodels package is designed to:
This is achieved using the input count matrix \(Y\), along with optional covariate matrix \(X\) (defaulting to a vector of 1s) and offsets \(O\) (defaulting to a matrix of 0s).
In this example, we analyze single-cell RNA-seq data (Swechha et al. (2021)) provided by the load_scrna function in the package. Each column in the dataset represents a gene, while each row corresponds to a cell (i.e., an individual). Covariates for cell types (labels) are also included. For simplicity, we limit the analysis to \(10\) variables (dimensions).
from pyPLNmodels import load_scrna
rna = load_scrna(dim=10)
print('Data: ', rna.keys())Returning scRNA dataset of size (400, 10)
Data: dict_keys(['endog', 'labels', 'labels_1hot'])
endog)endog = rna["endog"]
print(endog.head()) FTL MALAT1 FTH1 TMSB4X CD74 SPP1 APOE B2M ACTB HLA-DRA
0 5.0 39.0 14.0 39.0 11.0 0.0 0.0 88.0 49.0 0.0
1 8.0 52.0 38.0 186.0 17.0 0.0 0.0 152.0 167.0 3.0
2 76.0 29.0 38.0 71.0 37.0 3.0 2.0 21.0 7.0 12.0
3 354.0 151.0 236.0 184.0 287.0 0.0 238.0 255.0 27.0 243.0
4 0.0 55.0 10.0 37.0 8.0 1.0 0.0 23.0 49.0 1.0
cell_type = rna["labels"]
print('Possible cell types: ', cell_type.unique())
print(cell_type.head())Possible cell types: ['T_cells_CD4+' 'Macrophages' 'T_cells_CD8+']
0 T_cells_CD4+
1 T_cells_CD4+
2 Macrophages
3 Macrophages
4 T_cells_CD4+
Name: standard_true_celltype_v5, dtype: object
To analyze the mean values for each cell type, we use cell type as a covariate, with Macrophages as the reference category:
from pyPLNmodels import Pln
pln = Pln.from_formula('endog ~ 1 + labels', data=rna).fit()Setting the offsets to zero.
Fitting a Pln model with full covariance.
Intializing parameters ...
Initialization finished.
Upper bound on the fitting time: 0%| | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time: 18%|█▊ | 74/400 [00:00<00:00, 734.92it/s]Upper bound on the fitting time: 37%|███▋ | 149/400 [00:00<00:00, 741.77it/s]Upper bound on the fitting time: 56%|█████▌ | 224/400 [00:00<00:00, 742.57it/s]Upper bound on the fitting time: 75%|███████▍ | 299/400 [00:00<00:00, 681.12it/s]Upper bound on the fitting time: 94%|█████████▎| 374/400 [00:00<00:00, 704.09it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 707.82it/s]
Maximum number of iterations (400) reached in 1.5 seconds.
Last criterion = 5.4e-06 . Required tolerance = 1e-06
For more details on formula syntax and model initialization, including handling offsets, refer to the dedicated tutorial.
After fitting the model, you can print its configuration and key details:
print(pln)A multivariate Pln with full covariance.
======================================================================
Loglike Dimension Nb param BIC AIC ICL
-12790.12 10 85 13044.7622 12875.125 6261.7
======================================================================
* Useful attributes
.latent_variables .latent_positions .coef .covariance .precision .model_parameters .latent_parameters .optim_details
* Useful methods
.transform() .show() .predict() .sigma() .projected_latent_variables() .plot_correlation_circle() .biplot() .viz() .pca_pairplot() .plot_expected_vs_true()
* Additional attributes for Pln are:
None
* Additional methods for Pln are:
.get_variance_coef() .get_confidence_interval_coef() .summary() .get_coef_p_values() .plot_regression_forest()
To gain deeper insights into the model parameters and the optimization process, use the .show() method:
pln.show()Monitoring the norm of each parameter is essential to assess model convergence. If the model has not converged, consider refitting it with additional iterations and a reduced tolerance (tol). To adjust the number of iterations, use the maxiter parameter:
pln.fit(maxiter=1000, tol = 0).show()Fitting a Pln model with full covariance.
Upper bound on the fitting time: 0%| | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time: 7%|▋ | 71/1000 [00:00<00:01, 705.66it/s]Upper bound on the fitting time: 15%|█▍ | 146/1000 [00:00<00:01, 727.29it/s]Upper bound on the fitting time: 22%|██▏ | 222/1000 [00:00<00:01, 737.75it/s]Upper bound on the fitting time: 30%|██▉ | 298/1000 [00:00<00:00, 742.72it/s]Upper bound on the fitting time: 37%|███▋ | 374/1000 [00:00<00:00, 747.61it/s]Upper bound on the fitting time: 45%|████▌ | 450/1000 [00:00<00:00, 749.36it/s]Upper bound on the fitting time: 53%|█████▎ | 526/1000 [00:00<00:00, 749.56it/s]Upper bound on the fitting time: 60%|██████ | 602/1000 [00:00<00:00, 750.68it/s]Upper bound on the fitting time: 68%|██████▊ | 678/1000 [00:00<00:00, 749.52it/s]Upper bound on the fitting time: 75%|███████▌ | 753/1000 [00:01<00:00, 744.72it/s]Upper bound on the fitting time: 83%|████████▎ | 829/1000 [00:01<00:00, 746.65it/s]Upper bound on the fitting time: 90%|█████████ | 905/1000 [00:01<00:00, 748.01it/s]Upper bound on the fitting time: 98%|█████████▊| 981/1000 [00:01<00:00, 749.14it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [00:01<00:00, 745.56it/s]
Maximum number of iterations (1400) reached in 2.8 seconds.
Last criterion = 0.0 . Required tolerance = 0
The latent variables \(Z\), which capture the underlying structure of the data, are accessible via the latent_variables attribute, or the .transform() method:
Z = pln.latent_variables
Z = pln.transform()
print('Shape of Z:', Z.shape)Shape of Z: torch.Size([400, 10])
You can visualize these latent variables using the .viz() method:
pln.viz(colors=cell_type)By default the effect of covariates on the latent variables is included in the visualization. This means that the latent variables are represented as \(Z +
XB\). The effect of covariates on the latent variables can be removed by using the remove_exog_effect keyword:
Z_moins_XB = pln.transform(remove_exog_effect=True)To visualize the latent positions without the effect of covariates (i.e., (Z - XB)), set the remove_exog_effect parameter to True in the .viz() method:
pln.viz(colors=cell_type, remove_exog_effect=True)Additionally, you can generate a pair plot of the first Principal Components (PCs) of the latent variables:
pln.pca_pairplot(n_components=4, colors=cell_type)The remove_exog_effect parameter is also available in the pca_pairplot method.
The model provides insights into the effects of covariates. For example, it may reveal that the mean value for Macrophages is higher compared to T_cells_CD4+ and T_cells_CD8+.
To summarize the model, including confidence intervals and p-values, use the summary method:
pln.summary()Coefficients and p-values per dimension:
Dimension: FTL
Exog Name Coefficient P-value
Intercept 4.408599 1e-16
labels[T.T_cells_CD4+] -3.255301 1e-16
labels[T.T_cells_CD8+] -3.704965 1e-16
Dimension: MALAT1
Exog Name Coefficient P-value
Intercept 4.496646 1e-16
labels[T.T_cells_CD4+] 0.044992 0.75
labels[T.T_cells_CD8+] -0.602403 7.8e-08
Dimension: FTH1
Exog Name Coefficient P-value
Intercept 3.989528 1e-16
labels[T.T_cells_CD4+] -2.125104 1e-16
labels[T.T_cells_CD8+] -3.118913 1e-16
Dimension: TMSB4X
Exog Name Coefficient P-value
Intercept 4.338097 1e-16
labels[T.T_cells_CD4+] -0.861660 6.8e-05
labels[T.T_cells_CD8+] -1.246957 1e-16
Dimension: CD74
Exog Name Coefficient P-value
Intercept 3.903079 1e-16
labels[T.T_cells_CD4+] -3.282655 1e-16
labels[T.T_cells_CD8+] -3.335481 1e-16
Dimension: SPP1
Exog Name Coefficient P-value
Intercept 0.209591 0.19
labels[T.T_cells_CD4+] -4.515602 1e-16
labels[T.T_cells_CD8+] -5.166453 1e-16
Dimension: APOE
Exog Name Coefficient P-value
Intercept 0.926648 2e-11
labels[T.T_cells_CD4+] -4.293190 2.2e-16
labels[T.T_cells_CD8+] -4.383797 1e-16
Dimension: B2M
Exog Name Coefficient P-value
Intercept 3.912995 1e-16
labels[T.T_cells_CD4+] -0.220007 0.67
labels[T.T_cells_CD8+] -0.583185 0.00023
Dimension: ACTB
Exog Name Coefficient P-value
Intercept 3.496265 1e-16
labels[T.T_cells_CD4+] -1.082953 0.00027
labels[T.T_cells_CD8+] -1.466583 3.5e-09
Dimension: HLA-DRA
Exog Name Coefficient P-value
Intercept 3.575849 1e-16
labels[T.T_cells_CD4+] -4.725000 1e-16
labels[T.T_cells_CD8+] -4.348214 1e-16
The p-value corresponds to the coding used in one-hot encoding, with Macrophages set as the reference category.
You can also visualize confidence intervals for regression coefficients using the plot_regression_forest method:
pln.plot_regression_forest()The pyPLNmodels package provides tools to analyze the effects of variables and visualize their relationships using the plot_correlation_circle() and biplot() methods.
Use the plot_correlation_circle() method to visualize the relationships between variables:
pln.plot_correlation_circle(column_names=["FTL", "MALAT1", "FTH1"])You can access the column names using the column_names_endog attribute of the model.
The biplot() method allows simultaneous visualization of variables and latent variables ((Z)):
pln.biplot(column_names=["FTL", "MALAT1", "FTH1"], colors=cell_type)PlnPCA ModelThe PlnPCA model (Chiquet, Mariadassou, and Robin 2018) extends the functionality of the Pln model for high-dimensional data. It uses the same syntax as Pln:
from pyPLNmodels import PlnPCA
high_d_rna = load_scrna(dim=500)
pca = PlnPCA.from_formula('endog ~ 1 + labels', data=high_d_rna, rank=5).fit()Returning scRNA dataset of size (400, 500)
Setting the offsets to zero.
Fitting a PlnPCA model with 5 principal components.
Intializing parameters ...
Initialization finished.
Upper bound on the fitting time: 0%| | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time: 8%|▊ | 31/400 [00:00<00:01, 308.06it/s]Upper bound on the fitting time: 16%|█▌ | 62/400 [00:00<00:01, 308.80it/s]Upper bound on the fitting time: 23%|██▎ | 93/400 [00:00<00:01, 300.71it/s]Upper bound on the fitting time: 31%|███▏ | 125/400 [00:00<00:00, 305.56it/s]Upper bound on the fitting time: 39%|███▉ | 157/400 [00:00<00:00, 307.73it/s]Upper bound on the fitting time: 47%|████▋ | 188/400 [00:00<00:00, 307.56it/s]Upper bound on the fitting time: 55%|█████▌ | 220/400 [00:00<00:00, 309.15it/s]Upper bound on the fitting time: 63%|██████▎ | 252/400 [00:00<00:00, 310.33it/s]Upper bound on the fitting time: 71%|███████ | 284/400 [00:00<00:00, 310.52it/s]Upper bound on the fitting time: 79%|███████▉ | 316/400 [00:01<00:00, 312.76it/s]Upper bound on the fitting time: 87%|████████▋ | 349/400 [00:01<00:00, 316.12it/s]Upper bound on the fitting time: 95%|█████████▌| 381/400 [00:01<00:00, 316.10it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:01<00:00, 310.64it/s]
Maximum number of iterations (400) reached in 1.6 seconds.
Last criterion = 5.4e-06 . Required tolerance = 1e-06
⚠️ Note: P-values are not available in the PlnPCA model.
print(pca)A multivariate PlnPCA with 5 principal components.
======================================================================
Loglike Dimension Nb param BIC AIC ICL
-330626.75 500 3990 342579.7218 334616.75 339725.76
======================================================================
* Useful attributes
.latent_variables .latent_positions .coef .covariance .precision .model_parameters .latent_parameters .optim_details
* Useful methods
.transform() .show() .predict() .sigma() .projected_latent_variables() .plot_correlation_circle() .biplot() .viz() .pca_pairplot() .plot_expected_vs_true()
* Additional attributes for PlnPCA are:
None
* Additional methods for PlnPCA are:
None
A low-dimensional of dimension rank of the latent variables can be obtained using the project keyword of the .transform() method:
Z_low_dim = pca.transform(project=True)
print('Shape of Z_low_dim:', Z_low_dim.shape)Shape of Z_low_dim: torch.Size([400, 5])
This model is particularly efficient for high-dimensional datasets, offering significantly reduced computation time compared to Pln. See this paper for a computational comparison between Pln and PlnPCA
The rank is a hyperparameter that can be specified by the user. Alternatively, a data-driven approach to rank selection can be performed using the PlnPCACollection class, which fits multiple models with different ranks:
from pyPLNmodels import PlnPCACollection
pcas = PlnPCACollection.from_formula('endog ~ 1 + labels', data=high_d_rna, ranks=[3, 5, 10, 15]).fit()Setting the offsets to zero.
Adjusting 4 PlnPCA models.
Fitting a PlnPCA model with 3 principal components.
Intializing parameters ...
Initialization finished.
Upper bound on the fitting time: 0%| | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time: 8%|▊ | 34/400 [00:00<00:01, 332.30it/s]Upper bound on the fitting time: 17%|█▋ | 68/400 [00:00<00:01, 319.22it/s]Upper bound on the fitting time: 26%|██▌ | 102/400 [00:00<00:00, 324.31it/s]Upper bound on the fitting time: 34%|███▍ | 136/400 [00:00<00:00, 329.58it/s]Upper bound on the fitting time: 42%|████▏ | 169/400 [00:00<00:00, 323.87it/s]Upper bound on the fitting time: 51%|█████ | 203/400 [00:00<00:00, 326.34it/s]Upper bound on the fitting time: 59%|█████▉ | 236/400 [00:00<00:00, 327.10it/s]Upper bound on the fitting time: 67%|██████▋ | 269/400 [00:00<00:00, 326.78it/s]Upper bound on the fitting time: 76%|███████▌ | 302/400 [00:00<00:00, 326.69it/s]Upper bound on the fitting time: 84%|████████▍ | 335/400 [00:01<00:00, 319.83it/s]Upper bound on the fitting time: 92%|█████████▏| 368/400 [00:01<00:00, 315.25it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:01<00:00, 322.21it/s]
Maximum number of iterations (400) reached in 1.5 seconds.
Last criterion = 5.4e-06 . Required tolerance = 1e-06
Fitting a PlnPCA model with 5 principal components.
Intializing parameters ...
Initialization finished.
Upper bound on the fitting time: 0%| | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time: 8%|▊ | 31/400 [00:00<00:01, 302.25it/s]Upper bound on the fitting time: 16%|█▌ | 62/400 [00:00<00:01, 298.27it/s]Upper bound on the fitting time: 23%|██▎ | 93/400 [00:00<00:01, 299.40it/s]Upper bound on the fitting time: 31%|███ | 123/400 [00:00<00:00, 296.79it/s]Upper bound on the fitting time: 38%|███▊ | 153/400 [00:00<00:00, 296.52it/s]Upper bound on the fitting time: 46%|████▌ | 183/400 [00:00<00:00, 296.10it/s]Upper bound on the fitting time: 53%|█████▎ | 213/400 [00:00<00:00, 297.01it/s]Upper bound on the fitting time: 61%|██████ | 244/400 [00:00<00:00, 298.60it/s]Upper bound on the fitting time: 68%|██████▊ | 274/400 [00:00<00:00, 298.71it/s]Upper bound on the fitting time: 76%|███████▌ | 304/400 [00:01<00:00, 289.84it/s]Upper bound on the fitting time: 84%|████████▎ | 334/400 [00:01<00:00, 290.11it/s]Upper bound on the fitting time: 91%|█████████ | 364/400 [00:01<00:00, 292.46it/s]Upper bound on the fitting time: 98%|█████████▊| 394/400 [00:01<00:00, 293.05it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:01<00:00, 294.75it/s]
Maximum number of iterations (400) reached in 1.4 seconds.
Last criterion = 5.4e-06 . Required tolerance = 1e-06
Fitting a PlnPCA model with 10 principal components.
Intializing parameters ...
Initialization finished.
Upper bound on the fitting time: 0%| | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time: 7%|▋ | 28/400 [00:00<00:01, 279.60it/s]Upper bound on the fitting time: 14%|█▍ | 56/400 [00:00<00:01, 277.33it/s]Upper bound on the fitting time: 21%|██ | 84/400 [00:00<00:01, 276.02it/s]Upper bound on the fitting time: 28%|██▊ | 112/400 [00:00<00:01, 276.02it/s]Upper bound on the fitting time: 35%|███▌ | 140/400 [00:00<00:00, 277.20it/s]Upper bound on the fitting time: 42%|████▏ | 168/400 [00:00<00:00, 272.33it/s]Upper bound on the fitting time: 49%|████▉ | 196/400 [00:00<00:00, 273.75it/s]Upper bound on the fitting time: 56%|█████▌ | 224/400 [00:00<00:00, 272.88it/s]Upper bound on the fitting time: 63%|██████▎ | 252/400 [00:00<00:00, 270.12it/s]Upper bound on the fitting time: 70%|███████ | 280/400 [00:01<00:00, 268.87it/s]Upper bound on the fitting time: 77%|███████▋ | 307/400 [00:01<00:00, 266.56it/s]Upper bound on the fitting time: 84%|████████▎ | 334/400 [00:01<00:00, 265.09it/s]Upper bound on the fitting time: 90%|█████████ | 361/400 [00:01<00:00, 264.92it/s]Upper bound on the fitting time: 97%|█████████▋| 388/400 [00:01<00:00, 265.94it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:01<00:00, 269.86it/s]
Maximum number of iterations (400) reached in 1.5 seconds.
Last criterion = 5.4e-06 . Required tolerance = 1e-06
Fitting a PlnPCA model with 15 principal components.
Intializing parameters ...
Initialization finished.
Upper bound on the fitting time: 0%| | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time: 7%|▋ | 28/400 [00:00<00:01, 274.99it/s]Upper bound on the fitting time: 14%|█▍ | 56/400 [00:00<00:01, 272.72it/s]Upper bound on the fitting time: 21%|██ | 84/400 [00:00<00:01, 270.03it/s]Upper bound on the fitting time: 28%|██▊ | 112/400 [00:00<00:01, 270.25it/s]Upper bound on the fitting time: 35%|███▌ | 141/400 [00:00<00:00, 275.28it/s]Upper bound on the fitting time: 42%|████▏ | 169/400 [00:00<00:00, 274.59it/s]Upper bound on the fitting time: 49%|████▉ | 197/400 [00:00<00:00, 271.65it/s]Upper bound on the fitting time: 56%|█████▋ | 225/400 [00:00<00:00, 269.65it/s]Upper bound on the fitting time: 63%|██████▎ | 253/400 [00:00<00:00, 272.27it/s]Upper bound on the fitting time: 70%|███████ | 282/400 [00:01<00:00, 275.74it/s]Upper bound on the fitting time: 78%|███████▊ | 310/400 [00:01<00:00, 276.21it/s]Upper bound on the fitting time: 84%|████████▍ | 338/400 [00:01<00:00, 276.92it/s]Upper bound on the fitting time: 92%|█████████▏| 366/400 [00:01<00:00, 277.82it/s]Upper bound on the fitting time: 98%|█████████▊| 394/400 [00:01<00:00, 277.10it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:01<00:00, 274.42it/s]
Maximum number of iterations (400) reached in 1.5 seconds.
Last criterion = 5.4e-06 . Required tolerance = 1e-06
======================================================================
DONE!
Best model (lower BIC): rank 15
Best model(lower AIC): rank 15
======================================================================
Use the .show() method to explore insights about the optimal rank:
pcas.show()⚠️ Note: The best model typically correspond to the largest rank, which may not always be desirable.
The best model can be accessed using the .best_model() method. The selection criterion can be AIC, BIC, or ICL:
best_model = pcas.best_model(criterion="BIC")
print(best_model)A multivariate PlnPCA with 15 principal components.
======================================================================
Loglike Dimension Nb param BIC AIC ICL
-281457.88 500 8895 308104.9136 290352.875 299446.43
======================================================================
* Useful attributes
.latent_variables .latent_positions .coef .covariance .precision .model_parameters .latent_parameters .optim_details
* Useful methods
.transform() .show() .predict() .sigma() .projected_latent_variables() .plot_correlation_circle() .biplot() .viz() .pca_pairplot() .plot_expected_vs_true()
* Additional attributes for PlnPCA are:
None
* Additional methods for PlnPCA are:
None
All individual models in the collection can be accessed with the rank as the key:
pca_5 = pcas[5]
print(pca_5)A multivariate PlnPCA with 5 principal components.
======================================================================
Loglike Dimension Nb param BIC AIC ICL
-330752.12 500 3990 342705.0968 334742.125 339854.66
======================================================================
* Useful attributes
.latent_variables .latent_positions .coef .covariance .precision .model_parameters .latent_parameters .optim_details
* Useful methods
.transform() .show() .predict() .sigma() .projected_latent_variables() .plot_correlation_circle() .biplot() .viz() .pca_pairplot() .plot_expected_vs_true()
* Additional attributes for PlnPCA are:
None
* Additional methods for PlnPCA are:
None
You can also iterate through the collection:
for pca in pcas.values():
print(pca)A multivariate PlnPCA with 3 principal components.
======================================================================
Loglike Dimension Nb param BIC AIC ICL
-363315.75 500 2997 372293.9596 366312.75 370587.18
======================================================================
* Useful attributes
.latent_variables .latent_positions .coef .covariance .precision .model_parameters .latent_parameters .optim_details
* Useful methods
.transform() .show() .predict() .sigma() .projected_latent_variables() .plot_correlation_circle() .biplot() .viz() .pca_pairplot() .plot_expected_vs_true()
* Additional attributes for PlnPCA are:
None
* Additional methods for PlnPCA are:
None
A multivariate PlnPCA with 5 principal components.
======================================================================
Loglike Dimension Nb param BIC AIC ICL
-330752.12 500 3990 342705.0968 334742.125 339854.66
======================================================================
* Useful attributes
.latent_variables .latent_positions .coef .covariance .precision .model_parameters .latent_parameters .optim_details
* Useful methods
.transform() .show() .predict() .sigma() .projected_latent_variables() .plot_correlation_circle() .biplot() .viz() .pca_pairplot() .plot_expected_vs_true()
* Additional attributes for PlnPCA are:
None
* Additional methods for PlnPCA are:
None
A multivariate PlnPCA with 10 principal components.
======================================================================
Loglike Dimension Nb param BIC AIC ICL
-296651.25 500 6455 315988.7018 303106.25 310258.69
======================================================================
* Useful attributes
.latent_variables .latent_positions .coef .covariance .precision .model_parameters .latent_parameters .optim_details
* Useful methods
.transform() .show() .predict() .sigma() .projected_latent_variables() .plot_correlation_circle() .biplot() .viz() .pca_pairplot() .plot_expected_vs_true()
* Additional attributes for PlnPCA are:
None
* Additional methods for PlnPCA are:
None
A multivariate PlnPCA with 15 principal components.
======================================================================
Loglike Dimension Nb param BIC AIC ICL
-281457.88 500 8895 308104.9136 290352.875 299446.43
======================================================================
* Useful attributes
.latent_variables .latent_positions .coef .covariance .precision .model_parameters .latent_parameters .optim_details
* Useful methods
.transform() .show() .predict() .sigma() .projected_latent_variables() .plot_correlation_circle() .biplot() .viz() .pca_pairplot() .plot_expected_vs_true()
* Additional attributes for PlnPCA are:
None
* Additional methods for PlnPCA are:
None
For further details, print the model to explore its methods and attributes.