Skip to content
jhallock7 edited this page Jul 28, 2015 · 12 revisions

Welcome to the SparseBayes-Python wiki!

The program found here is a translation of Mike Tipping’s SparseBayes MATLAB program into Python. The primary purpose of the program is to implement relevance vector machines (RVMs), a “more Bayesian” alternative to support vector machines. The original MATLAB program, along with more information about it, can be found on Mike Tipping’s website: http://www.miketipping.com/.

The Python-translated program here requires NumPy and matplotlib to run, and was translated using Python 2.7.6, NumPy 1.8.0, and matplotlib 1.4.3.

This python translation is a beta-version. Only the demo commands have been tested, which are found on page 5 of SB_2 Manual. For example, running SparseBayesDemo(‘Gaussian’, 1) gives a standard demonstration of regression in 1 dimension. See the 'SparseBayesDemo Numerical and Graphical Outputs' page to see examples.

The initial goal of getting the outputs of the demo to be identical the those of the original MATLAB program currently are still short in 2 main ways:

  1. The 3D plotting functionality is not working. For example, when running SparseBayesDemo(‘Gaussian’, 2) or SparseBayesDemo(‘Bernoulli’, 2), only 3 of the 6 plots are produced. Specifically, the three graphs that would have been 3-dimensional are absent. Attempts to include them result in errors in the matplotlib libraries.

  2. Less importantly, the randomly generated data is different. Numpy uses the Mersenne Twister pseudo-random number generator, while the MATLAB program uses the discouraged MATLAB v4 generator. However, even when the MATLAB code is updated to use the recommended Mersenne Twister, the results still don't match. [Note that if you import the MATLAB generated data into the Python-translated version, the numerical and graphical outputs of the programs DO match.]

Clone this wiki locally