Fits a CP model to data with a weight (indicator) tensor by minimizing
||W * (X - K)||^2, mirroring the MATLAB Tensor Toolbox cp_wopt. Use a
0/1 weight tensor to fit in the presence of missing entries.
Arguments
- X
A Tensor or array-like object (missing entries may hold any value, typically 0).
- W
A weight tensor of the same dimensions as
X(commonly 0/1).- R
Target CP rank.
- init
"random"or a list of initial factor matrices.- maxiters
Maximum optimizer iterations (default
500).- factr
optimL-BFGS-Bfactrconvergence parameter.- printitn
If positive, print the optimizer trace.