Public methods
Method new()
creates Creates second order Factorization Machines model
Usage
FactorizationMachine$new(
  learning_rate_w = 0.2,
  rank = 4,
  lambda_w = 0,
  lambda_v = 0,
  family = c("binomial", "gaussian"),
  intercept = TRUE,
  learning_rate_v = learning_rate_w
)Arguments
- learning_rate_w
- learning rate for features intercations 
rankdimension of the latent dimensions which models features interactions
lambda_wregularization for features interactions
lambda_vregularization for features
familyone of "binomial", "gaussian"
interceptlogical, indicates whether or not include intecept to the model
learning_rate_vlearning rate for features
Method partial_fit()
fits/updates model
Usage
FactorizationMachine$partial_fit(x, y, weights = rep(1, length(y)), ...)
Arguments
- x
- input sparse matrix. Native format is - Matrix::RsparseMatrix.
If- xis in different format, model will try to convert it to- RsparseMatrixwith- as(x, "RsparseMatrix"). Dimensions should be (n_samples, n_features)
 
yvector of targets
weightsnumeric vector of length `n_samples`. Defines how to amplify SGD updates
for each sample. May be useful for highly unbalanced problems.
...not used at the moment
Method fit()
shorthand for applying `partial_fit` `n_iter` times
Usage
FactorizationMachine$fit(x, y, weights = rep(1, length(y)), n_iter = 1L, ...)
Arguments
- x
- input sparse matrix. Native format is - Matrix::RsparseMatrix.
If- xis in different format, model will try to convert it to- RsparseMatrixwith- as(x, "RsparseMatrix"). Dimensions should be (n_samples, n_features)
 
yvector of targets
weightsnumeric vector of length `n_samples`. Defines how to amplify SGD updates
for each sample. May be useful for highly unbalanced problems.
n_iternumber of SGD epochs
...not used at the moment
Method predict()
makes predictions based on fitted model
Usage
FactorizationMachine$predict(x, ...)
Arguments
- x
- input sparse matrix of shape (n_samples, n_featires) 
...not used at the moment
Method clone()
The objects of this class are cloneable with this method.
Usage
FactorizationMachine$clone(deep = FALSE)
Arguments
- deep
- Whether to make a deep clone.