This code is an example implementation of the method described in Hierarchical Beta Processes and the Indian Buffet Process, R. Thibaux, M. I. Jordan. Eleventh International Conference on Artificial Intelligence and Statistics (AISTATS 2007), San Juan, Puerto Rico, 2007. For the latest version of the code and more information, see http://www.cs.berkeley.edu/~thibaux/Projects/AISTATS_07/intro.htm ========================================================================== Copyright (c) 2007, Regents of the University of California Created by Romain Thibaux All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of California, Berkeley nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========================================================================== 1) DATASET The data is the 20 newsgroup dataset, available at http://people.csail.mit.edu/jrennie/20Newsgroups/ In particular, we used the "by date" dataset at http://people.csail.mit.edu/jrennie/20Newsgroups/20news-bydate.tar.gz We process this data to transform each message into a binary vector, each component of which represents the presence of a feature. The processed data is available as a matlab file 20news-bydate.mat Or you can recreate the binary features by placing the files Makefile text_to_word_list.pl in the Data/20news-bydate/ directory and running make (Windows users can use cygwin). The script takes a while to run. The matlab function load_newsgroups() can read either the .mat file or the binary vector files generated by the script. 2) MAIN FUNCTIONS hbp() is the implementation of the method described in the paper. test_hbp() compares the performance of hbp() to naive_bayes(), and in doing so gives examples of calls to hbp().