FFM Classifier
Field-aware Factorization Machine1 for binary classification.
The model equation is defined by:
Where is the latent vector corresponding to feature for field, and is the latent vector corresponding to feature for field.
$$ \sum_{f1=1}^{F} \sum_{f2=f1+1}^{F} \mathbf{w_{i1}} \cdot \mathbf{w_{i2}}, \text{where } i1 = \Phi(v_{f1}, f1, f2), \quad i2 = \Phi(v_{f2}, f2, f1), $$
Our implementation automatically applies MinMax scaling to the inputs, use normal distribution for latent initialization and logarithm loss for optimization.
Parameters
-
n_factors(
int
, Default:10
) → Dimensionality of the factorization or number of latent factors. -
l1_weight(
int
, Default:0.0
) → Amount of L1 regularization used to push weights towards 0. -
l2_weight(
int
, Default:0.0
) → Amount of L2 regularization used to push weights towards 0. -
l1_latent(
int
, Default:0.0
) → Amount of L1 regularization used to push latent weights towards 0. -
l2_latent(
int
, Default:0.0
) → Amount of L2 regularization used to push latent weights towards 0. -
intercept(
int
, Default:0.0
) → Initial intercept value. -
intercept_lr(
float
, Default:0.01
) → Learning rate scheduler used for updating the intercept. No intercept will be used if this is set to 0. -
clip_gradient(Default:
1000000000000.0
) → Clips the absolute value of each gradient value.
Example Usage
We can create an instance of the FFM model like this.
import turboml as tb
ffm_model = tb.FFMClassifier()
Footnotes
-
Juan, Y., Zhuang, Y., Chin, W.S. and Lin, C.J., 2016, September. Field-aware factorization machines for CTR prediction. In Proceedings of the 10th ACM Conference on Recommender Systems (pp. 43-50). ↩