<!--
%\VignetteEngine{knitr::knitr}
%\VignetteIndexEntry{Simon Funk's SVD}
-->

## Simon Funk's Matrix Factorization

We implemented the well-known matrix factorization algorithm as proposed by Simon Funk. 

Matrix factorization methods are used in recommender systems to derive a set of latent factors, from the original user-item rating matrix, to characterize both users and items by these vectors of user and item factors. The user-item interaction is modeled as the inner product of the latent factors space. Accordingly each item i will be associated with a vector factor V_i, and each user u is associated with a vector factors U_u. An approximation of the rating of a user $u$ on an item $i$ can be derived as the 
inner product of their item and user factor vectors.

The rrecsys package utilizes a stochastic gradient descent optimization technique for computing the item and user factors. The U(user) and V(item) factor matrices are cropped to k features.  Each feature is trained until convergence. 

For the Rating Prediction task, to train a model with this algorithm, it is required to define an additional argument, _k_ the number of user/item factors.
```{r, eval=FALSE}
data("ml100k")
d <- defineData(ml100k)
e <- evalModel(d, folds = 2)
mf_model <- evalPred(e, "funk", k = 10, steps = 100, regCoef = 0.0001, learningRate = 0.001, biases = F)
mf_model
```
For the Item Recommendation task, to provide item recommendations, it is required to define two additional arguments, _positiveThreshold_  the threshold for "positive" ratings, and the _topN_ the number of recommended items.
 
```{r,eval=FALSE}
data("ml100k")
d <- defineData(ml100k)
e <- evalModel(d, folds = 2)
mf <-  evalRec(e, "funk", k = 10, steps = 100, regCoef = 0.0001, learningRate = 0.001, biases = F, positiveThreshold = 3, topN = 3)
mf
```


The _k_ default value is 10.
The _positiveThreshold_ default value is 3.
The _topN_ default value is 3.
The _learningRate_ default value is 0.001.
The _regCoef_ default value is 0.0001.
The _steps_ default value is 10.




<!-- _k_ is he number of features, _regCoef_ the regularization term and _learningRate_ the learning rate. 

% The returned object is of type _SVDclass_. 

% To get more details about the slots read the reference [manual](https://CRAN.R-project.org/package=rrecsys).
-->

