(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 26160, 797] NotebookOptionsPosition[ 23371, 715] NotebookOutlinePosition[ 23852, 734] CellTagsIndexPosition[ 23809, 731] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Example <)><", "Title", CellChangeTimes->{{3.399069708647093*^9, 3.399069713354594*^9}, { 3.399070284492626*^9, 3.399070286686308*^9}, {3.399166973513649*^9, 3.3991669758833303`*^9}, {3.39916884534515*^9, 3.399168846179372*^9}}], Cell[TextData[Cell[BoxData[GridBox[{ {"Smelly", "Color", "Temperature", "Goodness"}, {"yes", "green", "cool", "bad"}, {"no", "white", "cold", "good"}, {"yes", "red", "cool", "sellable"}, {"yes", "red", "cold", "good"}, {"yes", "white", "cool", "good"}, {"yes", "red", "hot", "bad"} }, GridBoxDividers->{ "Columns" -> {{True}}, "ColumnsIndexed" -> {}, "Rows" -> {{True}}, "RowsIndexed" -> {}}]]]], "Text", CellChangeTimes->{{3.399291015349887*^9, 3.39929105792645*^9}}], Cell[CellGroupData[{ Cell["Multinomial Naive Bayes - \"Categorical\"", "Subsubsection", CellChangeTimes->{{3.399069785673978*^9, 3.399069791345422*^9}, { 3.399166995872245*^9, 3.399166997523636*^9}}], Cell[CellGroupData[{ Cell["Parameters to learn", "Subsubsubsection", CellChangeTimes->{{3.399069874756226*^9, 3.399069878408869*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox["\[Theta]", "b"], " ", "\[Congruent]", " ", RowBox[{"P", "(", RowBox[{"Y", "=", "bad"}], ")"}]}], " ", "=", " ", RowBox[{ FractionBox[ RowBox[{"#", RowBox[{"(", RowBox[{"Y", "=", "bad"}], ")"}]}], RowBox[{"#", " ", "examples"}]], "=", RowBox[{ FractionBox["2", "6"], "=", FractionBox["1", "3"]}]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.399069881025292*^9, 3.399069883085767*^9}, { 3.399070071340831*^9, 3.3990701118517923`*^9}, {3.399070164893804*^9, 3.399070165676199*^9}, {3.399167011242949*^9, 3.399167015788847*^9}, { 3.399284840046762*^9, 3.3992848433598137`*^9}, {3.3992849952092333`*^9, 3.399285017422236*^9}, {3.399312718904883*^9, 3.399312730921171*^9}}], Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["\[Theta]", "s"], "=", RowBox[{ RowBox[{"P", "(", RowBox[{"Y", "=", "sellable"}], ")"}], "=", FractionBox["1", "6"]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.399286440845903*^9, 3.399286450363625*^9}, { 3.399312753873885*^9, 3.399312770280374*^9}}], Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["\[Theta]", "g"], "=", RowBox[{ RowBox[{"P", "(", RowBox[{"Y", "=", "good"}], ")"}], "=", RowBox[{ FractionBox["3", "6"], "=", RowBox[{ RowBox[{"1", "-", FractionBox["1", "3"], "-", FractionBox["1", "6"]}], "=", FractionBox["1", "2"]}]}]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3992864510338984`*^9, 3.399286454379649*^9}, { 3.399312773295988*^9, 3.399312796008539*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Smelly", "=", RowBox[{ RowBox[{"yes", "|", "Y"}], "=", "bad"}]}], ")"}], "=", RowBox[{ FractionBox["2", "2"], "=", "1"}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3992864409613247`*^9, 3.399286457963725*^9}, { 3.3993128220657167`*^9, 3.399312854168274*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Smelly", "=", RowBox[{ RowBox[{"no", "|", "Y"}], "=", "bad"}]}], ")"}], "=", "0"}], TraditionalForm]], "Equation", CellChangeTimes->{ 3.39928646307579*^9, {3.399312857311767*^9, 3.3993128736242437`*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Smelly", "=", RowBox[{ RowBox[{"yes", "|", "Y"}], "=", "sellable"}]}], ")"}], "=", "1"}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3992864409613247`*^9, 3.399286457963725*^9}, { 3.399312878831799*^9, 3.399312900184225*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Smelly", "=", RowBox[{ RowBox[{"no", "|", "Y"}], "=", "sellable"}]}], ")"}], "=", "0"}], TraditionalForm]], "Equation", CellChangeTimes->{ 3.39928646307579*^9, {3.399312902191678*^9, 3.399312909221549*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Smelly", "=", RowBox[{ RowBox[{"yes", "|", "Y"}], "=", "good"}]}], ")"}], "=", FractionBox["2", "3"]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3992864409613247`*^9, 3.399286457963725*^9}, { 3.3993129170558434`*^9, 3.399312955395495*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Smelly", "=", RowBox[{ RowBox[{"no", "|", "Y"}], "=", "good"}]}], ")"}], "=", FractionBox["1", "3"]}], TraditionalForm]], "Equation", CellChangeTimes->{ 3.39928646307579*^9, {3.399312956807811*^9, 3.399312964818508*^9}}], Cell["Summary:", "Text", CellChangeTimes->{{3.399167630129047*^9, 3.399167631042429*^9}, 3.399285233389484*^9}], Cell[TextData[{ Cell[BoxData[GridBox[{ {"\[Placeholder]", "bad", "sellable", "good"}, { RowBox[{"P", RowBox[{"(", "Y", ")"}]}], FractionBox["1", "3"], FractionBox["1", "6"], AdjustmentBox[ FractionBox[ AdjustmentBox["1", BoxMargins->{{0.05177993527508091, -0.05177993527508091}, {0., 0.}}], "2"], BoxMargins->{{0.05177993527508091, -0.05177993527508091}, {0., 0.}}]} }, GridBoxDividers->{ "Columns" -> {{True}}, "ColumnsIndexed" -> {}, "Rows" -> {{True}}, "RowsIndexed" -> {}}]]], " ", Cell[BoxData[GridBox[{ {"Smelly", "bad", "sellable", "good"}, {"yes", "1", "1", FractionBox["2", "3"]}, {"no", "0", "0", FractionBox["1", "3"]} }, GridBoxDividers->{ "Columns" -> {{True}}, "ColumnsIndexed" -> {}, "Rows" -> {{True}}, "RowsIndexed" -> {}}]]] }], "Text", CellChangeTimes->{{3.399285337891923*^9, 3.399285347721925*^9}, { 3.399285440882928*^9, 3.39928544281253*^9}, {3.3992864785099173`*^9, 3.3992864806324244`*^9}, {3.399312990513835*^9, 3.399313014480579*^9}}], Cell[TextData[{ Cell[BoxData[GridBox[{ {"Color", "bad", "sellable", "good"}, {"green", FractionBox["1", "2"], "0", "0"}, {"red", FractionBox["1", "2"], "1", FractionBox["1", "3"]}, {"white", "0", "0", FractionBox["2", "3"]} }, GridBoxDividers->{ "Columns" -> {{True}}, "ColumnsIndexed" -> {}, "Rows" -> {{True}}, "RowsIndexed" -> {}}]]], " ", Cell[BoxData[GridBox[{ {"Temp", "bad", "sellable", "good"}, {"cold", "0", "0", FractionBox["2", "3"]}, {"cool", FractionBox["1", "2"], "1", FractionBox["1", "3"]}, {"hot", FractionBox["1", "2"], "0", "0"} }, GridBoxDividers->{ "Columns" -> {{True}}, "ColumnsIndexed" -> {}, "Rows" -> {{True}}, "RowsIndexed" -> {}}]]] }], "Text", CellChangeTimes->{{3.399167569024219*^9, 3.399167585044167*^9}, { 3.399285265037134*^9, 3.399285297623719*^9}, {3.399285359561269*^9, 3.399285359987596*^9}, {3.399285429811129*^9, 3.399285431454668*^9}, { 3.3992860194850597`*^9, 3.3992860217268333`*^9}}], Cell["", "Text", CellChangeTimes->{{3.399167569024219*^9, 3.399167605563889*^9}, { 3.399285363643317*^9, 3.3992854280052347`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["\"testing\"", "Subsubsubsection", CellChangeTimes->{{3.399167396052877*^9, 3.3991673972264023`*^9}}], Cell[TextData[{ " ", Cell[BoxData[ FormBox[ SubscriptBox["f", "1"], TraditionalForm]]], ": Smelly = yes, Color = red, Temperature = cool " }], "Text", CellChangeTimes->{{3.399167400300856*^9, 3.399167406218218*^9}, { 3.399284635254652*^9, 3.399284643823184*^9}, {3.399285705984599*^9, 3.3992857203733377`*^9}, {3.399285994724236*^9, 3.399285997485072*^9}}, FontWeight->"Bold"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Y", "=", RowBox[{"good", "|", "X"}]}], ")"}], "=", FractionBox[ RowBox[{ RowBox[{"P", "(", RowBox[{ RowBox[{"X", "|", "Y"}], "=", "good"}], ")"}], " ", RowBox[{"P", "(", RowBox[{"Y", "=", "good"}], ")"}]}], RowBox[{"P", "(", "X", ")"}]]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.39916764114762*^9, 3.399167665627788*^9}, { 3.399167711669592*^9, 3.399167718900691*^9}, {3.3992855377713633`*^9, 3.39928554550764*^9}, {3.399307077152914*^9, 3.399307092202207*^9}, { 3.399313060205722*^9, 3.39931309161889*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Y", "=", RowBox[{"good", "|", "X"}]}], ")"}], "=", RowBox[{ FractionBox["1", RowBox[{"P", "(", "X", ")"}]], RowBox[{"P", "(", RowBox[{"Smelly", "=", RowBox[{ RowBox[{"yes", "|", "Y"}], "=", "good"}]}], ")"}], " ", RowBox[{"P", "(", RowBox[{"Color", "=", RowBox[{ RowBox[{"red", "|", "Y"}], "=", "good"}]}], ")"}], " ", RowBox[{"P", "(", RowBox[{"Temp", "=", RowBox[{ RowBox[{"cool", "|", "Y"}], "=", "good"}]}], ")"}], " ", RowBox[{"P", "(", RowBox[{"Y", "=", "good"}], ")"}]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.39916764114762*^9, 3.399167665627788*^9}, { 3.399167711669592*^9, 3.399167718900691*^9}, {3.3992855377713633`*^9, 3.39928554550764*^9}, {3.399307077152914*^9, 3.399307092202207*^9}, { 3.399313060205722*^9, 3.399313144577174*^9}}], Cell[BoxData[ FormBox[ RowBox[{"=", RowBox[{ RowBox[{ FractionBox["1", RowBox[{"P", "(", "X", ")"}]], " ", FractionBox["2", "3"], FractionBox["1", "3"], FractionBox["1", "3"], FractionBox["1", "2"]}], "=", StyleBox[ RowBox[{ FractionBox["1", "27"], FractionBox["1", RowBox[{"P", "(", "X", ")"}]]}], FontWeight->"Bold"]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.399313144793962*^9, 3.399313192498941*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Y", "=", RowBox[{"bad", "|", " ", "X"}]}], ")"}], " ", "="}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3992855888673773`*^9, 3.399285614267507*^9}, { 3.399286155679447*^9, 3.399286171901516*^9}, {3.399286330973179*^9, 3.3992863820830393`*^9}, 3.3992869014018707`*^9, {3.3993132151700573`*^9, 3.399313237061108*^9}}], Cell[BoxData[ FormBox[ RowBox[{ FractionBox["1", RowBox[{"P", "(", "X", ")"}]], " ", RowBox[{"P", "(", RowBox[{"Smelly", "=", RowBox[{ RowBox[{"yes", "|", "Y"}], "=", "bad"}]}], ")"}], " ", RowBox[{"P", "(", RowBox[{"Color", "=", RowBox[{ RowBox[{"red", "|", "Y"}], "=", "bad"}]}], ")"}], RowBox[{"P", "(", RowBox[{"Temp", "=", RowBox[{ RowBox[{"cool", "|", "Y"}], "=", "bad"}]}], ")"}], " ", RowBox[{"P", "(", RowBox[{"Y", "=", "bad"}], ")"}], " "}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3992855888673773`*^9, 3.399285614267507*^9}, { 3.399286155679447*^9, 3.399286171901516*^9}, {3.399286330973179*^9, 3.3992863820830393`*^9}, 3.3992869014018707`*^9, {3.3993132151700573`*^9, 3.399313237061108*^9}}], Cell[BoxData[ FormBox[ RowBox[{"=", RowBox[{ RowBox[{"1", FractionBox["1", "2"], FractionBox["1", "2"], FractionBox["1", "3"]}], "=", StyleBox[ RowBox[{ FractionBox["1", "12"], FractionBox["1", RowBox[{"P", "(", "X", ")"}]]}], FontWeight->"Bold"]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.399313270854061*^9, 3.399313312662068*^9}, { 3.399313354261417*^9, 3.3993133557072563`*^9}}], Cell[BoxData[ FormBox[ RowBox[{"=", " ", FractionBox["1", RowBox[{"P", "(", "X", ")"}]]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3992855888673773`*^9, 3.399285614267507*^9}, { 3.399286155679447*^9, 3.399286171901516*^9}, {3.399286330973179*^9, 3.3992863820830393`*^9}, 3.3992869014018707`*^9, {3.3993132151700573`*^9, 3.399313244749072*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Y", "=", RowBox[{"sellable", "|", "X"}]}], ")"}], "=", StyleBox[ RowBox[{ FractionBox["1", RowBox[{"P", "(", "X", ")"}]], FractionBox["1", "6"]}], FontWeight->"Bold"]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3991678229312*^9, 3.3991678690940866`*^9}, { 3.3992856373689003`*^9, 3.399285664910099*^9}, {3.399286065199685*^9, 3.3992860739589376`*^9}, {3.399313322791978*^9, 3.399313326555477*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", "X", ")"}], " ", "=", " ", RowBox[{ SubsuperscriptBox["\[Sum]", RowBox[{"y", "=", "1"}], "k"], RowBox[{"P", "(", RowBox[{"X", ",", RowBox[{"Y", "=", "k"}]}], ")"}]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.399313441353346*^9, 3.39931348371741*^9}}], Cell["This fish is Sellable despite being Smelly", "Text", CellChangeTimes->{{3.39928639511614*^9, 3.399286398074847*^9}, { 3.399313559511815*^9, 3.399313599734406*^9}}], Cell["", "Text", CellChangeTimes->{{3.399313600954764*^9, 3.399313600956622*^9}}], Cell["", "Text"], Cell[TextData[{ " ", Cell[BoxData[ FormBox[ SubscriptBox["f", "2"], TraditionalForm]]], ": Smelly = yes, Color = white, Temperature = cool" }], "Text", CellChangeTimes->{{3.399167400300856*^9, 3.399167411260088*^9}, { 3.399284649327799*^9, 3.399284652571968*^9}, {3.399285723885674*^9, 3.399285745672864*^9}, {3.399286178129554*^9, 3.3992861785152693`*^9}}, FontWeight->"Bold"], Cell["Recall Summary:", "Text", CellChangeTimes->{{3.399167630129047*^9, 3.399167631042429*^9}, 3.399285233389484*^9, {3.399286567237911*^9, 3.399286567993243*^9}}], Cell[TextData[{ Cell[BoxData[GridBox[{ {"\[Placeholder]", "bad", "sellable", "good"}, { RowBox[{"P", RowBox[{"(", "Y", ")"}]}], FractionBox["1", "3"], FractionBox["1", "6"], FractionBox["1", "2"]} }, GridBoxDividers->{ "Columns" -> {{True}}, "ColumnsIndexed" -> {}, "Rows" -> {{True}}, "RowsIndexed" -> {}}]]], " ", Cell[BoxData[GridBox[{ {"Smelly", "bad", "sellable", "good"}, {"yes", "1", "1", FractionBox["2", "3"]}, {"no", "0", "0", FractionBox["1", "3"]} }, GridBoxDividers->{ "Columns" -> {{True}}, "ColumnsIndexed" -> {}, "Rows" -> {{True}}, "RowsIndexed" -> {}}]]] }], "Text", CellChangeTimes->{{3.399285337891923*^9, 3.399285347721925*^9}, { 3.399285440882928*^9, 3.39928544281253*^9}, {3.3992864785099173`*^9, 3.3992864806324244`*^9}, {3.3992865731148376`*^9, 3.399286598186819*^9}}], Cell[TextData[{ Cell[BoxData[GridBox[{ {"Color", "bad", "sellable", "good"}, {"green", FractionBox["1", "2"], "0", "0"}, {"red", FractionBox["1", "2"], "1", FractionBox["1", "3"]}, {"white", "0", "0", FractionBox["2", "3"]} }, GridBoxDividers->{ "Columns" -> {{True}}, "ColumnsIndexed" -> {}, "Rows" -> {{True}}, "RowsIndexed" -> {}}]]], " ", Cell[BoxData[GridBox[{ {"Temp", "bad", "sellable", "good"}, {"cold", "0", "0", FractionBox["2", "3"]}, {"cool", FractionBox["1", "2"], "1", FractionBox["1", "3"]}, {"hot", FractionBox["1", "2"], "0", "0"} }, GridBoxDividers->{ "Columns" -> {{True}}, "ColumnsIndexed" -> {}, "Rows" -> {{True}}, "RowsIndexed" -> {}}]]] }], "Text", CellChangeTimes->{{3.399167569024219*^9, 3.399167585044167*^9}, { 3.399285265037134*^9, 3.399285297623719*^9}, {3.399285359561269*^9, 3.399285359987596*^9}, {3.399285429811129*^9, 3.399285431454668*^9}, { 3.3992860194850597`*^9, 3.3992860217268333`*^9}}], Cell[BoxData[ FormBox[ RowBox[{"P", "(", RowBox[{ RowBox[{"Y", "=", "bad"}], ",", "X"}], ")"}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3991678229312*^9, 3.399167836368569*^9}, { 3.3991684083395023`*^9, 3.399168409308606*^9}, {3.399285749053316*^9, 3.399285753422059*^9}, {3.39928619140694*^9, 3.399286203837768*^9}, 3.399286612019245*^9}], Cell[BoxData[ FormBox[ RowBox[{"=", RowBox[{ RowBox[{"P", "(", RowBox[{"Smelly", "=", RowBox[{ RowBox[{"yes", "|", "Y"}], "=", "bad"}]}], ")"}], RowBox[{"P", "(", RowBox[{"Color", "=", RowBox[{ RowBox[{"white", "|", "Y"}], "=", "bad"}]}], ")"}], " ", RowBox[{"P", "(", RowBox[{"Temp", "=", RowBox[{ RowBox[{"cool", "|", "Y"}], "=", "bad"}]}], ")"}], RowBox[{"P", "(", RowBox[{"Y", "=", "bad"}], ")"}]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3991678229312*^9, 3.399167836368569*^9}, { 3.3991684083395023`*^9, 3.399168409308606*^9}, {3.399285749053316*^9, 3.399285753422059*^9}, {3.39928619140694*^9, 3.399286203837768*^9}, { 3.399286612019245*^9, 3.39928661558482*^9}}], Cell[BoxData[ FormBox[ RowBox[{"=", RowBox[{"1", " ", "0"}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.3991678229312*^9, 3.399167836368569*^9}, { 3.3991684083395023`*^9, 3.399168409308606*^9}, {3.399285749053316*^9, 3.399285753422059*^9}, {3.39928619140694*^9, 3.399286203837768*^9}, { 3.399286612019245*^9, 3.39928661558482*^9}, {3.3993136577437153`*^9, 3.399313673418578*^9}}], Cell["Laplace smoothing", "Text", CellChangeTimes->{{3.3991679584694233`*^9, 3.3991679676344833`*^9}, { 3.399168005262927*^9, 3.399168005754643*^9}, {3.3992857665606823`*^9, 3.39928576832367*^9}, {3.399286731196445*^9, 3.399286744001446*^9}, { 3.399313736783369*^9, 3.399313739406871*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"\[Theta]", " ", "\[Congruent]", " ", RowBox[{"P", "(", RowBox[{"Y", "=", "bad"}], ")"}]}], " ", "=", " ", RowBox[{ FractionBox[ RowBox[{ RowBox[{"#", RowBox[{"(", RowBox[{"Y", "=", "bad"}], ")"}]}], "+", "1"}], RowBox[{ RowBox[{"#", " ", RowBox[{"(", "examples", ")"}]}], "+", "3"}]], "=", FractionBox["\[Placeholder]", "\[Placeholder]"]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.399069881025292*^9, 3.399069883085767*^9}, { 3.399070071340831*^9, 3.3990701118517923`*^9}, {3.399070164893804*^9, 3.399070165676199*^9}, {3.399167011242949*^9, 3.399167015788847*^9}, { 3.3991680110325212`*^9, 3.39916801247014*^9}, {3.399285789346283*^9, 3.3992857908249063`*^9}, {3.399286683764477*^9, 3.399286703186408*^9}, { 3.39931374653784*^9, 3.399313792943129*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{"Color", "=", RowBox[{ RowBox[{"white", "|", "Y"}], "=", "bad"}]}], ")"}], " ", "=", " ", RowBox[{ FractionBox[ RowBox[{ RowBox[{"#", RowBox[{"(", RowBox[{ RowBox[{"Y", "=", "bad"}], ",", " ", RowBox[{"Color", "=", "white"}]}], " ", ")"}]}], "+", "1"}], RowBox[{ RowBox[{"#", " ", RowBox[{"(", " ", RowBox[{"Y", "=", "bad"}], ")"}]}], "+", RowBox[{"#", RowBox[{"(", RowBox[{ "bad", " ", "fish", " ", "hallucinated", " ", "for", " ", "all", " ", "Colors"}], ")"}]}]}]], "=", FractionBox["\[Placeholder]", "\[Placeholder]"]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.399069881025292*^9, 3.399069883085767*^9}, { 3.399070071340831*^9, 3.3990701254930553`*^9}, {3.3990701834780493`*^9, 3.399070185298554*^9}, {3.399070377272369*^9, 3.399070394391514*^9}, { 3.399167065424274*^9, 3.399167086829596*^9}, {3.399167306549242*^9, 3.399167315268862*^9}, {3.399168040493952*^9, 3.399168046046165*^9}, { 3.399285793713378*^9, 3.399285794872716*^9}, {3.39928669485607*^9, 3.39928669837836*^9}, {3.3992867615575333`*^9, 3.3992867656756067`*^9}, { 3.399313826760544*^9, 3.399313830095606*^9}, {3.399313963122177*^9, 3.3993139951212463`*^9}, {3.399314147136758*^9, 3.3993141786410522`*^9}, { 3.399315251009947*^9, 3.3993152513125277`*^9}}], Cell["no zeros!", "Text", CellChangeTimes->{{3.3992867814196653`*^9, 3.3992867822657433`*^9}}], Cell["", "Text", CellChangeTimes->{{3.399286523331702*^9, 3.399286523409471*^9}}], Cell["", "Text", CellChangeTimes->{{3.399286523511904*^9, 3.399286523578679*^9}}], Cell["", "Text"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Gaussian Naive Bayes", "Subsubsection", CellChangeTimes->{{3.399069781806406*^9, 3.39906978380901*^9}}], Cell["Parameters to learn", "Text", CellChangeTimes->{{3.399069904238739*^9, 3.399069906177033*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"\[Theta]", " ", "\[Congruent]", " ", RowBox[{"P", "(", RowBox[{"Y", "=", "1"}], ")"}]}], " ", "=", RowBox[{"same", " ", "way", " ", "as", " ", "for", " ", RowBox[{"Mult", ".", " ", "NB"}]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.399069881025292*^9, 3.399069883085767*^9}, { 3.399070071340831*^9, 3.3990701118517923`*^9}, {3.3990701442603827`*^9, 3.399070171499757*^9}, {3.399168546208767*^9, 3.399168552505176*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"P", "(", RowBox[{ RowBox[{"Smelly", "|", "Y"}], "=", "bad"}], ")"}], " ", "~", RowBox[{"N", "(", RowBox[{ SubscriptBox["\[Mu]", "01"], ",", " ", SubscriptBox["\[Sigma]", "01"]}], ")"}]}], TraditionalForm]], "Equation",\ CellChangeTimes->{{3.399069881025292*^9, 3.399069883085767*^9}, { 3.399070071340831*^9, 3.3990701254930553`*^9}, {3.3990703227608128`*^9, 3.3990703396792107`*^9}, {3.399168564506179*^9, 3.399168569990552*^9}}], Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["\[Mu]", "01"], "=", " ", RowBox[{ FractionBox["1", RowBox[{"#", RowBox[{"(", RowBox[{"Y", "=", "bad"}], ")"}]}]], RowBox[{ SubscriptBox["\[Sum]", RowBox[{ StyleBox["bad", FontSlant->"Italic"], " ", "examples"}]], RowBox[{"value", " ", "of", " ", "Smelly"}]}]}]}], TraditionalForm]], "Equation", CellChangeTimes->{{3.399070342725585*^9, 3.399070353838992*^9}, { 3.399168593807939*^9, 3.399168641798913*^9}}], Cell["What's the problem?", "Text", CellChangeTimes->{{3.399284967477276*^9, 3.399284970277258*^9}}], Cell["Smelly: Binary \[Rule] {0,1}", "Text", CellChangeTimes->{{3.399168645129787*^9, 3.3991686646051683`*^9}}], Cell["\<\ Temperature: can get the numeric values \[Rule] Gaussian makes sense since \ closer numbers are more \"similar\"\ \>", "Text", CellChangeTimes->{{3.399168660821257*^9, 3.399168677308526*^9}, { 3.399168749369299*^9, 3.3991687627974157`*^9}}], Cell["\<\ Color: green=0, red=1, white=2?\ \>", "Text", CellChangeTimes->{{3.399168766241817*^9, 3.399168826594337*^9}}], Cell["\<\ doesn't really make sense... can still model as multinomial and combine \ with the gaussian features! (why not? \[LeftArrow] rhetorical)\ \>", "Text", CellChangeTimes->{{3.399168766241817*^9, 3.399168828141419*^9}}], Cell["", "Text"] }, Open ]] }, Open ]] }, WindowSize->{986, 724}, WindowMargins->{{Automatic, 3}, {Automatic, 0}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, Magnification->1.5, FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (April 20, 2007)", StyleDefinitions->FrontEnd`FileName[{"Article"}, "JournalArticle.nb", CharacterEncoding -> "UTF-8"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 240, 3, 108, "Title"], Cell[833, 28, 502, 12, 171, "Text"], Cell[CellGroupData[{ Cell[1360, 44, 181, 2, 34, "Subsubsection"], Cell[CellGroupData[{ Cell[1566, 50, 113, 1, 34, "Subsubsubsection"], Cell[1682, 53, 816, 20, 67, "Equation"], Cell[2501, 75, 336, 9, 64, "Equation"], Cell[2840, 86, 500, 15, 64, "Equation"], Cell[3343, 103, 363, 10, 63, "Equation"], Cell[3709, 115, 291, 9, 39, "Equation"], Cell[4003, 126, 322, 9, 39, "Equation"], Cell[4328, 137, 294, 9, 39, "Equation"], Cell[4625, 148, 339, 9, 64, "Equation"], Cell[4967, 159, 309, 9, 64, "Equation"], Cell[5279, 170, 116, 2, 30, "Text"], Cell[5398, 174, 1107, 32, 103, "Text"], Cell[6508, 208, 1058, 32, 135, "Text"], Cell[7569, 242, 133, 2, 30, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[7739, 249, 107, 1, 34, "Subsubsubsection"], Cell[7849, 252, 393, 10, 30, "Text"], Cell[8245, 264, 649, 17, 66, "Equation"], Cell[8897, 283, 946, 26, 91, "Equation"], Cell[9846, 311, 503, 17, 70, "Equation"], Cell[10352, 330, 417, 10, 39, "Equation"], Cell[10772, 342, 811, 22, 66, "Equation"], Cell[11586, 366, 464, 15, 70, "Equation"], Cell[12053, 383, 379, 8, 66, "Equation"], Cell[12435, 393, 520, 14, 70, "Equation"], Cell[12958, 409, 352, 10, 58, "Equation"], Cell[13313, 421, 172, 2, 30, "Text"], Cell[13488, 425, 82, 1, 30, "Text"], Cell[13573, 428, 16, 0, 30, "Text"], Cell[13592, 430, 393, 10, 30, "Text"], Cell[13988, 442, 169, 2, 30, "Text"], Cell[14160, 446, 904, 27, 103, "Text"], Cell[15067, 475, 1058, 32, 135, "Text"], Cell[16128, 509, 377, 9, 39, "Equation"], Cell[16508, 520, 785, 21, 39, "Equation"], Cell[17296, 543, 408, 8, 39, "Equation"], Cell[17707, 553, 297, 4, 30, "Text"], Cell[18007, 559, 902, 22, 67, "Equation"], Cell[18912, 583, 1475, 35, 66, "Equation"], Cell[20390, 620, 95, 1, 30, "Text"], Cell[20488, 623, 82, 1, 30, "Text"], Cell[20573, 626, 82, 1, 30, "Text"], Cell[20658, 629, 16, 0, 30, "Text"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[20723, 635, 110, 1, 34, "Subsubsection"], Cell[20836, 638, 101, 1, 30, "Text"], Cell[20940, 641, 504, 10, 39, "Equation"], Cell[21447, 653, 513, 13, 41, "Equation"], Cell[21963, 668, 531, 17, 66, "Equation"], Cell[22497, 687, 101, 1, 30, "Text"], Cell[22601, 690, 112, 1, 30, "Text"], Cell[22716, 693, 253, 5, 30, "Text"], Cell[22972, 700, 121, 3, 30, "Text"], Cell[23096, 705, 228, 4, 30, "Text"], Cell[23327, 711, 16, 0, 30, "Text"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)