How to use the cornac.models.recommender.Recommender.__init__ function in cornac

To help you get started, we’ve selected a few cornac examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PreferredAI / cornac / cornac / models / mcf / recom_mcf.py View on Github external
def __init__(self, k=5, max_iter=100, learning_rate=0.001, gamma=0.9, lamda=0.001, name="MCF",
                 trainable=True, verbose=False, init_params={}, seed=None):
        Recommender.__init__(self, name=name, trainable=trainable, verbose=verbose)
        self.k = k
        self.init_params = init_params
        self.max_iter = max_iter
        self.learning_rate = learning_rate
        self.gamma = gamma
        self.lamda = lamda

        self.ll = np.full(max_iter, 0)
        self.eps = 0.000000001
        self.U = self.init_params.get('U')  # matrix of user factors
        self.V = self.init_params.get('V')  # matrix of item factors
        self.Z = self.init_params.get('Z')  # matrix of Also-Viewed item factors
        self.seed = seed
github PreferredAI / cornac / cornac / models / mf / recom_mf.py View on Github external
def __init__(self, k=10, max_iter=20, learning_rate=0.01, lambda_reg=0.02, use_bias=True, early_stop=False,
                 verbose=False):
        Recommender.__init__(self, name='MF', verbose=verbose)

        self.k = k
        self.max_iter = max_iter
        self.learning_rate = learning_rate
        self.lambda_reg = lambda_reg
        self.use_bias = use_bias
        self.early_stop = early_stop
        self.fitted = False
github PreferredAI / cornac / cornac / models / pmf / recom_pmf.py View on Github external
def __init__(self, k=5, max_iter=100, learning_rate=0.001, gamma=0.9, lamda=0.001, name="PMF", variant='non_linear',
                 trainable=True, verbose=False, init_params={}, seed=None):
        Recommender.__init__(self, name=name, trainable=trainable, verbose=verbose)
        self.k = k
        self.init_params = init_params
        self.max_iter = max_iter
        self.learning_rate = learning_rate
        self.gamma = gamma
        self.lamda = lamda
        self.variant = variant

        self.ll = np.full(max_iter, 0)
        self.eps = 0.000000001
        self.U = self.init_params.get('U')  # matrix of user factors
        self.V = self.init_params.get('V')  # matrix of item factors
        self.seed = seed
github PreferredAI / cornac / cornac / models / coe / recom_coe.py View on Github external
def __init__(self, k=20, max_iter=100, learning_rate=0.05, lamda=0.001, batch_size=1000, name="coe", trainable=True,
                 verbose=False, init_params=None):
        Recommender.__init__(self, name=name, trainable=trainable, verbose=verbose)
        self.k = k
        self.init_params = init_params
        self.max_iter = max_iter
        self.name = name
        self.learning_rate = learning_rate
        self.lamda = lamda
        self.batch_size = batch_size

        self.U = init_params['U']  # matrix of user factors
        self.V = init_params['V']  # matrix of item factors
github PreferredAI / cornac / cornac / models / sorec / recom_sorec.py View on Github external
def __init__(self, name="SoRec", k=5, max_iter=100, learning_rate=0.001, lamda_c=10, lamda=0.001, gamma=0.9,
                 weight_link = True, trainable=True, verbose=False, init_params={}, seed=None):
        Recommender.__init__(self, name=name, trainable=trainable, verbose=verbose)
        self.k = k
        self.init_params = init_params
        self.max_iter = max_iter
        self.learning_rate = learning_rate
        self.lamda_c = lamda_c
        self.lamda = lamda
        self.gamma = gamma
        self.weight_link = weight_link

        self.ll = np.full(max_iter, 0)
        self.eps = 0.000000001
        self.U = self.init_params.get('U')  # matrix of user factors
        self.V = self.init_params.get('V')  # matrix of item factors
        self.Z = self.init_params.get('Z')  # matrix of social network factors
        self.seed = seed
github PreferredAI / cornac / cornac / models / skm / recom_skmeans.py View on Github external
def __init__(self, k=5, max_iter=100, name="Skmeans", trainable=True, tol=1e-6, verbose=True, init_par=None):
        Recommender.__init__(self, name=name, trainable=trainable, verbose=verbose)
        self.k = k
        self.init_par = init_par
        self.max_iter = max_iter
        self.tol = tol
        self.verbose = verbose
        self.centroids = None  # matrix of cluster centroids
github PreferredAI / cornac / cornac / models / c2pf / recom_c2pf.py View on Github external
def __init__(self, k=100, max_iter=100, variant='c2pf', name=None, trainable=True, verbose=False,
                 init_params={'G_s': None, 'G_r': None, 'L_s': None, 'L_r': None, 'L2_s': None, 'L2_r': None,
                              'L3_s': None, 'L3_r': None}):
        if name is None:
            Recommender.__init__(self, name=variant.upper(), trainable=trainable, verbose=verbose)
        else:
            Recommender.__init__(self, name=name, trainable=trainable, verbose=verbose)

        self.k = k
        self.init_params = init_params
        self.max_iter = max_iter

        self.ll = np.full(max_iter, 0)
        self.eps = 0.000000001
        self.Theta = None  # user factors
        self.Beta = None  # item factors
        self.Xi = None  # context factors Xi multiplied by context effects Kappa
        # self.aux_info = aux_info  # item-context matrix in the triplet sparse format: (row_id, col_id, value)
        self.variant = variant