topN.new: Rank top-N highest-predicted items for a new user

Description Usage Arguments Details Value See Also

Description

Rank top-N highest-predicted items for a new user

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
topN.new(
  model,
  X,
  n = 10,
  include = NULL,
  exclude = NULL,
  output_score = FALSE,
  l2_reg = model$l2_reg,
  l1_reg = model$l1_reg,
  weight_mult = model$weight_mult,
  maxupd = model$maxupd
)

Arguments

model

A Poisson factorization model as returned by 'poismf'.

X

Data with the non-zero item indices and counts for this new user. Can be passed as a sparse vector from package 'Matrix' ('Matrix::dsparseVector', which can be created from indices and values through 'Matrix::sparseVector'), or as a 'data.frame', in which case will take the first column as the item/column indices (numeration starting at 1) and the second column as the counts. If 'X' passed to 'poismf' was a 'data.frame', 'X' here must also be a 'data.frame'.

n

Number of top-N highest-predicted results to output.

include

List of items which will be ranked. If passing this, will only make a ranking among these items. If 'X' passed to 'poismf' was a 'data.frame', must match with the entries in its second column, otherwise should match with the columns of 'X' (numeration starting at 1). Can only pass one of 'include' or 'exclude.' Must not contain duplicated entries.

exclude

List of items to exclude from the ranking. If passing this, will rank all the items except for these. If 'X' passed to 'poismf' was a 'data.frame', must match with the entries in its second column, otherwise should match with the columns of 'X' (numeration starting at 1). Can only pass one of 'include' or 'exclude'. Must not contain duplicated entries.

output_score

Whether to output the scores in addition to the IDs. If passing 'FALSE', will return a single array with the item IDs, otherwise will return a list with the item IDs and the scores.

l2_reg

Strength of L2 regularization to use for optimizing the new factors.

l1_reg

Strength of the L1 regularization. Not recommended.

weight_mult

Weight multiplier for the positive entries over the missing entries.

maxupd

Maximum number of Newton-CG updates to perform. You might want to increase this value depending on the use-case.

Details

This function calculates the latent factors in the same way as 'factors.single' - see the documentation of factors.single for details.

The factors are initialized to the mean of each column in the fitted model.

Value

See Also

factors.single topN


poismf documentation built on Jan. 13, 2021, 6:46 a.m.

Related to topN.new in poismf...