ratingness: Degrees of Rating Activity

Description Usage Arguments Details Author(s) Examples

Description

In recommender system data, some users are more active raters than others, i.e. they rate more items than do others. These simple functions facilitate taking "ratingness" into account, say as a covariate.

Usage

1
2
ratingness(ratingsIn,splitCol)
covratingness(ratingsIn,splitCol)

Arguments

ratingsIn

Input data frame. Within-row format is UserID, ItemID, Rating and optional covariates.

splitCol

Column to count ratings for – 1 for user ratings, 2 for item ratings.

Details

The fact that some users rate more items may be useful, say as a predictor. A typical usage of the latter is to call covratingness and then append the result to the input data frame.

Author(s)

Norm Matloff

Examples

1
2
3
4
5
6
7
rtin <- data.frame(uid = c(1,3,2,1,2),itemid = c(1,2,1,2,2), rats=c(2,5,3,5,1))
ratingness(rtin,1)  
# returns (2,2,1), meaning that user 1 submitted 2 ratings, etc.
> covratingness(rtin,1)
# returns a 5-element vector, corresponding to the 5 rows of rtin
rtin$nrats <- covratingness(rtin,1)
# now usable as a predictor

Pooja-Rajkumar/rectools documentation built on May 8, 2019, 2:56 p.m.