Skip to content

Commit

Permalink
Update model descriptions (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqtg authored Sep 18, 2019
1 parent 41ea714 commit c25e2a8
Show file tree
Hide file tree
Showing 10 changed files with 4,421 additions and 4,472 deletions.
1 change: 1 addition & 0 deletions cornac/models/cdl/recom_cdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class CDL(Recommender):
init_params: dictionary, optional, default: None
List of initial parameters, e.g., init_params = {'U':U, 'V':V}
U: ndarray, shape (n_users,k)
The user latent factors, optional initialization via init_params.
V: ndarray, shape (n_items,k)
Expand Down
5 changes: 4 additions & 1 deletion cornac/models/cdr/recom_cdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class CDR(Recommender):
init_params: dictionary, optional, default: None
List of initial parameters, e.g., init_params = {'U':U, 'V':V}
U: ndarray, shape (n_users,k)
The user latent factors, optional initialization via init_params.
V: ndarray, shape (n_items,k)
Expand All @@ -79,7 +80,9 @@ class CDR(Recommender):
seed: int, optional, default: None
Random seed for weight initialization.
Reference: Collaborative Deep Ranking: A Hybrid Pair-Wise Recommendation Algorithm with Implicit Feedback
References
----------
Collaborative Deep Ranking: A Hybrid Pair-Wise Recommendation Algorithm with Implicit Feedback
Ying H., Chen L., Xiong Y., Wu J. (2016)
"""
Expand Down
3 changes: 2 additions & 1 deletion cornac/models/ctr/recom_ctr.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


class CTR(Recommender):
"""Collaborative Topic Regression
"""Collaborative Topic Regression.
Parameters
----------
Expand Down Expand Up @@ -54,6 +54,7 @@ class CTR(Recommender):
init_params: dictionary, optional, default: None
List of initial parameters, e.g., init_params = {'U':U, 'V':V}
U: ndarray, shape (n_users,k)
The user latent factors, optional initialization via init_params.
V: ndarray, shape (n_items,k)
Expand Down
8,799 changes: 4,365 additions & 4,434 deletions cornac/models/efm/recom_efm.cpp

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions cornac/models/efm/recom_efm.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class EFM(Recommender):
use_item_aspect_popularity: boolean, optional, default: True
When False, item aspect frequency is omitted from item aspect quality computation formular.\
Specifically, :math:`Y_{ij} = 1 + \frac{N - 1}{1 + e^{-s_{ij}}}` if `p_i` is reviewed on feature `F_j`
Specifically, :math:`Y_{ij} = 1 + \\frac{N - 1}{1 + e^{-s_{ij}}}`
if :math:`p_i` is reviewed on feature :math:`F_j`
max_iter: int, optional, default: 100
Maximum number of iterations or the number of epochs.
Expand All @@ -95,7 +96,8 @@ class EFM(Recommender):
When True, running logs are displayed.
init_params: dictionary, optional, default: {}
List of initial parameters, e.g., init_params = {'U1':U1, 'U2':U2, 'V':V', H1':H1, 'H2':H2}
List of initial parameters, e.g., init_params = {'U1':U1, 'U2':U2, 'V':V, 'H1':H1, 'H2':H2}
U1: ndarray, shape (n_users, n_explicit_factors)
The user explicit factors, optional initialization via init_params.
U2: ndarray, shape (n_ratings, n_explicit_factors)
Expand All @@ -116,6 +118,7 @@ class EFM(Recommender):
Explicit factor models for explainable recommendation based on phrase-level sentiment analysis.
In Proceedings of the 37th international ACM SIGIR conference on Research & development in information retrieval (SIGIR '14).
ACM, New York, NY, USA, 83-92. DOI: https://doi.org/10.1145/2600428.2609579
"""

def __init__(self, name="EFM",
Expand Down
12 changes: 7 additions & 5 deletions cornac/models/mcf/recom_mcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ class MCF(Recommender):
pre-trained (U and V are not None).
item-affinity network: See "cornac/examples/mcf_office.py" for an example of how to use \
cornac's graph modality to load and provide the ``item-affinity network'' for MCF.
cornac's graph modality to load and provide the "item-affinity network" for MCF.
verbose: boolean, optional, default: False
When True, some running logs are displayed.
init_params: dictionary, optional, default: {}
List of initial parameters, e.g., init_params = {'U':U, 'V':V}. \
U: a csc_matrix of shape (n_users,k), containing the user latent factors. \
V: a csc_matrix of shape (n_items,k), containing the item latent factors. \
Z: a csc_matrix of shape (n_items,k), containing the ``Also-Viewed'' item latent factors.
List of initial parameters, e.g., init_params = {'U':U, 'V':V}.
U: a csc_matrix of shape (n_users,k), containing the user latent factors.
V: a csc_matrix of shape (n_items,k), containing the item latent factors.
Z: a csc_matrix of shape (n_items,k), containing the "Also-Viewed" item latent factors.
seed: int, optional, default: None
Random seed for parameters initialization.
Expand All @@ -67,6 +68,7 @@ class MCF(Recommender):
----------
* Park, Chanyoung, Donghyun Kim, Jinoh Oh, and Hwanjo Yu. "Do Also-Viewed Products Help User Rating Prediction?."\
In Proceedings of WWW, pp. 1113-1122. 2017.
"""

def __init__(self, k=5, max_iter=100, learning_rate=0.001, gamma=0.9, lamda=0.001, name="MCF",
Expand Down
17 changes: 11 additions & 6 deletions cornac/models/sorec/recom_sorec.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,27 @@ class SoRec(Recommender):
The name of the recommender model.
trainable: boolean, optional, default: True
When False, the model is not trained and Cornac assumes that the model already \
When False, the model is not trained and Cornac assumes that the model already
pre-trained (U, V and Z are not None).
verbose: boolean, optional, default: False
When True, some running logs are displayed.
init_params: dictionary, optional, default: {'U':None,'V':None}
List of initial parameters, e.g., init_params = {'U':U, 'V':V,'Z':Z}. \
U: a ndarray of shape (n_users,k), containing the user latent factors. \
V: a ndarray of shape (n_items,k), containing the item latent factors. \
Z: a ndarray of shape (n_users,k), containing the social network latent factors. \
init_params: dictionary, optional, default: {'U':None, 'V':None}
List of initial parameters, e.g., init_params = {'U':U, 'V':V, 'Z':Z}.
U: a ndarray of shape (n_users, k)
Containing the user latent factors.
V: a ndarray of shape (n_items, k)
Containing the item latent factors.
Z: a ndarray of shape (n_users, k)
Containing the social network latent factors.
References
----------
* H. Ma, H. Yang, M. R. Lyu, and I. King. SoRec:Social recommendation using probabilistic matrix factorization. \
CIKM ’08, pages 931–940, Napa Valley, USA, 2008.
"""

def __init__(self, name="SoRec", k=5, max_iter=100, learning_rate=0.001, lamda_c=10, lamda=0.001, gamma=0.9,
Expand Down
10 changes: 6 additions & 4 deletions cornac/models/vmf/recom_vmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ class VMF(Recommender):
When False, the model is not trained and Cornac assumes that the model is already \
pre-trained (The parameters of the model U, V, P, E are not None).
visual_features : See "cornac/examples/vmf_example.py" for an example of how to use \
cornac's visual modality to load and provide the ``item visual features'' for VMF.
visual_features: See "cornac/examples/vmf_example.py" for an example of how to use \
cornac's visual modality to load and provide the "item visual features" for VMF.
verbose: boolean, optional, default: False
When True, some running logs are displayed.
init_params: dictionary, optional, default: {}
List of initial parameters, e.g., init_params = {'U':U, 'V':V, 'P': P, 'E': E}. \
U: numpy array of shape (n_users,k), user latent factors. \
List of initial parameters, e.g., init_params = {'U':U, 'V':V, 'P': P, 'E': E}.
U: numpy array of shape (n_users,k), user latent factors.
V: numpy array of shape (n_items,k), item latent factors.
P: numpy array of shape (n_users,d), user visual latent factors.
E: numpy array of shape (d,c), embedding kernel matrix.
Expand All @@ -83,6 +84,7 @@ class VMF(Recommender):
----------
* Park, Chanyoung, Donghyun Kim, Jinoh Oh, and Hwanjo Yu. "Do Also-Viewed Products Help User Rating Prediction?."\
In Proceedings of WWW, pp. 1113-1122. 2017.
"""

def __init__(self, name="VMF", k=10, d=10, n_epochs=100, batch_size=100, learning_rate=0.001, gamma=0.9,
Expand Down
7 changes: 4 additions & 3 deletions cornac/models/wmf/recom_wmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ class WMF(Recommender):
The batch size for SGD.
trainable: boolean, optional, default: True
When False, the model is not trained and Cornac assumes that the model already
When False, the model is not trained and Cornac assumes that the model already
pre-trained (U and V are not None).
init_params: dictionary, optional, default: None
List of initial parameters, e.g., init_params = {'U':U, 'V':V}
U: ndarray, shape (n_users,k)
The user latent factors, optional initialization via init_params.
V: ndarray, shape (n_items,k)
Expand All @@ -67,10 +68,10 @@ class WMF(Recommender):
References
----------
* Hu, Y., Koren, Y., & Volinsky, C. (2008, December). Collaborative filtering for implicit feedback datasets.
* Hu, Y., Koren, Y., & Volinsky, C. (2008, December). Collaborative filtering for implicit feedback datasets. \
In 2008 Eighth IEEE International Conference on Data Mining (pp. 263-272).
* Pan, R., Zhou, Y., Cao, B., Liu, N. N., Lukose, R., Scholz, M., & Yang, Q. (2008, December).
* Pan, R., Zhou, Y., Cao, B., Liu, N. N., Lukose, R., Scholz, M., & Yang, Q. (2008, December). \
One-class collaborative filtering. In 2008 Eighth IEEE International Conference on Data Mining (pp. 502-511).
"""
Expand Down
32 changes: 16 additions & 16 deletions docs/source/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ VAE for Collaborative Filtering (VAECF)
:members:

Collaborative Variational Autoencoder (CVAE)
---------------------------------------
----------------------------------------------
.. automodule:: cornac.models.cvae.recom_cvae
:members:

Expand All @@ -46,12 +46,12 @@ Multi-Layer Perceptron (MLP)
:members:

Neural Matrix Factorization (NeuMF)
-----------------------------------------
----------------------------------------------
.. automodule:: cornac.models.ncf.recom_neumf
:members:

Online Indexable Bayesian Personalized Ranking (OIBPR)
-------------------------------------------------------
-----------------------------------------------------------
.. automodule:: cornac.models.online_ibpr.recom_online_ibpr
:members:

Expand All @@ -66,7 +66,7 @@ Collaborative Deep Ranking (CDR)
:members:

Collaborative Ordinal Embedding (COE)
-------------------------------------------------------
--------------------------------------------
.. automodule:: cornac.models.coe.recom_coe
:members:

Expand All @@ -86,17 +86,17 @@ Visual Bayesian Personalized Ranking (VBPR)
:members:

Collaborative Deep Learning (CDL)
---------------------------------------
---------------------------------------------
.. automodule:: cornac.models.cdl.recom_cdl
:members:

Hierarchical Poisson Factorization (HPF)
----------------------------------------
--------------------------------------------
.. automodule:: cornac.models.hpf.recom_hpf
:members:

Explicit Factor Model (EFM)
----------------------------------------
--------------------------------------------
.. automodule:: cornac.models.efm.recom_efm
:members:

Expand All @@ -106,47 +106,47 @@ Social Bayesian Personalized Ranking (SBPR)
:members:

Hidden Factors and Hidden Topics (HFT)
-----------------------------------------
---------------------------------------------
.. automodule:: cornac.models.hft.recom_hft
:members:

Collaborative Topic Modeling (CTR)
---------------------------------------
-------------------------------------------
.. automodule:: cornac.models.ctr.recom_ctr
:members:

Baseline Only
----------------------------------------
---------------------------------------------------
.. autoclass:: cornac.models.baseline_only.recom_bo
:members:

Bayesian Personalized Ranking (BPR)
----------------------------------------
----------------------------------------------
.. autoclass:: cornac.models.bpr.recom_bpr.BPR
:members:

Matrix Factorization (MF)
----------------------------------------
------------------------------------------
.. automodule:: cornac.models.mf.recom_mf
:members:

Non-negative Matrix Factorization (NMF)
-----------------------------------------
--------------------------------------------
.. automodule:: cornac.models.nmf.recom_nmf
:members:

Probabilitic Matrix Factorization (PMF)
-----------------------------------------
--------------------------------------------
.. automodule:: cornac.models.pmf.recom_pmf
:members:

Singular Value Decomposition (SVD)
-----------------------------------------
-------------------------------------------
.. automodule:: cornac.models.svd.recom_svd
:members:

Social Recommendation using PMF (SoRec)
-----------------------------------------
------------------------------------------------
.. automodule:: cornac.models.sorec.recom_sorec
:members:

Expand Down

0 comments on commit c25e2a8

Please sign in to comment.