@DefaultProvider(value=LeastSquaresItemScorer.Builder.class) @Shareable public class LeastSquaresItemScorer extends AbstractItemScorer implements Serializable
Baseline scorer using least-squares estimates of preferences, trained by gradient descent.
Modifier and Type | Class and Description |
---|---|
static class |
LeastSquaresItemScorer.Builder
The builder for the least squares predictor.
|
Constructor and Description |
---|
LeastSquaresItemScorer(Long2DoubleMap ubs,
Long2DoubleMap ibs,
double mean)
Construct a new least-squares scorer.
|
Modifier and Type | Method and Description |
---|---|
ResultMap |
scoreWithDetails(long user,
Collection<Long> items)
Score a collection of items and potentially return more details on the scores.
|
score, score
public LeastSquaresItemScorer(Long2DoubleMap ubs, Long2DoubleMap ibs, double mean)
Construct a new least-squares scorer.
ubs
- the user biasesibs
- the item biasesmean
- the global mean rating@Nonnull public ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items)
ItemScorer
Score a collection of items and potentially return more details on the scores.
scoreWithDetails
in interface ItemScorer
user
- The user ID for whom to generate scores.items
- The item to score.ResultMap
that provides access to those details.