Nonnegative CP Tensor Decomposition by Heirarchical Alternating Least Squares (HALS)

tensortools.ncp_hals(X, rank, random_state=None, init='rand', **options)

Fits nonnegtaive CP Decomposition using the Hierarcial Alternating Least Squares (HALS) Method.

Parameters:
  • X ((I_1, .., I_N) array_like) – A real array with nonnegative entries and X.ndim >= 3.
  • rank (integer) – The rank sets the number of components to be computed.
  • random_state (integer, RandomState instance or None, optional (default None)) – If integer, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.
  • init (str, or KTensor, optional (default 'rand').) – Specifies initial guess for KTensor factor matrices. If 'randn', Gaussian random numbers are used to initialize. If 'rand', uniform random numbers are used to initialize. If KTensor instance, a copy is made to initialize the optimization.
  • options (dict, specifying fitting options.) –
    tol : float, optional (default tol=1E-5)
    Stopping tolerance for reconstruction error.
    max_iter : integer, optional (default max_iter = 500)
    Maximum number of iterations to perform before exiting.
    min_iter : integer, optional (default min_iter = 1)
    Minimum number of iterations to perform before exiting.
    max_time : integer, optional (default max_time = np.inf)
    Maximum computational time before exiting.
    verbose : bool {'True', 'False'}, optional (default verbose=True)
    Display progress.
Returns:

result – Object which holds the fitted results. It provides the factor matrices in form of a KTensor, result.factors.

Return type:

FitResult instance

Notes

This implemenation is using the Hierarcial Alternating Least Squares Method.

References

Cichocki, Andrzej, and P. H. A. N. Anh-Huy. “Fast local algorithms for large scale nonnegative matrix and tensor factorizations.” IEICE transactions on fundamentals of electronics, communications and computer sciences 92.3: 708-721, 2009.

Examples