Skip to content

Instantly share code, notes, and snippets.

View mfagerlund's full-sized avatar

Mattias Fagerlund mfagerlund

View GitHub Profile
@kalaidin
kalaidin / fm_lr.py
Created May 28, 2015 22:11
Logistic regression + Factorization machines + SGD
import numpy as np
from math import exp, log
"""
SGD for logistic loss + factorization machines
The code follows this paper:
[1] http://www.ics.uci.edu/~smyth/courses/cs277/papers/factorization_machines_with_libFM.pdf
"""
def sigmoid(x):