flipLoadings {parafac4microbiome} | R Documentation |
Sign flip the loadings of many randomly initialized models to make consistent overview plots.
flipLoadings(models, X)
models |
Output of parafac. |
X |
Input dataset of parafac modelling procedure. |
models with sign flipped components where applicable.
A = array(rnorm(108*2), c(108,2))
B = array(rnorm(100*2), c(100,2))
C = array(rnorm(10*2), c(10,2))
X = reinflateTensor(A, B, C)
models = parafac(X, 2, nstart=10, output="all", sortComponents=TRUE)
flippedModels = flipLoadings(models, X)