⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 gibbs
💻
字号:
This README covers the Gibbs sampling code, along with code usedto test inference methods in general.Comments to Daniel Lowd (lowd at cs dot washington dot edu)This code is provided to accompany ``Naive Bayes Models forProbability Estimation'', by Daniel Lowd and Pedro Domingos,to appear in ICML 2005.  This document describes basic installation and usage.Outline:I.   LicenseII.  InstallationIII. UsageIV.  Source codeI. LICENSEYou are welcome to use the code under the terms of the modified BSD licensefor research or commercial purposes, however please acknowledge its use with acitation:Lowd, D. and Domingos, P. "Naive Bayes Models for Probability Estimation".To appear in ICML, 2005.  Bonn, Germany: ACM Press.If you like, please also drop us a line about what you do with it and whatresults you obtain.  See the LICENSE file for official license information.II. INSTALLATIONTo build the code on a UNIX-like system (e.g., Linux, Mac OS X, etc.),you must first edit the Makefile.  Change the line:    NBEDIR=../nbeso that it references the directory in which you have compiled the NBEcode (from nbe.tar.gz).  This is absolutely necessary, because the Gibbssampling code uses some of those object files.You must also have the expat library installed, so that it can be linkedusing -lexpat.  (If you installed expat in an unusual location, you may haveto edit the Makefile.)  This is required for reading in WinMine model files.Then run: makeIII. USAGEThe program used for all of our query experiments is given in inftest.cpp.Basic usage is as follows:    ./inftest -[jm] <testfile> <condfile> -[gbn] [other parameters]For the first flag, -j refers to multiple-variable queries, and -m refers tosingle-variable queries.  These are sometimes referred to as joint andmarginal queries in the code, but that terminology is incorrect.  Thedifference is that, with -j, we're testing the ability to predict anyconfiguration of the query variables.  With -m, we're testing the abilityto predict the configuration of each query variable *independent* ofthe other query variables.  Thus, the -m queries are all single-variable,even if there are multiple free variables.For the second flag, -g refers to Gibbs sampling, -b refers to beliefpropagation (only usable with -m), and -n refers to NBE inference.The <testfile> consists of examples in NBE training format: space-delimitedattribute value indices, surrounded by parentheses.  For example:    (2 1 0 0 3 2)A question mark (?) indicates a missing value, over which we shouldmarginalize.  For example,    (? 1 0 ? ? ?)That last test example specifies that we're predicting (at most) the secondand third attributes, and marginalizing over the rest.The <condfile> consists of examples in the same format, which functionas evidence.  For example, if the first test example is:    (? 1 0 ? 3 ?)And the first evidence example is:    (? 1 ? ? ? ?)Then the first query is either:    P( 3rdAttrib=0, 5thAttrib=3 | 2ndAttrib=1)        OR    P( 3rdAttrib=0 | 2ndAttrib=1 ) * P( 5thAttrib=3 | 2ndAttrib=1 )The former query corresponds to -j; the latter, to -m.  The actuallog likelihood that is reported by inftest is averaged over allqueries for -j, or all queries * query-variables for -m.    WARNING: the WinMine model files accepted by inftest do not correspondto all WinMine model files.  This is a subset with very simply patternedformatting.  The code to load WinMine model files is very brittle!IV. SOURCE CODEGibbsSampler.{h|cpp} contain the implementation of Gibbs sampling usedin our experiments.  We also include our implementation of belief propagation,and the hooks we used for running NBE inference.As mentioned before, references to "joint" versus "marginal" inference,both in comments and in method names, may be misleading.  This actuallyrefers to the -j versus the -m option of inftest.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -