tensorly.decomposition.randomised_parafac

randomised_parafac(tensor, rank, n_samples, n_iter_max=100, init='random', svd='truncated_svd', tol=1e-08, max_stagnation=20, return_errors=False, random_state=None, verbose=0, callback=None)[source]

Randomised CP decomposition via sampled ALS [3]

Parameters:
tensorndarray
rankint

number of components

n_samplesint

number of samples per ALS step

n_iter_maxint

maximum number of iteration

init{‘svd’, ‘random’}, optional
svdstr, default is ‘truncated_svd’

function to use to compute the SVD, acceptable values in tensorly.SVD_FUNS

tolfloat, optional

tolerance: the algorithm stops when the variation in the reconstruction error is less than the tolerance

max_stagnation: int, optional, default is 0

if not zero, the maximum allowed number of iterations with no decrease in fit

random_state{None, int, np.random.RandomState}, default is None
return_errorsbool, default is False

if True, return a list of all errors

verboseint, optional, default is 0

level of verbosity

Returns:
factorsndarray list

list of positive factors of the CP decomposition element i is of shape (tensor.shape[i], rank)

References

[3]

Casey Battaglino, Grey Ballard and Tamara G. Kolda, “A Practical Randomized CP Tensor Decomposition”,