<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Ask Ghassem - Recent questions tagged naive-bayes</title>
<link>https://ask.ghassem.com/tag/naive-bayes</link>
<description>Powered by Question2Answer</description>
<item>
<title>How to calculate the class probabilities and classify using Naive Bayes classifier?</title>
<link>https://ask.ghassem.com/899/calculate-class-probabilities-classify-using-classifier</link>
<description>&lt;p&gt;We have data on 1000 pieces of fruit. The fruit being a Banana, Orange or some Other fruit and imagine we know 3 features of each fruit, whether it’s long or not, sweet or not and yellow or not, as displayed in the table below:&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://i.imgur.com/gOFzVXL.png&quot;&gt;https://i.imgur.com/gOFzVXL.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A&amp;nbsp;piece of an unknown fruit with these features are provided:&amp;nbsp;Long, Sweet and Yellow.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calculate probability of each of these 3 classes based on Naive Bayes Classification algorithm and report the class.&lt;/strong&gt;&lt;/p&gt;</description>
<category>Machine Learning</category>
<guid isPermaLink="true">https://ask.ghassem.com/899/calculate-class-probabilities-classify-using-classifier</guid>
<pubDate>Mon, 10 Aug 2020 21:26:28 +0000</pubDate>
</item>
<item>
<title>How to calculate the class probabilities and classify using Naive Bayes classifier for NLP?</title>
<link>https://ask.ghassem.com/654/calculate-class-probabilities-classify-using-classifier</link>
<description>&lt;p&gt;We want to use Naive Bayes for tagging documents. It is a classification task that we want to assign a class (tag) to each string. We currently have two tags: &lt;strong&gt;Sport &lt;/strong&gt;and&lt;strong&gt; &lt;/strong&gt;&lt;strong&gt;Not Sport&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Which tag does the sentence&amp;nbsp;&lt;strong&gt;&lt;em&gt;A very close game&lt;/em&gt;&amp;nbsp;&lt;/strong&gt;belong to? Using Naive Bayes classifier, calculate the class probability for &lt;strong&gt;Sport&lt;/strong&gt; and &lt;strong&gt;Not sport &lt;/strong&gt;for this sentence based on&amp;nbsp;the dataset and decide about the tag.&lt;/p&gt;

&lt;table border=&quot;1px&quot; cellpadding=&quot;1px&quot; style=&quot;width:500px&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Text&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Tag&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;“A great game”&lt;/td&gt;
&lt;td&gt;Sports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;“The election was over”&lt;/td&gt;
&lt;td&gt;Not sports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;“Very clean match”&lt;/td&gt;
&lt;td&gt;Sports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;“A clean but forgettable game”&lt;/td&gt;
&lt;td&gt;Sports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;“It was a close election”&lt;/td&gt;
&lt;td&gt;Not sports&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description>
<category>Machine Learning</category>
<guid isPermaLink="true">https://ask.ghassem.com/654/calculate-class-probabilities-classify-using-classifier</guid>
<pubDate>Wed, 26 Jun 2019 19:43:41 +0000</pubDate>
</item>
<item>
<title>Is Naive Bayes a good classifier?</title>
<link>https://ask.ghassem.com/264/is-naive-bayes-a-good-classifier</link>
<description>&lt;p&gt;Here is an example of training a model using the Naïve Bayes classifier on the Glass dataset(from UCI). The objective is to predict the type of glass based on the 9 parameters. The metric used to understand the classification result are confusion matrix and classification report.&lt;/p&gt;

&lt;p&gt;The program is available &lt;a rel=&quot;nofollow&quot; href=&quot;https://repl.it/@haroldj/NaiveBayesClassifier&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Few Observations/ Questions&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;By Varying the ‘random_state’ value inside the function train_test_split, we can observe different accuracy values? Is the behavior correct?&lt;/li&gt;
	&lt;li&gt;The StratfiedShuffle method of &amp;nbsp;train_test_split also produces random results on the every run. Is there a bug with Naïve Bayes classifier implementation?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>Machine Learning</category>
<guid isPermaLink="true">https://ask.ghassem.com/264/is-naive-bayes-a-good-classifier</guid>
<pubDate>Thu, 04 Oct 2018 00:23:00 +0000</pubDate>
</item>
<item>
<title>What is Bayes’ Theorem? How is it useful in machine learning? Where should we use it?</title>
<link>https://ask.ghassem.com/165/what-bayes-theorem-how-useful-machine-learning-where-should</link>
<description></description>
<category>Machine Learning Interview Questions</category>
<guid isPermaLink="true">https://ask.ghassem.com/165/what-bayes-theorem-how-useful-machine-learning-where-should</guid>
<pubDate>Thu, 27 Sep 2018 05:27:55 +0000</pubDate>
</item>
</channel>
</rss>