@DefaultImplementation(value=DotProductKernel.class) public interface BiasedMFKernel
A kernel for biased matrix factorization. This function combines a user-item bias (baseline score) and the user- and item-factor vectors to make a final score.
Note that not all kernels are compatible with all model build strategies.
Kernels should be serializable and shareable.
Modifier and Type | Method and Description |
---|---|
double |
apply(double bias,
org.apache.commons.math3.linear.RealVector user,
org.apache.commons.math3.linear.RealVector item)
Apply the kernel function.
|
double apply(double bias, @Nonnull org.apache.commons.math3.linear.RealVector user, @Nonnull org.apache.commons.math3.linear.RealVector item)
Apply the kernel function.
bias
- The combined user-item bias term (the baseline score, usually).user
- The user-factor vector.item
- The item-factor vector.IllegalArgumentException
- if the user and item vectors have different lengths.