<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bayes theorem Archives - Creatronix</title>
	<atom:link href="https://creatronix.de/tag/bayes-theorem/feed/" rel="self" type="application/rss+xml" />
	<link>https://creatronix.de/tag/bayes-theorem/</link>
	<description>My adventures in code &#38; business</description>
	<lastBuildDate>Fri, 27 Feb 2026 11:15:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>10 things I didn&#8217;t know about Data Science a year ago</title>
		<link>https://creatronix.de/10-things-i-didnt-know-about-data-science-a-year-ago/</link>
		
		<dc:creator><![CDATA[Jörn]]></dc:creator>
		<pubDate>Mon, 12 Nov 2018 08:42:26 +0000</pubDate>
				<category><![CDATA[Data Science & SQL]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[ai]]></category>
		<category><![CDATA[Bayes theorem]]></category>
		<category><![CDATA[data science]]></category>
		<category><![CDATA[machine learning]]></category>
		<category><![CDATA[matplotlib]]></category>
		<category><![CDATA[naive bayes]]></category>
		<category><![CDATA[numpy]]></category>
		<category><![CDATA[opencv]]></category>
		<guid isPermaLink="false">http://creatronix.de/?p=2269</guid>

					<description><![CDATA[<p>In my article My personal road map for learning data science in 2018 I wrote about how I try to tackle the data science knowledge sphere. Due to the fact that 2018 is slowly coming to an end I think it is time for a little wrap up. What are the things I learned about&#8230;</p>
<p>The post <a href="https://creatronix.de/10-things-i-didnt-know-about-data-science-a-year-ago/">10 things I didn&#8217;t know about Data Science a year ago</a> appeared first on <a href="https://creatronix.de">Creatronix</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In my article <a href="https://creatronix.de/my-personal-road-map-for-learning-data-science/">My personal road map for learning data science in 2018</a> I wrote about how I try to tackle the data science knowledge sphere. Due to the fact that 2018 is slowly coming to an end I think it is time for a little wrap up.</p>
<p>What are the things I learned about Data Science in 2018? Here we go:</p>
<h2>The difference between Data Science, Machine Learning, Deep Learning and AI</h2>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-2276" src="https://creatronix.de/wp-content/uploads/2018/10/data_science_vs_ml.png" alt="" width="514" height="392" srcset="https://creatronix.de/wp-content/uploads/2018/10/data_science_vs_ml.png 514w, https://creatronix.de/wp-content/uploads/2018/10/data_science_vs_ml-300x229.png 300w" sizes="(max-width: 514px) 100vw, 514px" /></p>
<p>A picture says more than a thousand words.</p>
<h2>The difference between supervised and unsupervised learning</h2>
<p><em>Supervised Learning</em></p>
<p>You have training and test data with <strong>labels</strong>. Labels tell You to which e.g. class a certain data item belongs. Image you have images of pets and the labels are the name of the pets.</p>
<p><em>Unsupervised Learning</em></p>
<p>Your data doesn’t have labels. Your algorithm e.g. k-means clustering need to figure out a structure given only the data</p>
<h2>The areas of applied machine learning</h2>
<p>are described here: <a href="https://creatronix.de/the-essence-of-machine-learning/">The Essence of Machine Learning </a>and <a href="https://creatronix.de/data-science-overview/">Data Science Overview</a></p>
<h2>Bayes Theorem</h2>
<p>In my article <a href="https://creatronix.de/bayes-theorem/">Bayes theorem</a> I elaborated about the <strong>base rate fallacy </strong>and in <a href="https://creatronix.de/lesson-2-naive-bayes/">naive bayes</a> I recapped the second lesson from udacity&#8217;s <a href="https://creatronix.de/ud120-intro-to-machine-learning/">UD120 Intro to Machine Learning</a></p>
<h2>Precision and Recall and ROC</h2>
<p>In my article <a href="https://creatronix.de/classification-precision-and-recall/">classification: precision and recall</a> I wrote about different useful measures to evaluate the quality of a supervised learning algorithm.</p>
<p>In <a href="https://creatronix.de/receiver-operating-characteristic/">Receiver Operating Characteristic</a> I wrote about another useful measures the ROC.</p>
<h2>Visualization with matplotlib</h2>
<p>Matplotlib is a really good starting point for visualization. I wrote about it in <a href="https://creatronix.de/introduction-to-matplotlib/">Introduction to matplotlib</a>, <a href="https://creatronix.de/introduction-to-matplotlib-part-2/">Matplotlib &#8211; Part 2</a>, <a href="https://creatronix.de/scatterplot-with-matplotlib/">Scatterplot with matplotlib</a></p>
<h2>Math with numpy</h2>
<p>I wrote some articles about the usage of numpy but only scraped the surface of this mighty library</p>
<ul>
<li><a href="https://creatronix.de/linear-algebra-with-numpy-part-1/">Linear Algebra with numpy &#8211; Part 1</a></li>
<li><a href="https://creatronix.de/numpy-random-choice/">numpy random choice</a></li>
<li><a href="https://creatronix.de/numpy-linspace-function/">Numpy linspace function</a></li>
</ul>
<h2>Image manipulation with OpenCV</h2>
<p><a href="https://creatronix.de/intro-to-opencv-with-python/">Intro to OpenCV with Python</a></p>
<h2>JuPyter Notebooks</h2>
<p>Sometimes I love them sometimes I hate them. I wrote an <a href="https://creatronix.de/introduction-to-jupyter-notebook/">Introduction to JuPyter Notebook</a></p>
<h2>Podcasts</h2>
<p>In 2018 I&#8217;ve listened to a bunch of great podcasts on iTunes:</p>
<ul>
<li><a href="https://lineardigressions.com/">Linear digressions</a></li>
<li><a href="https://lexfridman.com/ai/">MIT Lex Fridman</a></li>
<li><a href="https://itunes.apple.com/de/podcast/self-driving-cars-dr-lance-eliot-podcast-series/id1330558096?mt=2">Dr. Lance Eliot</a></li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://creatronix.de/10-things-i-didnt-know-about-data-science-a-year-ago/">10 things I didn&#8217;t know about Data Science a year ago</a> appeared first on <a href="https://creatronix.de">Creatronix</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Bayes’ Theorem</title>
		<link>https://creatronix.de/bayes-theorem/</link>
		
		<dc:creator><![CDATA[Jörn]]></dc:creator>
		<pubDate>Sun, 03 Dec 2017 16:26:26 +0000</pubDate>
				<category><![CDATA[Data Science & SQL]]></category>
		<category><![CDATA[base rate fallacy]]></category>
		<category><![CDATA[Bayes theorem]]></category>
		<category><![CDATA[data science]]></category>
		<guid isPermaLink="false">https://creatronix.de/?p=1171</guid>

					<description><![CDATA[<p>Imagine that you come home from a party and you are stopped by the police. They ask you to take a drug test and you accept. The test result is positive. You are guilty. But wait a minute! Is it really that simple? In Germany about 2.8 million people consume weed on a regular basis,&#8230;</p>
<p>The post <a href="https://creatronix.de/bayes-theorem/">Bayes’ Theorem</a> appeared first on <a href="https://creatronix.de">Creatronix</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Imagine that you come home from a party and you are stopped by the police. They ask you to take a drug test and you accept. The test result is positive. You are guilty.</p>
<p>But wait a minute! Is it really that simple?</p>
<p>In Germany about 2.8 million people consume weed on a regular basis, that&#8217;s about 3.5% of the population.</p>
<p>Let&#8217;s say D is drug addict and consumes weed regularly, ¬D consumes no weed. So the chance by randomly picking a person that he or she is a drug addict is P(D) = 0.035</p>
<p>Because You either take drugs or you don&#8217;t the remaining part must be non-drug takers P(¬D) = 1 &#8211; P(D) = 0.965.</p>
<p>The accuracy of a drug test is about 92%. So let&#8217;s assume that there are 8% false positives and 8% false negatives as well.</p>
<p>The chance that if a person actually takes drugs the test result will be positive is P(+|D) = 0.92 but You also get a positive reuslt when a person doesn&#8217;t take drugs in 8% of all cases: P(+|¬D) = 0.08 These are called &#8220;False positives&#8221;.</p>
<p>When a person doesn&#8217;t take drugs the test will be negative in 92% of all cases P(-|¬D) = 0.92.  And of course a test can also be negative even if a person takes drugs P(-|D) = 0.08. these are called &#8220;False negatives&#8221;. Got it?</p>
<p>What comes next?</p>
<p>Combined Probabilities</p>
<p>Knowing the success and error rates of the test and the relative distribution of drug consumers we can calculate the combined probabilities:</p>
<ul>
<li>P(+, D) = 0.035 * 0.92 = 0.0322</li>
<li>
<ul>
<li>Think: The test is <strong>positive AND</strong> the person is a drug user</li>
</ul>
</li>
<li>P(+, ¬D) = 0.965 * 0.08 = 0.0772</li>
<li>
<ul>
<li>Think: The test is <strong>positive AND</strong> the person is <strong>NOT</strong> a drug user</li>
</ul>
</li>
<li>P(-, D) = 0.035 * 0.08 = 0.0028</li>
<li>
<ul>
<li>Think: The test is <strong>negative AND</strong> the person is a drug user</li>
</ul>
</li>
<li>P(-, ¬D) = 0.965 * 0.92 = 0,8878</li>
<li>
<ul>
<li>Think: The test is <strong>negative AND</strong> the person is <strong>NOT</strong> a drug user</li>
</ul>
</li>
</ul>
<h2>Bayes Theorem</h2>
<p>P(A|B) = P(B|A) * P(A) / P(B)</p>
<p>In our case we are interested in the probability of a person being a drug addict given the test is positive. That means:</p>
<p>P(D | +) = P(+ | D) * P(D) / P(+) = P(+ | D) * P(D) / ( P(+, D) + P(+, ¬D) )</p>
<p>= 0.92 * 0.035 / (0.0322 + 0.0772) = <strong>0.294</strong></p>
<p>The outcome is quite interesting and mildly shocking: The probability that a person tested positively is actually a drug addict is only around 29% or less than one third!</p>
<p>Why is this so counter intuitive, when the test states an accuracy of 92%?  That is the so called <strong>base rate fallacy</strong>. We have to take into account that only 3.5% of the population actually take drugs.</p>
<p>More read about drug tests</p>
<p><a href="https://www.webmd.com/drug-medication/news/20100528/drug-tests-often-trigger-false-positives#1">Drug tests generally produce false-positive results in 5% to 10% of cases and false negatives in 10% to 15% of cases, new research shows.</a></p>
<p>The post <a href="https://creatronix.de/bayes-theorem/">Bayes’ Theorem</a> appeared first on <a href="https://creatronix.de">Creatronix</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
