sgdgmf.cv.step {sgdGMF} | R Documentation |
Single step of cross-validation for generalized matrix factorization models
Description
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.
Usage
sgdgmf.cv.step(
train,
test,
X,
Z,
family,
ncomp,
maxcomp,
fold,
nfolds,
weights,
offset,
method,
sampling,
penalty,
control.init,
control.alg,
control.cv
)
Arguments
train |
train-set matrix of responses ( |
test |
test-set matrix of responses ( |
X |
matrix of row fixed effects ( |
Z |
matrix of column fixed effects ( |
family |
a |
ncomp |
ranks of the latent matrix factorization used in cross-validation (default 1 to 10) |
maxcomp |
maximum rank allowed in the cross-validation exploration |
fold |
integer number identifying the current fold |
nfolds |
maximum number of folds in the cross-validation |
weights |
an optional matrix of weights ( |
offset |
an optional matrix of offset values ( |
method |
estimation method to minimize the negative penalized log-likelihood |
sampling |
sub-sampling strategy to use if |
penalty |
list of penalty parameters (see |
control.init |
list of control parameters for the initialization (see |
control.alg |
list of control parameters for the optimization (see |
control.cv |
list of control parameters for the cross-validation (see |
Value
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.