Relative Density Ratio Estimation (RuLSIF) by Python

   

Introduction

This is a Python implementation of Relative Density Ratio Estimation (RuLSIF) method, whose detail can be found here. With the support of pylab, this software implements the exact same algorithm described in the above webpage.

This distribution is under GPL license.

Download

pyRULSIF.py

Demo

The picture below shows an estimation of RuLSIF method with alpha = 0. The numerator samples are drawn from N(-1, 0.25^2) and the denominators are drawn from N(0, .5^2). To obtain the following result, run:

python pyRULSIF.py

You need a pylab-enabled python distribution to run this code. On windows, I found python(x,y) is handy.

 

Reference

Yamada, M., Suzuki, T., Kanamori, T., Hachiya, H., & Sugiyama, M.
Relative density-ratio estimation for robust distribution comparison.
Neural Computation, to appear.

Song Liu (song@sg.cs.titech.ac.jp)