Description
I'm getting some pretty bad results using WRMF
with the Cholesky solver.
I tried doing a reproducible experiment as follows:
- Took the LastFM360k data.
- Set the first 357k users as train, rest ~1800 as test.
- Fit a
WRMF
model withk=40
andlambda=1
and 10 iterations. - Calculated factors and top-5 predictions for the test users.
- Calculated hit rate at 5 for them.
And got the following results:
- CG: 0.4441335
- Cholesky: 0.4179763
Which is certainly not what I'd expect as the Cholesky is a more exact method and should lead to better results. Using different random seeds did not result in any significant change.
I additionally see a strange behavior with the timings:
- CG: ~21s
- Chol: ~32s
According to the reference paper Applications of the conjugate gradient method for implicit feedback collaborative filtering, the Cholesky solver in this case should take close to 3x longer than the CG one. I did the same experiment with this package and got the expected results: Cholesky takes 3x longer and gets a better end result:
- CG: ~23s | 0.4501615
- Chol: ~64s | 0.4512379
Tried playing with the armadillo option arma::solve_opts::fast
, changing it to something more exact, but it didn't make any difference in the HR@5 metric.
I'm not familiar with armadillo but I suspect this line is incorrect:
arma::Mat<T> inv = XtX + X_nnz.each_row() % (confidence.t() - 1) * X_nnz.t();
Since it's doing an operation per row, whereas it should be doing rank-1 updates.