高祖功臣侯者年表:萧丞相世家——FM 算法

线性模型

\[y=\omega_{0}+\sum_{i=1}^{n} \omega_{i} x_{i} \]

二阶多项式模型

\[y=\omega_{0}+\sum_{i=1}^{n} \omega_{i} x_{i}+\sum_{i=1}^{n-1} \sum_{j=i+1}^{n} \omega_{i j} x_{i} x_{j} \]

FM 求解

\[\mathbf{V}=\left(\begin{array}{cccc}{v_{11}} & {v_{12}} & {\cdots} & {v_{1 k}} \\ {v_{21}} & {v_{22}} & {\cdots} & {v_{2 k}} \\ {\vdots} & {\vdots} & {} & {\vdots} \\ {v_{n 1}} & {v_{n 2}} & {\cdots} & {v_{n k}}\end{array}\right)_{n \times k}=\left(\begin{array}{c}{\mathbf{v}_{1}} \\ {\mathbf{v}_{2}} \\ {\vdots} \\ {\mathbf{v}_{n}}\end{array}\right) \]

\[\mathbf{\hat { W}}=\mathbf{V V}^{T}=\left(\begin{array}{c}{\mathbf{v}_{1}} \\ {\mathbf{v}_{2}} \\ {\vdots} \\ {\mathbf{v}_{n}}\end{array}\right)\left(\begin{array}{cccc}{\mathbf{v}_{1}} & {\mathbf{v}_{2}^{T}} & {\cdots} & {\mathbf{v}_{n}^{T}}\end{array}\right) \]

根据 \[a b+a c+b c=\frac{1}{2}\left[(a+b+c)^{2}-\left(a^{2}+b^{2}+c^{2}\right)\right] \]

\[\begin{aligned} & \sum_{f=1}^{n-1} \sum_{j=i+1}^{n}\left\langle\mathbf{v}_{i}, \mathbf{v}_{j}\right\rangle x_{i} x_{j} \\=& \frac{1}{2} \sum_{i=1}^{n} \sum_{j=1}^{n}\left\langle\mathbf{v}_{i}, \mathbf{v}_{j}\right\rangle x_{i} x_{j}-\frac{1}{2} \sum_{i=1}^{n}\left\langle\mathbf{v}_{i}, \mathbf{v}_{i}\right\rangle x_{i} x_{i} \\=& \frac{1}{2}\left(\sum_{i=1}^{n} \sum_{j=1}^{n} \sum_{f=1}^{n} v_{i, f} x_{i}\right)\left(\sum_{j=1}^{n} v_{j, f} x_{j}\right)-\sum_{i=1}^{n} v_{i, f}^{2} x_{i}^{2} ) \\=& \frac{1}{2} \sum_{f=1}^{k}\left(\left(\sum_{i=1}^{n} v_{i, f} x_{i}\right)^{2}-\sum_{i=1}^{n} v_{i, f}^{2} x_{i}^{2}\right) \end{aligned} \]