tensortools.cp_als(X, rank, random_state=None, init='randn', **options)¶Fits CP Decomposition using the Alternating Least Squares (ALS).
| Parameters: |
|
|---|---|
| Returns: | result – Object which holds the fitted results. It provides the factor matrices
in form of a KTensor, |
| Return type: | FitResult instance |
Notes
This implemenation uses the Alternating Least Squares Method.
References
Kolda, T. G. & Bader, B. W. “Tensor Decompositions and Applications.” SIAM Rev. 51 (2009): 455-500 http://epubs.siam.org/doi/pdf/10.1137/07070111X
Comon, Pierre & Xavier Luciani & Andre De Almeida. “Tensor decompositions, alternating least squares and other tales.” Journal of chemometrics 23 (2009): 393-405. http://onlinelibrary.wiley.com/doi/10.1002/cem.1236/abstract
Examples
`
import tensortools as tt
I, J, K, R = 20, 20, 20, 4
X = tt.randn_tensor(I, J, K, rank=R)
tt.cp_als(X, rank=R)
`