Internal function running a single step of cross-validation for generalized matrix factorization (GMF) models and calculating some goodness-of-fit measures on the train and test sets.
sgdgmf.cv.step(
train,
test,
X,
Z,
family,
ncomp,
maxcomp,
fold,
nfolds,
weights,
offset,
method,
sampling,
penalty,
control.init,
control.alg,
control.cv
)
Returns a data.frame
containing the current number of latent factors
in the model (ncomp
), the fold identifier (fold
), the degrees of
freedom, i.e. the number of parameters, of the model (df
), the AIC, BIC
and deviance (respectively, aic
, bic
, dev
)
calculated on the train and test sets.
train-set matrix of responses (\(n \times m\))
test-set matrix of responses (\(n \times m\))
matrix of row fixed effects (\(n \times p\))
matrix of column fixed effects (\(q \times m\))
a glm
family (see family
for more details)
ranks of the latent matrix factorization used in cross-validation (default 1 to 10)
maximum rank allowed in the cross-validation exploration
integer number identifying the current fold
maximum number of folds in the cross-validation
an optional matrix of weights (\(n \times m\))
an optional matrix of offset values (\(n \times m\)), that specify a known component to be included in the linear predictor.
estimation method to minimize the negative penalized log-likelihood
sub-sampling strategy to use if method = "sgd"
list of penalty parameters (see set.penalty
for more details)
list of control parameters for the initialization (see set.control.init
for more details)
list of control parameters for the optimization (see set.control.alg
for more details)
list of control parameters for the cross-validation (see set.control.cv
for more details)