Skip to content

Commit

Permalink
Some doc on Reader and MF alsgo
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug committed Jan 7, 2018
1 parent a997313 commit 164bb17
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ TODO
* Make all fit methods (for algo and GridSearch) return self. Update docs on
building custom algorithms, and on getting started -> gridsearch (add
example?).
* Update doc of MF algo to indicate how to retrieve latent factors.

* check conda forge
* make some filtering dataset tools, like remove users/items with less/more
than n ratings, binarize a dataset, etc...
* check conda forge
* Allow incremental updates for some algorithms

Done:
-----

* Update doc of MF algo to indicate how to retrieve latent factors.
* all algorithms using random initialization now have a random_state parameter.
* CV iterators:
- Write basic CV iterators
Expand Down
32 changes: 32 additions & 0 deletions surprise/prediction_algorithms/matrix_factorization.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ class SVD(AlgoBase):
RNG. If ``None``, the current RNG from numpy is used. Default is
``None``.
verbose: If ``True``, prints the current epoch. Default is ``False``.
Attributes:
pu(numpy array of size (n_users, n_factors)): The user factors (only
exists if ``fit()`` has been called)
qi(numpy array of size (n_items, n_factors)): The item factors (only
exists if ``fit()`` has been called)
bu(numpy array of size (n_users)): The user biases (only
exists if ``fit()`` has been called)
bi(numpy array of size (n_items)): The item biases (only
exists if ``fit()`` has been called)
"""

def __init__(self, n_factors=100, n_epochs=20, biased=True, init_mean=0,
Expand Down Expand Up @@ -341,6 +351,18 @@ class SVDpp(AlgoBase):
RNG. If ``None``, the current RNG from numpy is used. Default is
``None``.
verbose: If ``True``, prints the current epoch. Default is ``False``.
Attributes:
pu(numpy array of size (n_users, n_factors)): The user factors (only
exists if ``fit()`` has been called)
qi(numpy array of size (n_items, n_factors)): The item factors (only
exists if ``fit()`` has been called)
yj(numpy array of size (n_items, n_factors)): The (implicit) item
factors (only exists if ``fit()`` has been called)
bu(numpy array of size (n_users)): The user biases (only
exists if ``fit()`` has been called)
bi(numpy array of size (n_items)): The item biases (only
exists if ``fit()`` has been called)
"""

def __init__(self, n_factors=20, n_epochs=20, init_mean=0, init_std_dev=.1,
Expand Down Expand Up @@ -556,6 +578,16 @@ class NMF(AlgoBase):
RNG. If ``None``, the current RNG from numpy is used. Default is
``None``.
verbose: If ``True``, prints the current epoch. Default is ``False``.
Attributes:
pu(numpy array of size (n_users, n_factors)): The user factors (only
exists if ``fit()`` has been called)
qi(numpy array of size (n_items, n_factors)): The item factors (only
exists if ``fit()`` has been called)
bu(numpy array of size (n_users)): The user biases (only
exists if ``fit()`` has been called)
bi(numpy array of size (n_items)): The item biases (only
exists if ``fit()`` has been called)
"""

def __init__(self, n_factors=15, n_epochs=50, biased=False, reg_pu=.06,
Expand Down
4 changes: 3 additions & 1 deletion surprise/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class Reader():
Accepted values are 'ml-100k', 'ml-1m', and 'jester'. Default
is ``None``.
line_format(:obj:`string`): The fields names, in the order at which
they are encountered on a line. Default is ``'user item rating'``.
they are encountered on a line. Please note that ``line_format`` is
always space-separated (use the ``sep`` parameter). Default is
``'user item rating'``.
sep(char): the separator between fields. Example : ``';'``.
rating_scale(:obj:`tuple`, optional): The rating scale used for every
rating. Default is ``(1, 5)``.
Expand Down

0 comments on commit 164bb17

Please sign in to comment.