An optimized Java implementation of the "Follow the (Proximally) Regularized Leader"-Algorithm.
- Original paper at: http://goo.gl/iqIaH0
- Loosely based on the Python implementation of: jeongyoonlee/Kaggler
- Published under the MIT license (see LICENSE)
Installation (requires Maven)
git clone https://github.com/twiddles/jftrl.git
cd jftrl
mvn clean install
<dependency>
<groupId>org.ftrl</groupId>
<artifactId>jftrl</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
FTRL clf = new FTRL();
clf.interactions = 2; // automatically consider feature interactions up to a degree of 2
clf.λ1 = 0.0; // disable regularization for the sake of simplicity
clf.fit("true true", Label.FALSE);
clf.fit("true false", Label.TRUE);
clf.fit("false true", Label.TRUE);
clf.fit("false false", Label.FALSE);
clf.predict("true true"); // Label.FALSE
clf.predict("false true"); // Label.TRUE
See example code here