{"id":4448,"date":"2016-11-08T04:00:22","date_gmt":"2016-11-08T04:00:22","guid":{"rendered":"https:\/\/assignment.essayshark.com\/blog\/?p=4448"},"modified":"2023-01-09T15:11:10","modified_gmt":"2023-01-09T15:11:10","slug":"naive-bayes-spam-filter-example","status":"publish","type":"post","link":"https:\/\/assignmentshark.com\/blog\/naive-bayes-spam-filter-example\/","title":{"rendered":"Naive Bayes Spam Filter Example"},"content":{"rendered":"<h2>Naive Bayes classifier<\/h2>\n<p>Naive Bayes classifier is one of the easiest classification algorithms. However, very often it works even better than the more complex algorithms. I want to share the C# code and a description of how it all works.<\/p>\n<p>And so, for example, I will take the problem of determining the type of the vehicle using it\u2019s dimensions. Of course, to determine the type, you can create a large list of vehicles. But this list, in any case will never be comprehensive. In order to solve this problem, you can &#8220;train&#8221; a model for the marked name.<!--more--><\/p>\n<p style=\"text-align: center;\"><strong>Theory<\/strong><\/p>\n<p>Assume we have a text line O. Furthermore, the are classes C and to one of them we refer string. We need to find such a class C wherein its probability be maximal for a given text line. Mathematically it looks like this:<\/p>\n<p class=\"formula\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-12e06643f16aa4e9619a03fac85746da_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#99;&#61;&#97;&#114;&#103;&#32;&#109;&#97;&#120;&#80;&#40;&#67;&#124;&#79;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"172\" style=\"vertical-align: -5px;\"\/><!--more--><\/p>\n<p class=\"pls\">It\u2019s difficult to calculate <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-5490074095ace00286d5798932f62833_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#80;&#40;&#67;&#124;&#79;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"66\" style=\"vertical-align: -5px;\"\/>. But we can use Bayes&#8217; theorem and go to<\/p>\n<p class=\"formula\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-1c050d5c97781cffb0484803df11ca88_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#80;&#40;&#67;&#124;&#79;&#41;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#80;&#40;&#79;&#124;&#67;&#41;&#80;&#40;&#67;&#41;&#125;&#123;&#80;&#40;&#79;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"33\" width=\"186\" style=\"vertical-align: -11px;\"\/><\/p>\n<p>indirect probabilities: Since we are looking for a maximum of a function, the denominator doesn\u2019t interest us (it is constant in this case). In addition, it is necessary to look at a line O. Normally, it makes no sense to work with the entire line. It is much more effective than isolated from its certain features. Thus, the formula becomes:<\/p>\n<p class=\"formula\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-b75dab337ace05de2252897ad266fedf_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#102;&#114;&#97;&#99;&#123;&#125;&#123;&#80;&#40;&#67;&#124;&#95;&#123;&#111;&#95;&#49;&#111;&#95;&#50;&#46;&#46;&#46;&#111;&#95;&#110;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#80;&#40;&#111;&#95;&#49;&#111;&#95;&#50;&#46;&#46;&#46;&#111;&#95;&#110;&#124;&#67;&#41;&#80;&#40;&#67;&#41;&#125;&#123;&#80;&#40;&#95;&#123;&#111;&#95;&#49;&#111;&#95;&#50;&#46;&#46;&#46;&#111;&#95;&#110;&#125;&#41;&#125;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"30\" width=\"233\" style=\"vertical-align: -24px;\"\/><\/p>\n<p class=\"formula\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-35621be67b7b64ed2ffc9dbf588985a7_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#80;&#40;&#67;&#41;&#80;&#40;&#95;&#123;&#111;&#95;&#49;&#125;&#124;&#67;&#41;&#80;&#40;&#95;&#123;&#111;&#95;&#50;&#125;&#124;&#67;&#95;&#123;&#111;&#95;&#49;&#125;&#41;&#46;&#46;&#46;&#80;&#40;&#95;&#123;&#111;&#95;&#110;&#125;&#124;&#67;&#95;&#123;&#111;&#95;&#49;&#111;&#95;&#50;&#46;&#46;&#46;&#111;&#95;&#110;&#125;&#41;&#61;&#80;&#40;&#67;&#41;&#80;&#40;&#95;&#123;&#111;&#95;&#49;&#125;&#124;&#67;&#41;&#80;&#40;&#95;&#123;&#111;&#95;&#50;&#125;&#124;&#67;&#41;&#46;&#46;&#80;&#40;&#95;&#123;&#111;&#95;&#110;&#125;&#124;&#67;&#41;&#61;&#80;&#40;&#67;&#41;&#92;&#112;&#114;&#111;&#100;&#95;&#123;&#105;&#125;&#94;&#123;&#125;&#40;&#95;&#123;&#111;&#95;&#105;&#125;&#124;&#67;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"46\" width=\"657\" style=\"vertical-align: -6px;\"\/><\/p>\n<p class=\"formula\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-ec360c55238439fdafbc5ae9bd07207e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#102;&#114;&#97;&#99;&#123;&#125;&#123;&#99;&#61;&#97;&#114;&#103;&#32;&#92;&#117;&#110;&#100;&#101;&#114;&#115;&#101;&#116;&#123;&#99;&#92;&#101;&#112;&#115;&#105;&#108;&#111;&#110;&#32;&#67;&#125;&#123;&#109;&#97;&#120;&#125;&#80;&#40;&#95;&#99;&#124;&#95;&#123;&#111;&#95;&#49;&#111;&#95;&#50;&#46;&#46;&#46;&#111;&#95;&#110;&#125;&#41;&#61;&#97;&#114;&#103;&#32;&#92;&#117;&#110;&#100;&#101;&#114;&#115;&#101;&#116;&#123;&#99;&#92;&#101;&#112;&#115;&#105;&#108;&#111;&#110;&#32;&#67;&#125;&#123;&#109;&#97;&#120;&#125;&#80;&#40;&#99;&#41;&#92;&#112;&#114;&#111;&#100;&#95;&#123;&#125;&#94;&#123;&#125;&#80;&#40;&#95;&#123;&#111;&#95;&#105;&#124;&#99;&#125;&#41;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"23\" width=\"333\" style=\"vertical-align: -17px;\"\/><\/p>\n<p>Now we turn on the &#8220;naive&#8221; assumption that the variables O depends only on class C, and don\u2019t dependent on each other. This is a highly simplified, but it works. The numerator becomes: The final formula will be: So all we need to do is to calculate the probability <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-4ff401a7d7573803011540765b72dfc4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#80;&#40;&#67;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"45\" style=\"vertical-align: -5px;\"\/>, and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-8ef6ffcaed58160790f99042fc2c5f74_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#80;&#40;&#79;&#124;&#67;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"66\" style=\"vertical-align: -5px;\"\/>. The calculation of these parameters is called the training of the classifier.<\/p>\n<p>I have attached the C# project that implements the mentioned algorithm. There are 3 classes there: \u201cProgram.cs\u201d, \u201cFilter.cs\u201d and \u201cCalculus.cs\u201d. The simplest is the first one \u2013 it launches and manages the process by creating other classes objects and calling functions from them.<\/p>\n<p>\u201cCalculus\u201d is a \u201csupport\u201d class. It is used to make the necessary calculations: average, deviation, normal distribution.<\/p>\n<p>The most important class is \u201cFilter\u201d. It implements the main algorithm and has two main functions: TrainFilter and Filtration. To train the filter we create the training data set. The example shows how a set of data related to height, length and width of the vehicle.<\/p>\n<p>Here are the screenshots of how the program works. The parameters marked red relate to height, length and width of the vehicle. Firsts time let\u2019s run it with (1,2,1)<\/p>\n<p style=\"max-width: 600px; margin: 0 auto;\"><a href=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4452 size-large\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-1-1024x554.png\" alt=\"naive-bayes-classifier-1\" width=\"604\" height=\"327\" srcset=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-1-1024x554.png 1024w, https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-1-300x162.png 300w, https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-1-768x416.png 768w, https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-1.png 1920w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><\/p>\n<p>As we see, when parameters are close to the values that relate to motorcycles, the program lets us know about it.<\/p>\n<p class=\"pls\">Now let\u2019s try (2,4,2)<\/p>\n<p class=\"pls\">Now we see the \u201ccar\u201d message.<\/p>\n<p style=\"max-width: 600px; margin: 0 auto;\"><a href=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4454 size-large\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-2-1024x554.png\" alt=\"naive-bayes-classifier-2\" width=\"604\" height=\"327\" srcset=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-2-1024x554.png 1024w, https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-2-300x162.png 300w, https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-2-768x416.png 768w, https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-2.png 1920w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><\/p>\n<p>And now let\u2019s input the values that are closest to the truck dimensions:<\/p>\n<p style=\"max-width: 600px; margin: 0 auto;\"><a href=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4456 size-large\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-3-1024x555.png\" alt=\"naive-bayes-classifier-3\" width=\"604\" height=\"327\" srcset=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-3-1024x555.png 1024w, https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-3-300x163.png 300w, https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-3-768x416.png 768w, https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2016\/10\/naive-bayes-classifier-3.png 1920w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><\/p>\n<p class=\"pls\">We can see that it outputs \u201ctruck\u201d. So that\u2019s how it\u2019s done. Thank you for the attention.<\/p>\n<p>Source code of the mentioned classes:<br \/>\n<strong>Program.cs:<\/strong><\/p>\n<p>[code language=&#8221;cpp&#8221;]<br \/>\nusing System;<br \/>\nusing System.Data;<\/p>\n<p>namespace Bayes<br \/>\n{<br \/>\n    public class Program<br \/>\n    {<br \/>\n        static void Main(string[] args)<br \/>\n        {<br \/>\n            DataTable table = new DataTable();<br \/>\n            table.Columns.Add(&quot;Type&quot;);<br \/>\n            table.Columns.Add(&quot;Height&quot;, typeof(double));<br \/>\n            table.Columns.Add(&quot;Length&quot;, typeof(double));<br \/>\n            table.Columns.Add(&quot;Width&quot;, typeof(double));<\/p>\n<p>            table.Rows.Add(&quot;car&quot;, 1.5, 5, 1.8);<br \/>\n            table.Rows.Add(&quot;car&quot;, 1.3, 4, 1.6);<br \/>\n            table.Rows.Add(&quot;car&quot;, 1.2, 3.8, 1.7);<br \/>\n            table.Rows.Add(&quot;car&quot;, 1, 3.5, 1.3);<\/p>\n<p>            table.Rows.Add(&quot;truck&quot;, 3.3, 8.3, 2);<br \/>\n            table.Rows.Add(&quot;truck&quot;, 3.5, 8.8, 2.3);<br \/>\n            table.Rows.Add(&quot;truck&quot;, 4, 9.5, 2.5);<br \/>\n            table.Rows.Add(&quot;truck&quot;, 3, 8, 1.7);<\/p>\n<p>            table.Rows.Add(&quot;motorcycle&quot;, 1.5, 2.2, 0.9);<br \/>\n            table.Rows.Add(&quot;motorcycle&quot;, 1.7, 2.5, 1);<br \/>\n            table.Rows.Add(&quot;motorcycle&quot;, 1.3, 2, 0.8);<br \/>\n            table.Rows.Add(&quot;motorcycle&quot;, 1.1, 1.8, 0.6);<\/p>\n<p>            Filter filter = new Filter();<br \/>\n            filter.TrainFilter(table);<\/p>\n<p>            Console.WriteLine(filter.Filtration(new double[] { 3.5, 9, 3 }));<br \/>\n            Console.Read();<br \/>\n        }<br \/>\n    }<br \/>\n}<br \/>\n[\/code]<\/p>\n<p><strong>Calculus.cs:<\/strong><\/p>\n<p>[code language=&#8221;cpp&#8221;]<br \/>\nusing System;<br \/>\nusing System.Collections.Generic;<br \/>\nusing System.Linq;<\/p>\n<p>namespace Bayes<br \/>\n{<br \/>\n    public static class Calculus<br \/>\n    {<\/p>\n<p>        public static double Deviation(this IEnumerable&lt;double&gt; origin)<br \/>\n        {<br \/>\n            double average = origin.Average();<br \/>\n            double v = origin.Aggregate(0.0, (overall, next) =&gt; overall += Math.Pow(next &#8211; average, 2));<br \/>\n            return v \/ (origin.Count() &#8211; 1);<br \/>\n        }<\/p>\n<p>        public static double Average(this IEnumerable&lt;double&gt; origin)<br \/>\n        {<br \/>\n            if (origin.Count() &lt; 1)<br \/>\n                return 0.0;<\/p>\n<p>            double size = origin.Count();<br \/>\n            double total = origin.Sum();<br \/>\n            return total \/ size;<br \/>\n        }<\/p>\n<p>        public static double NormalDistrubution(double val, double average, double stdDev)<br \/>\n        {<br \/>\n            double a = stdDev * Math.Sqrt(2.0 * Math.PI);<br \/>\n            double b = (val &#8211; average) * (val &#8211; average) \/ (2.0 * stdDev * stdDev);<br \/>\n            return Math.Exp(-b) \/ a;<br \/>\n        }<\/p>\n<p>        public static double NormDist(double val, double average, double stdDev, bool aggregate)<br \/>\n        {<br \/>\n            const double p = 50000.0;<\/p>\n<p>            double lowerBorder = 0.0;<br \/>\n            if (aggregate)<br \/>\n            {<br \/>\n                double amplitude = (val &#8211; lowerBorder) \/ (p &#8211; 1.0);<br \/>\n                double integral = 0.0;<br \/>\n                for (int i = 1; i &lt; p &#8211; 1; i++)<br \/>\n                {<br \/>\n                    integral += 0.5 * amplitude * (NormalDistrubution(lowerBorder + amplitude * i, average, stdDev) +<br \/>\n                        (NormalDistrubution(lowerBorder + amplitude * (i + 1), average, stdDev)));<br \/>\n                }<br \/>\n                return integral;<br \/>\n            }<br \/>\n            else<br \/>\n            {<br \/>\n                return NormalDistrubution(val, average, stdDev);<br \/>\n            }<br \/>\n        }<\/p>\n<p>    }<br \/>\n}<br \/>\n[\/code]<\/p>\n<p><strong>Filter.cs:<\/strong><\/p>\n<p>[code language=&#8221;cpp&#8221;]<br \/>\nusing System;<br \/>\nusing System.Collections.Generic;<br \/>\nusing System.Linq;<br \/>\nusing System.Text;<br \/>\nusing System.Data;<\/p>\n<p>namespace Bayes<br \/>\n{<br \/>\n    public class Filter<br \/>\n    {<br \/>\n        private DataSet info = new DataSet();<\/p>\n<p>        public DataSet DataSet<br \/>\n        {<br \/>\n            get { return info; }<br \/>\n            set { info = value; }<br \/>\n        }<\/p>\n<p>        public IEnumerable&lt;double&gt; SelectLines(DataTable chart, int column, string keyWord)<br \/>\n        {<br \/>\n            List&lt;double&gt; list = new List&lt;double&gt;();<br \/>\n            DataRow[] rows = chart.Select(keyWord);<br \/>\n            for (int i = 0; i &lt; rows.Length; i++)<br \/>\n            {<br \/>\n                list.Add((double)rows[i][column]);<br \/>\n            }<\/p>\n<p>            return list;<br \/>\n        }<\/p>\n<p>        public string Filtration(double[] obj)<br \/>\n        {<br \/>\n            Dictionary&lt;string, double&gt; result = new Dictionary&lt;string, double&gt;();<\/p>\n<p>            var outcome = (from line in info.Tables[0].AsEnumerable()<br \/>\n                           group line by line.Field&lt;string&gt;(info.Tables[0].Columns[0].ColumnName) into x<br \/>\n                           select new { key = x.Key, Count = x.Count() }).ToList();<\/p>\n<p>            for (int i = 0; i &lt; outcome.Count; i++)<br \/>\n            {<br \/>\n                List&lt;double&gt; tempResult = new List&lt;double&gt;();<br \/>\n                int u = 1, y = 1;<br \/>\n                for (int a = 1; a &lt; info.Tables[&quot;Normal distribution&quot;].Columns.Count; a = a + 2)<br \/>\n                {<br \/>\n                    double average = Convert.ToDouble(info.Tables[&quot;Normal distribution&quot;].Rows[i][u]);<br \/>\n                    double deviation = Convert.ToDouble(info.Tables[&quot;Normal distribution&quot;].Rows[i][++u]);<br \/>\n                    double counting = Calculus.NormalDistrubution(obj[y &#8211; 1], average, Math.Sqrt(deviation));<br \/>\n                    tempResult.Add(counting);<br \/>\n                    u++; y++;<br \/>\n                }<\/p>\n<p>                double ultimateResult = 0;<\/p>\n<p>                for (int b = 0; b &lt; tempResult.Count; b++) { if (ultimateResult == 0) { ultimateResult = tempResult[b]; continue; } ultimateResult = ultimateResult * tempResult[b]; } result.Add(outcome[i].key, ultimateResult * 0.5); } double max = result.Max(v =&gt; v.Value);<br \/>\n            var name = (from v in result<br \/>\n                        where v.Value == max<br \/>\n                        select v.Key).First();<\/p>\n<p>            return name;<br \/>\n        }<\/p>\n<p>        public void TrainFilter(DataTable chart)<br \/>\n        {<br \/>\n            info.Tables.Add(chart);<\/p>\n<p>            \/\/chart<br \/>\n            DataTable NormalDist = info.Tables.Add(&quot;Normal distribution&quot;);<br \/>\n            NormalDist.Columns.Add(chart.Columns[0].ColumnName);<\/p>\n<p>            \/\/columns<br \/>\n            for (int i = 1; i &lt; chart.Columns.Count; i++)<br \/>\n            {<br \/>\n                NormalDist.Columns.Add(chart.Columns[i].ColumnName + &quot;Average&quot;);<br \/>\n                NormalDist.Columns.Add(chart.Columns[i].ColumnName + &quot;Deviation&quot;);<br \/>\n            }<\/p>\n<p>            \/\/calc data<br \/>\n            var outcome = (from line in chart.AsEnumerable()<br \/>\n                           group line by line.Field&lt;string&gt;(chart.Columns[0].ColumnName) into x<br \/>\n                           select new { key = x.Key, Count = x.Count() }).ToList();<\/p>\n<p>            for (int j = 0; j &lt; outcome.Count; j++)<br \/>\n            {<br \/>\n                DataRow dataRow = NormalDist.Rows.Add();<br \/>\n                dataRow[0] = outcome[j].key;<\/p>\n<p>                int u = 1;<br \/>\n                for (int i = 1; i &lt; chart.Columns.Count; i++)<br \/>\n                {<br \/>\n                    dataRow[u] = Calculus.Average(SelectLines(chart, i, string.Format(&quot;{0} = &#8216;{1}&#8217;&quot;, chart.Columns[0].ColumnName, outcome[j].key)));<br \/>\n                    dataRow[++u] = Calculus.Deviation(SelectLines(chart, i, string.Format(&quot;{0} = &#8216;{1}&#8217;&quot;, chart.Columns[0].ColumnName, outcome[j].key)));<br \/>\n                    u++;<br \/>\n                }<br \/>\n            }<br \/>\n        }<\/p>\n<p>    }<br \/>\n}<br \/>\n[\/code]<\/p>\n<blockquote><p><em>This Naive Bayes spam filter example is provided for reading purpose only. You neither can claim it as your own nor use it in any other ways that violate the author&#8217;s rights. We know that learning can be hard, especially if you are trying to master programming, and we are always ready to <a href=\"https:\/\/assignmentshark.com\/\" target=\"_blank\" rel=\"noopener\">help with assignments<\/a>. You can read further and find some other examples and useful articles at our blog, for example, <a href=\"https:\/\/assignmentshark.com\/blog\/sample-of-assignment-matlab\/\" target=\"_blank\" rel=\"noopener noreferrer\">sample of assignment on MATLAB<\/a>, or <span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;free accounting homework help&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:15041,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:0,&quot;10&quot;:2,&quot;12&quot;:0,&quot;14&quot;:{&quot;1&quot;:2,&quot;2&quot;:0},&quot;15&quot;:&quot;Open Sans&quot;,&quot;16&quot;:12}\"><a href=\"https:\/\/assignmentshark.com\/accounting-homework-help.html\" target=\"_blank\" rel=\"noopener\">free accounting homework help<\/a>,<\/span> or place an order and receive your personal Naive Bayes spam filter example to work with. Quality and on-time delivery are guaranteed. Student life becomes much easier with AssignmentShark.<\/em><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Naive Bayes classifier Naive Bayes classifier is one of the easiest classification algorithms. However, very often it works even better than the more complex algorithms. I want to share the C# code and a description of how it all works. And so, for example, I will take the problem of determining the type of the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53,35],"tags":[],"class_list":["post-4448","post","type-post","status-publish","format-standard","hentry","category-it","category-samples"],"_links":{"self":[{"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/posts\/4448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/comments?post=4448"}],"version-history":[{"count":14,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/posts\/4448\/revisions"}],"predecessor-version":[{"id":13547,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/posts\/4448\/revisions\/13547"}],"wp:attachment":[{"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/media?parent=4448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/categories?post=4448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/tags?post=4448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}