diff --git a/src/dkohl/bayes/builders/FoodNetBuilder.java b/src/dkohl/bayes/builders/FoodNetBuilder.java index 59e6e8e..8d428f4 100644 --- a/src/dkohl/bayes/builders/FoodNetBuilder.java +++ b/src/dkohl/bayes/builders/FoodNetBuilder.java @@ -221,12 +221,12 @@ public class FoodNetBuilder { public static BayesNet createDishNet(Survey survey, RecipeBook recipeBook, int startIndex, int endIndex) { BayesNet net = new BayesNet(VARIABLES); - net.setDistribution(new Variable(SOMEONE_VEGETARIAN, DOMAIN), vegi(survey)); +// net.setDistribution(new Variable(SOMEONE_VEGETARIAN, DOMAIN), vegi(survey)); //net.setDistribution(new Variable(SOMEONE_ALLERGIC_NUTS, DOMAIN), allergicNuts(survey)); net.setDistribution(new Variable(CONTAINS_MEAT, DOMAIN), meat()); //net.setDistribution(new Variable(CONTAINS_NUTS, DOMAIN), nuts()); - + net.setDistribution(new Variable(SOMEONE_VEGETARIAN, DOMAIN), vegi(survey)); net.setDistribution(new Variable(CONTAINS_VEGETABLE, DOMAIN), vegetables()); net.setDistribution(new Variable(CONTAINS_BEEF, DOMAIN), beef()); @@ -238,11 +238,12 @@ public class FoodNetBuilder { net.setDistribution(new Variable(TASTE, RATING_DOMAIN), taste()); Ontology ontology = createOntology(); - for (String category : ontology.getClasses()) { - net.connect(category, SOMEONE_VEGETARIAN); - /*net.connect(category, SOMEONE_ALLERGIC_NUTS);*/ - } - +// for (String category : ontology.getClasses()) { +// net.connect(category, SOMEONE_VEGETARIAN); +// /*net.connect(category, SOMEONE_ALLERGIC_NUTS);*/ +// } + net.connect(SOMEONE_VEGETARIAN, CONTAINS_MEAT); + for (String thing : OBSERVED) { net.connect(thing, ontology.getInheritance().get(thing)); net.connect(TASTE, thing); diff --git a/writeup/P2 Proposal.log b/writeup/P2 Proposal.log index 8b2e86e..d5c4d2f 100644 --- a/writeup/P2 Proposal.log +++ b/writeup/P2 Proposal.log @@ -1,21 +1,23 @@ -This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2012.1.11) 12 MAR 2012 20:32 +This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010) (format=pdflatex 2011.7.20) 12 MAR 2012 20:35 entering extended mode -**D:/workspace/cs6601p2/writeup/P2*Proposal.tex -("D:/workspace/cs6601p2/writeup/P2 Proposal.tex" -LaTeX2e <2011/06/27> -Babel and hyphenation patterns for english, afrikaans, ancientgreek, ar -abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic, -croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga -lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland -ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat -vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm -an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese, -romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis -sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u -senglishmax, welsh, loaded. -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls" + restricted \write18 enabled. + %&-line parsing enabled. +**"P2 Proposal.tex" +(./P2 Proposal.tex +LaTeX2e <2009/09/24> +Babel and hyphenation patterns for english, dumylang, nohyphenation, ge +rman-x-2009-06-19, ngerman-x-2009-06-19, ancientgreek, ibycus, arabic, armenian +, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutch, u +kenglish, usenglishmax, esperanto, estonian, farsi, finnish, french, galician, +german, ngerman, swissgerman, monogreek, greek, hungarian, icelandic, assamese, + bengali, gujarati, hindi, kannada, malayalam, marathi, oriya, panjabi, tamil, +telugu, indonesian, interlingua, irish, italian, kurmanji, lao, latin, latvian, + lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, polish, portuguese, roma +nian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish, + turkmen, ukrainian, uppersorbian, welsh, loaded. +(/usr/local/texlive/2010/texmf-dist/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo" +(/usr/local/texlive/2010/texmf-dist/tex/latex/base/size10.clo File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option) ) \c@part=\count79 @@ -29,13 +31,12 @@ File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option) \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 -) -(D:\workspace\cs6601p2\writeup\latex8.sty +) (./latex8.sty IEEE 8.5 x 11-Inch Proceedings Style `latex8.sty'. \@ctmp=\skip43 \@figindent=\skip44 -) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\titlesec\titlesec.sty" -Package: titlesec 2011/12/15 v2.10.0 Sectioning titles +) (/usr/local/texlive/2010/texmf-dist/tex/latex/titlesec/titlesec.sty +Package: titlesec 2007/08/12 v2.8 Sectioning titles \ttl@box=\box26 \beforetitleunit=\skip45 \aftertitleunit=\skip46 @@ -46,56 +47,49 @@ Package: titlesec 2011/12/15 v2.10.0 Sectioning titles \titlewidthlast=\dimen106 \titlewidthfirst=\dimen107 ) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphicx.sty" +(/usr/local/texlive/2010/texmf-dist/tex/latex/graphics/graphicx.sty Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\keyval.sty" +(/usr/local/texlive/2010/texmf-dist/tex/latex/graphics/keyval.sty Package: keyval 1999/03/16 v1.13 key=value parser (DPC) \KV@toks@=\toks15 ) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphics.sty" +(/usr/local/texlive/2010/texmf-dist/tex/latex/graphics/graphics.sty Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\trig.sty" +(/usr/local/texlive/2010/texmf-dist/tex/latex/graphics/trig.sty Package: trig 1999/03/16 v1.09 sin cos tan (DPC) ) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg" -File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive +(/usr/local/texlive/2010/texmf-dist/tex/latex/latexconfig/graphics.cfg +File: graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live ) Package graphics Info: Driver file: pdftex.def on input line 91. -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def" -File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX - -("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty" -Package: infwarerr 2010/04/08 v1.3 Providing info/warning/message (HO) -) -("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty" -Package: ltxcmds 2011/04/18 v1.20 LaTeX kernel commands for general use (HO) -) +(/usr/local/texlive/2010/texmf-dist/tex/latex/pdftex-def/pdftex.def +File: pdftex.def 2010/02/14 v0.04n Graphics/color for pdfTeX \Gread@gobject=\count87 )) \Gin@req@height=\dimen108 \Gin@req@width=\dimen109 ) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsmath.sty" +(/usr/local/texlive/2010/texmf-dist/tex/latex/amsmath/amsmath.sty Package: amsmath 2000/07/18 v2.13 AMS math features \@mathmargin=\skip47 For additional information on amsmath, use the `?' option. -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amstext.sty" +(/usr/local/texlive/2010/texmf-dist/tex/latex/amsmath/amstext.sty Package: amstext 2000/06/29 v2.01 -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsgen.sty" +(/usr/local/texlive/2010/texmf-dist/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 \@emptytoks=\toks16 \ex@=\dimen110 )) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsbsy.sty" +(/usr/local/texlive/2010/texmf-dist/tex/latex/amsmath/amsbsy.sty Package: amsbsy 1999/11/29 v1.2d \pmbraise@=\dimen111 ) -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsopn.sty" +(/usr/local/texlive/2010/texmf-dist/tex/latex/amsmath/amsopn.sty Package: amsopn 1999/12/14 v2.01 operator names ) \inf@bad=\count88 @@ -140,7 +134,9 @@ LaTeX Info: Redefining \] on input line 2667. LaTeX Warning: Unused global option(s): [times,08pt]. -("D:\workspace\cs6601p2\writeup\P2 Proposal.aux") +(./P2 Proposal.aux) +\openout1 = `"P2 Proposal.aux"'. + LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 11. LaTeX Font Info: ... okay on input line 11. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 11. @@ -154,7 +150,7 @@ LaTeX Font Info: ... okay on input line 11. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 11. LaTeX Font Info: ... okay on input line 11. -("C:\Program Files (x86)\MiKTeX 2.9\tex\context\base\supp-pdf.mkii" +(/usr/local/texlive/2010/texmf-dist/tex/context/base/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] \scratchcounter=\count100 \scratchdimen=\dimen119 @@ -165,20 +161,62 @@ LaTeX Font Info: ... okay on input line 11. \MPscratchCnt=\count103 \MPscratchDim=\dimen120 \MPnumerator=\count104 -\makeMPintoPDFobject=\count105 \everyMPtoPDFconversion=\toks22 +) (/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty +Package: pdftexcmds 2010/04/01 v0.9 Utility functions of pdfTeX for LuaTeX (HO) + + +(/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/infwarerr.sty +Package: infwarerr 2010/04/08 v1.3 Providing info/warning/message (HO) ) +(/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ifluatex.sty +Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO) +Package ifluatex Info: LuaTeX not detected. +) +(/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/ltxcmds.sty +Package: ltxcmds 2010/04/26 v1.7 LaTeX kernel commands for general use (HO) +) +Package pdftexcmds Info: LuaTeX not detected. +Package pdftexcmds Info: \pdf@primitive is available. +Package pdftexcmds Info: \pdf@ifprimitive is available. +) +(/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty +Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf + +(/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/grfext.sty +Package: grfext 2007/09/30 v1.0 Managing graphics extensions (HO) +) +(/usr/local/texlive/2010/texmf-dist/tex/latex/oberdiek/kvoptions.sty +Package: kvoptions 2010/02/22 v3.7 Keyval support for LaTeX options (HO) + +(/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty +Package: kvsetkeys 2010/03/01 v1.9 Key value parser (HO) + +(/usr/local/texlive/2010/texmf-dist/tex/generic/oberdiek/etexcmds.sty +Package: etexcmds 2010/01/28 v1.3 Prefix for e-TeX command names (HO) +Package etexcmds Info: Could not find \expanded. +(etexcmds) That can mean that you are not using pdfTeX 1.50 or +(etexcmds) that some package has redefined \expanded. +(etexcmds) In the latter case, load this package earlier. +))) +Package grfext Info: Graphics extension search list: +(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE +G,.JBIG2,.JB2,.eps] +(grfext) \AppendGraphicsExtensions on input line 436. + +(/usr/local/texlive/2010/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg +File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv +e +)) Underfull \hbox (badness 4254) in paragraph at lines 67--70 [] \OT1/cmr/bx/n/10 Data ac-cui-si-tion \OT1/cmr/m/n/10 We first ac-cu-mu-lated a di- [] - + File: bayes.png Graphic file (type png) - -Package pdftex.def Info: bayes.png used on input line 105. -(pdftex.def) Requested size: 237.13594pt x 142.27873pt. - [1{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map} + [1{/usr/local/texlive/2010/texmf-var/fonts/map/pdftex/updmap/p +dftex.map} ] @@ -192,13 +230,10 @@ Overfull \hbox (13.25346pt too wide) in paragraph at lines 174--202 [][] [] - + File: BayesChefChart.png Graphic file (type png) -Package pdftex.def Info: BayesChefChart.png used on input line 205. -(pdftex.def) Requested size: 248.42812pt x 141.0374pt. - Overfull \hbox (11.29218pt too wide) in paragraph at lines 205--206 [][] [] @@ -206,8 +241,7 @@ Overfull \hbox (11.29218pt too wide) in paragraph at lines 205--206 LaTeX Warning: `!h' float specifier changed to `!ht'. -("D:\workspace\cs6601p2\writeup\P2 Proposal.bbl" [2 ] +(./P2 Proposal.bbl [2 <./bayes.png (PNG copy)>] Underfull \hbox (badness 10000) in paragraph at lines 16--20 []\OT1/cmr/m/n/10 Kevin Mur-phy. A Brief In-tro-duc-tion [] @@ -224,31 +258,31 @@ Underfull \hbox (badness 10000) in paragraph at lines 16--20 ) [3 - ] -("D:\workspace\cs6601p2\writeup\P2 Proposal.aux") ) + <./BayesChefChart.png (PNG copy)>] (./P2 Proposal.aux) ) Here is how much of TeX's memory you used: - 2023 strings out of 494045 - 25481 string characters out of 3145969 - 90183 words of memory out of 3000000 - 5325 multiletter control sequences out of 15000+200000 + 2189 strings out of 493747 + 28852 string characters out of 3143546 + 96196 words of memory out of 3000000 + 5465 multiletter control sequences out of 15000+200000 11026 words of font info for 36 fonts, out of 3000000 for 9000 - 715 hyphenation exceptions out of 8191 - 27i,8n,28p,712b,219s stack positions out of 5000i,500n,10000p,200000b,50000s -{C:/Program Files (x86)/MiKT -eX 2.9/fonts/enc/dvips/fontname/8r.enc} -Output written on "P2 Proposal.pdf" (3 pages, 199662 bytes). + 714 hyphenation exceptions out of 8191 + 38i,8n,28p,684b,214s stack positions out of 5000i,500n,10000p,200000b,50000s +{/usr/local/texlive/20 +10/texmf-dist/fonts/enc/dvips/base/8r.enc} +Output written on "P2 Proposal.pdf" (3 pages, 201837 bytes). PDF statistics: - 55 PDF objects out of 1000 (max. 8388607) + 57 PDF objects out of 1000 (max. 8388607) + 39 compressed objects within 1 object stream 0 named destinations out of 1000 (max. 500000) 11 words of extra memory for PDF output out of 10000 (max. 10000000) diff --git a/writeup/P2 Proposal.pdf b/writeup/P2 Proposal.pdf index 67a2b4f..c875d39 100644 Binary files a/writeup/P2 Proposal.pdf and b/writeup/P2 Proposal.pdf differ diff --git a/writeup/P2 Proposal.tex b/writeup/P2 Proposal.tex index 66fd86e..08bba6f 100644 --- a/writeup/P2 Proposal.tex +++ b/writeup/P2 Proposal.tex @@ -70,30 +70,24 @@ scale of 1 to 10, 10 being favorite and 1 being least favorite'. Furthermore, %daniel is here \paragraph*{Knowledge Engineering} +We model the diners' various taste preferences using +a Bayes net. We model the taste -We model the diners' various taste preferences preferences using -a Bayes net. In the first layer in Figure \ref{img:bayes_net} -we capture control variables such as vegarian or allergy to nuts. -These were modeled as boolean variables, with 'true' indicating the presence of a constraint. - -Our model consists of 4 layers, -each modeling a different aspect of taste or dietary requirement. \begin{description} -\item[Layer 1] General meal preferences such as -being vegetarian or being allergic to nuts. - -\item[Layer 2] The second layer models a general preference towards +\item[Layer 1] The first layer models a general preference towards different food categories like vegetables or meat. As one can see, the food categories are dependent on the general meal preference. For example being vegetarian will exclude meat and will support vegetables. -\item[Layer 3] Specific flavors and ingredients. Each ingredient is conditioned +\item[Layer 2] Specific flavors and ingredients. Each ingredient is conditioned by the food category to which it belongs. - \end{description} +If we need to model hard constraints, like + + The overall net is shown in Figure \ref{img:bayes_net}. Given a recipe with a list of ingredients $I = i_1,...,i_n$ and a Bayesian network capturing user preferences