scikit-learn-contrib / polylearn

A library for factorization machines and polynomial networks for classification and regression in Python.
http://contrib.scikit-learn.org/polylearn/
BSD 2-Clause "Simplified" License
245 stars 43 forks source link

Cache derivative computation in direct solver #3

Closed vene closed 8 years ago

vene commented 8 years ago

Fairly minor speedup at the cost of a bit more memory. Seems to matter more for degree=3 where the gradient expressions are slower.


Model                 train       test         f1   accuracy
------------------------------------------------------------
fastfm             59.6579s    0.1451s     0.4010     0.9667
polylearn (after)  35.7319s    0.1012s     0.4340     0.9681
polylearn (before) 36.5424s    0.1005s     0.4340     0.9681

Classifier            train       test         f1   accuracy
------------------------------------------------------------
(after)
fm-3               10.7429s    0.3643s     0.4009     0.9663
fm-2                7.1621s    0.1208s     0.6126     0.9740
polynet-3           6.6148s    0.0683s     0.6992     0.9796
polynet-2           5.9102s    0.0683s     0.7310     0.9807

(before)
fm-3               11.7039s    0.3668s     0.4009     0.9663
fm-2                7.1551s    0.1211s     0.6126     0.9740
vene commented 8 years ago

The Appveyor Python 3.5 errors seem to be caused by a bug in the new setuptools release (25.1.6). I experienced the same build error on my Windows box.

vene commented 8 years ago

Merged by rebase. Fixed #4 in the process.