@Shareable @Immutable @DefaultProvider(value=GlobalAverageRatingBiasModelProvider.class) public class GlobalBiasModel extends java.lang.Object implements BiasModel, java.io.Serializable
Bias model that only uses a global bias.
Constructor and Description |
---|
GlobalBiasModel(double bias)
Construct a new global bias model.
|
Modifier and Type | Method and Description |
---|---|
double |
getIntercept()
Get the global bias (intercept).
|
double |
getItemBias(long item)
Get the item bias.
|
Long2DoubleMap |
getItemBiases()
Get the map of all known item biases.
|
Long2DoubleMap |
getItemBiases(LongSet items)
Get a set of item biases.
|
double |
getUserBias(long user)
Get the user bias.
|
Long2DoubleMap |
getUserBiases()
Get the map of all known user biases.
|
Long2DoubleMap |
getUserBiases(LongSet users)
Get a set of user biases.
|
public GlobalBiasModel(double bias)
Construct a new global bias model.
bias
- The global bias.public double getIntercept()
BiasModel
Get the global bias (intercept).
getIntercept
in interface BiasModel
public double getUserBias(long user)
BiasModel
Get the user bias.
getUserBias
in interface BiasModel
user
- The user ID.public double getItemBias(long item)
BiasModel
Get the item bias.
getItemBias
in interface BiasModel
item
- The item ID.public Long2DoubleMap getUserBiases(LongSet users)
BiasModel
Get a set of user biases.
getUserBiases
in interface BiasModel
users
- The users whose biases are to be returned.Long2DoubleMap.defaultReturnValue()
will be 0.public Long2DoubleMap getItemBiases(LongSet items)
BiasModel
Get a set of item biases.
getItemBiases
in interface BiasModel
items
- The items whose biases are to be returned.Long2DoubleMap.defaultReturnValue()
will be 0.public Long2DoubleMap getUserBiases()
BiasModel
Get the map of all known user biases.
getUserBiases
in interface BiasModel
public Long2DoubleMap getItemBiases()
BiasModel
Get the map of all known item biases.
getItemBiases
in interface BiasModel