Public methods
Method new()
create PureSVD model
Usage
PureSVD$new(
rank = 10L,
lambda = 0,
init = NULL,
preprocess = identity,
method = c("svd", "impute"),
...
)
Arguments
rank
size of the latent dimension
lambda
regularization parameter
init
initialization of item embeddings
preprocess
identity()
by default. User spectified function which will
be applied to user-item interaction matrix before running matrix factorization
(also applied during inference time before making predictions).
For example we may want to normalize each row of user-item matrix to have 1 norm.
Or apply log1p()
to discount large counts.
method
type of the solver for initialization of the orthogonal
basis. Original paper uses SVD. See paper for details.
...
not used at the moment
Method fit_transform()
performs matrix factorization
Usage
PureSVD$fit_transform(x, n_iter = 100L, convergence_tol = 0.001, ...)
Arguments
x
input sparse user-item matrix(of class dgCMatrix
)
n_iter
maximum number of iterations
convergence_tol
numeric = -Inf
defines early stopping strategy.
Stops fitting when one of two following conditions will be satisfied: (a) passed
all iterations (b) relative change of Frobenious norm of the two consequent solution
is less then provided convergence_tol
.
...
not used at the moment
Method transform()
calculates user embeddings for the new input
Usage
PureSVD$transform(x, ...)
Arguments
x
input matrix
...
not used at the moment
Method clone()
The objects of this class are cloneable with this method.
Usage
PureSVD$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.