こんにちは、リブセンスで統計や機械学習関係の仕事をしている北原です。今回はレコメンデーションにも使えるFactorization Machines(FM)の効率的な学習アルゴリズムの紹介です。実装にはJuliaを使います。 実務で必要な要件を満たす機械学習ライブラリがなくて、機械学習モデルをカスタマイズすることってありますよね。最近はTensorFlowのような機械学習フレームワークが充実してきたので、そういう場合にはこれらのフレームワークを利用することが多いかもしれません。しかし、アルゴリズムによっては、フルスクラッチで実装することで大幅に効率化できるものもあります。今回扱うFMのAlternating Least Squares(ALS) はその一例です。そこで使われている効率化方法は実装が簡単でギブスサンプリングなどでも使うことができる便利なものなのですが、あまり知られていないようで