dSVD {dcTensor}R Documentation

Discretized Gradient Descent Singular Value Decomposition (dSVD)

Description

The input data is assumed to be a matrix. dSVD decompose the matrix to two low-dimensional factor matices.

Usage

dSVD(X, M=NULL, pseudocount=.Machine$double.eps,
    initU=NULL, initV=NULL, fixU=FALSE, fixV=FALSE,
    Ter_U=1e-10, L1_U=1e-10, L2_U=1e-10, eta=1e+10, J = 3,
    thr = 1e-10, num.iter = 100,
    viz = FALSE, figdir = NULL, verbose = FALSE)

Arguments

X

The input matrix which has N-rows and M-columns.

M

The mask matrix which has N-rows and M-columns. If the input matrix has missing values, specify the element as 0 (otherwise 1).

pseudocount

The pseudo count to avoid zero division, when the element is zero (Default: Machine Epsilon).

initU

The initial values of factor matrix U, which has N-rows and J-columns (Default: NULL).

initV

The initial values of factor matrix V, which has M-rows and J-columns (Default: NULL).

fixU

Whether the factor matrix U is updated in each iteration step (Default: FALSE).

fixV

Whether the factor matrix V is updated in each iteration step (Default: FALSE).

Ter_U

Paramter for terary (0,1,2) regularitation (Default: 1e-10).

L1_U

Paramter for L1 regularitation (Default: 1e-10). This also works as small positive constant to prevent division by zero, so should be set as 0.

L2_U

Paramter for L2 regularitation (Default: 1e-10).

eta

Stepsize of gradient descent algorithm (Default: 1e+10).

J

The number of low-dimension (J < N, M, Default: 3)

thr

When error change rate is lower than thr, the iteration is terminated (Default: 1E-10).

num.iter

The number of interation step (Default: 100).

viz

If viz == TRUE, internal reconstructed matrix can be visualized.

figdir

The directory for saving the figure, when viz == TRUE.

verbose

If verbose == TRUE, Error change rate is generated in console window.

Value

U : A matrix which has N-rows and J-columns (J < N, M). V : A matrix which has M-rows and J-columns (J < N, M). RecError : The reconstruction error between data tensor and reconstructed tensor from U and V. TrainRecError : The reconstruction error calculated by training set (observed values specified by M). TestRecError : The reconstruction error calculated by test set (missing values specified by M). RelChange : The relative change of the error.

Author(s)

Koki Tsuyuzaki

Examples

# Test data
matdata <- toyModel(model = "dSVD")

# Simple usage
out <- dSVD(matdata, J=2, num.iter=2)

[Package dcTensor version 1.2.0 Index]