Skip to contents

Formula: score = sim(item profile, user profile)

Usage

ContRC(item_feat, user_profile, ratings = NULL, topn = 3)

Arguments

item_feat

An n_items x f matrix of item feature vectors.

user_profile

Either a length-f profile vector or a length-n_items rating vector (0 = unrated).

ratings

An explicit rating vector, or NULL.

topn

Length of the returned list.

Value

List with estimate, scores, ranking, recommended, profile, n_items, f, method.

Details

The user profile is the rating-weighted mean of the feature vectors of the items they liked, and every item is then scored by cosine similarity to it. A user who has rated exactly one item therefore has that item's feature vector as their profile, so the top recommendation is its nearest neighbour in feature space – the degenerate case that pins the weighting.

References

Pazzani & Billsus (2007), Content-Based Recommendation Systems, in The Adaptive Web, LNCS 4321:325-341.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
ContRC(V, V)
#> $estimate
#> [1] NaN
#> 
#> $scores
#> [1] 1 1 1 1 1 1 1 1
#> 
#> $ranking
#> [1] 0 1 2 3 4 5 6 7
#> 
#> $recommended
#> integer(0)
#> 
#> $profile
#> [1] 5.666667
#> 
#> $n_items
#> [1] 8
#> 
#> $f
#> [1] 1
#> 
#> $method
#> [1] "content-based recommendation"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"