Code and paper for an article presented at SDM'14 (and extended version in preparation)