@Shareable @DefaultProvider(value=RatingSummaryProvider.class) public class RatingSummary extends java.lang.Object implements java.io.Serializable
A summary of the ratings data.
Modifier and Type | Method and Description |
---|---|
static RatingSummary |
create(DataAccessObject dao)
Create a rating summary from a DAO.
|
double |
getGlobalMean() |
double |
getItemMean(long item)
Get the mean rating for an item.
|
Long2DoubleSortedArrayMap |
getItemOffets() |
double |
getItemOffset(long item)
Get the item’s average offset from global mean.
|
int |
getItemRatingCount(long item)
Get the number of ratings for the item.
|
LongSet |
getItems() |
public static RatingSummary create(DataAccessObject dao)
Create a rating summary from a DAO.
dao
- The events.public double getGlobalMean()
public LongSet getItems()
public double getItemMean(long item)
Get the mean rating for an item.
item
- The item.Double.NaN
if the item is absent.public double getItemOffset(long item)
Get the item’s average offset from global mean.
item
- The item.public int getItemRatingCount(long item)
Get the number of ratings for the item.
public Long2DoubleSortedArrayMap getItemOffets()