FactorizationMachines.jl
Factorization Machines for Julia
Install / Use
/learn @btwardow/FactorizationMachines.jlREADME
FactorizationMachines.jl
[
](https://coveralls.io/github/btwardow/FactorizationMachines.jl?
branch=master)
Implementation of Factorization Machines for Julia.
As author describes:
FMs combine the high-prediction accuracy of factorization models with the flexibility of feature engineering. The input data for FMs is described with real-valued features, exactly like in other machine-learning approaches such as linear regression, support vector machines, etc. However, the internal model of FMs uses factorized interactions between variables, and thus, it shares with other factorization models the high prediction quality in sparse settings, like in recommender systems. It has been shown that FMs can mimic most factorization models just by feature engineering [Rendle 2010]
Steffen Rendle (2012): Factorization Machines with libFM, in ACM Trans. Intell. Syst. Technol., 3(3), May. [PDF]
Implementation is mostly based on libfm software and try to be compatible with conventions used there.
Usage
Simple recommendation example
using FactorizationMachines
T = [
5 1 0 1 0 0 0 1 0 0 12.5;
5 1 0 0 1 0 0 1 0 0 20;
4 1 0 0 0 1 0 1 0 0 78;
1 0 1 1 0 0 0 0 0 1 12.5;
1 0 1 0 1 0 0 0 0 1 20;
]
X = sparse(T[:,2:end])'
y = T[:,1]
fm = train(X, y)
X_new = sparse([
0 1 0 1 0 0 0 0 1 13.0;
])'
p = predict(fm, X_new)
Using LIBSVM file format
(X_train, y_train) = read_libsvm("data/small_train.libfm")
fm = train(sparse(X_train), y_train)
(X_test, y_test) = read_libsvm("data/small_test.libfm")
p = predict(fm, sparse(X_test))
TODOs:
- [ ] AdaGrad SGD optimization
- [ ] Performance benchmark with libfm and python implementation (pyfm/fastFM/lightfm)
- [ ] Field-Aware FM
- [ ] Gaussian Process FM
- [ ] MCMC and ALS - just like in libfm
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.2kCommit, push, and open a PR
