org.lenskit.data.ratings

## Interface RatingVectorPDAO

• All Known Implementing Classes:
AbstractRatingVectorPDAO, CountSumRatingVectorPDAO, EntityCountRatingVectorPDAO, StandardRatingVectorPDAO

@DefaultImplementation(value=StandardRatingVectorPDAO.class)
public interface RatingVectorPDAO

Proxy DAO for user ‘rating vectors’, which are mappings of items to user preference. This is used to access use ratings, or to transform other types of data into something that looks like a rating vector.

This DAO interface is generally proxy DAO: that is, it provides a different view of data typically implemented on top of the base DataAccessObject interface. However, an application can specialize it with some other kind of optimized implementation if desired; for example, if user rating vectors are stored in a Redis cache.

• ### Method Summary

All Methods
Modifier and Type Method and Description
ObjectStream<IdBox<Long2DoubleMap>> streamUsers()
Stream all users in the data set.
Long2DoubleMap userRatingVector(long user)
Get a user’s rating vector.
• ### Method Detail

• #### userRatingVector

@Nonnull
Long2DoubleMap userRatingVector(long user)

Get a user’s rating vector.

Parameters:
user - The rating vector summarizing a user’s historical preferences.
Returns:
The unnormmalized user rating vector. Will return an empty vector for nonexistent users.
• #### streamUsers

ObjectStream<IdBox<Long2DoubleMap>> streamUsers()

Stream all users in the data set.

Returns:
A stream over the users in the data set.