<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Leticia B on Medium]]></title>
        <description><![CDATA[Stories by Leticia B on Medium]]></description>
        <link>https://medium.com/@leticia.b?source=rss-cfbc5d19b373------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*NG0T83YDsa61uPQSWyAwWw.jpeg</url>
            <title>Stories by Leticia B on Medium</title>
            <link>https://medium.com/@leticia.b?source=rss-cfbc5d19b373------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 01:00:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@leticia.b/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Deeper Look into our Taste and Relationship with Music]]></title>
            <link>https://medium.com/@leticia.b/a-deeper-look-into-our-taste-and-relationship-with-music-f3d31d924610?source=rss-cfbc5d19b373------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3d31d924610</guid>
            <category><![CDATA[creativity]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[pscyhology]]></category>
            <category><![CDATA[spotify]]></category>
            <dc:creator><![CDATA[Leticia B]]></dc:creator>
            <pubDate>Thu, 20 Aug 2020 13:36:53 GMT</pubDate>
            <atom:updated>2020-12-05T01:58:10.552Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>written on march 22, 2020, but a work in progress</blockquote><p>We take so much pride in the music we like… As if we personally created the hits... As if we wrote the lyrics and produced the songs ourselves. In my opinion, people’s taste in music is one of the biggest glimpses into a person’s thoughts, beliefs, feelings, and interests. I find that people connect not only to the lyrics but the sounds, as well as the reputation and full repertoire of an artist.</p><p>During the recent weeks of the current coronavirus pandemic, I have been particularly interested in examining if and how people’s current taste and music vibe have changed during this time.</p><p>Spotify’s online blog, “For the Record”, highlighted similar ideas in two of their recent articles. They found that between April 1–7, there was a 54% increase in listeners making nostalgic-themed playlists (“Spotify Listeners Are Getting Nostalgic”, 2). They spoke with behavioral scientist, David DiSalvo, who then explained that “nostalgia is an extremely powerful force linked to memory… [and that] music, like smell, is one of those things with immediate access to that direct, nostalgic memory. It takes you back to that place” (“Spotify Listeners Are Getting Nostalgic”, 2). This doesn’t seem to be at all surprising given that throwbacks are usually the go-tos when trying to lighten the mood.</p><p>Spotify also found that many listeners are in a more “chill” music mood- more acoustic, less danceable, and a bit less upbeat than normal (“How Social Distancing,” 3). While intuitively this makes sense and an idea most of us can resonate with, I kept asking myself the following questions:</p><ul><li><strong><em>Why</em></strong> do we like certain kinds of music?</li><li><strong><em>Why</em></strong> do we choose to play certain music in certain moments of our day/life?</li></ul><p>In 2018, I read Daniel J. Levitin’s book “A Field Guide to Lies and Statistics” and found it both fascinating and informative. Last week, I stumbled upon another book of his called “This is Your Brain on Music”. I was intrigued to explore our relationship with music and was hoping to find more definite answers to my questions.</p><p>Levitin beautifully articulated my sentiment towards music by explaining that “understanding why we like music and what draws us to it is a window on the essence of human nature” (Levitin 7).</p><p>Levitin begins by explaining how we are first-ever introduced to music. Our exposure to music begins before we are even born. Fetuses’ auditory systems become fully functional about twenty weeks after conception. Research conducted by Alexandra Lamont of Keele University in the UK has found that even a year after we are born, we still recognize and prefer music we were exposed to in our mother’s wombs (Levitin 223). However, as we grow older, our taste in music grows with us. Our brains evolve, and so does the music we want to hear (Levitin 8).</p><p>Our musical preferences usually fortify during our transformative teenage years and become a true interest around the ages of ten or eleven (Levitin 231). Because these years are so pivotal in the development of our taste in music, it shouldn’t come as a surprise that when we think of music from “our time” and the music that triggers nostalgia, we tend to think about the music we listened to during our awkward days in junior high, rather than the music we listened to in our college years or early twenties. Levitin explains that we remember these songs primarily because our teenage years were “times of discovery, and as a consequence, were emotionally charged” (Levitin 231). Our brains are wired “to remember things that have an emotional component because our amygdala and neurotransmitters act in concert to “tag” the memories as something important” (231). I guess it now makes scientific sense why I’ll always remember my 6th-grade graduation song and be more emotionally attached to it than I should.</p><h3>Music’s power of vulnerability:</h3><p>As I mentioned initially, music tastes tend to give a glimpse into what someone is currently thinking, feeling, and/or doing at the moment. A person’s list of recently played songs can be very telling of his or her current mood. It explains why we choose the ‘private setting’ on Spotify if we are listening to something different from our usual vibe. Because even though we’re not saying it, they [the artists] are saying it <em>for</em> us. They are being vulnerable with us in a vast range of human emotions. And the more we can relate to an artist, the more likely we are to show a preference in their music:</p><blockquote>“Even when music doesn’t transport us to an emotional place that is transcendent, music can change our mood. We might be understandably reluctant, then, to let down our guard, to drop our emotional defenses, for just anyone. We will do so if the musicians and composers make us feel safe.” (243).</blockquote><p>When we listen to music at a party or get-together, we are listening to music collectively as a group. That listening experience is highly influenced by one’s surroundings and the general environment and mood of the party. Contrarily, when we listen to music on our own, the listening experience becomes much more personal. We tend to not only listen to the music playing, but to our minds as well. Levitin beautifully expresses this concept when retelling his experience with his first pair of headphones:</p><blockquote>“headphones made the music more personal for me; it was suddenly coming from inside my head, not out there in the world” (page 2).</blockquote><h3>Bonding through music:</h3><p>In a time when being physically together is not viable, people have turned to creating collaborative playlists. Music is an effective mechanism for social bonding and togetherness; music and musical preferences become a mark of personal and group identity (Levitin 232). It goes to show that the way in which music is introduced to us is also very telling as to whether we will like it or not. If someone special to you were to introduce you to certain kinds of music, I am almost positive you would end up liking it, regardless if it aligns with your usual music taste.</p><p>Spotify shared an analysis highlighting the spikes in streams for artists who have been live streaming concerts (How social distancing, 4). This supports the idea that people listen to certain kinds of music because they feel connected to the music and the artist. This pandemic has resulted in people being at their most vulnerable. Therefore, by seeing artists play in their own homes, listeners have been able to connect with them in a way that one might have previously never expected to.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><em>Questions that came to mind while reading other articles and writing this post:</em></p><p><em>Spotify has seen an increase in streaming music from the 50s, 40s, etc. However, I wonder what more information there is about those listeners. Are people in their 20s listening to music from the 80s? Their parents’ music they listened to while in the womb? Or is it people who grew up in the 80s listening to music from back then?</em></p><p><em>Regardless of what we consider our “traditional” music tastes, do you believe that if someone that was important to us introduced us to new music, we’d automatically like it?</em></p><p><em>Does going to concerts heighten your love for a specific artist? Does that one positive or negative experience completely alter your view of their music?</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3d31d924610" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A quick intro to NLP (Bag-of-Words Approaches)]]></title>
            <link>https://medium.com/@leticia.b/a-quick-intro-to-nlp-bag-of-words-approaches-8eaa8f2ce2fa?source=rss-cfbc5d19b373------2</link>
            <guid isPermaLink="false">https://medium.com/p/8eaa8f2ce2fa</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[bag-of-words]]></category>
            <dc:creator><![CDATA[Leticia B]]></dc:creator>
            <pubDate>Tue, 17 Jul 2018 15:33:34 GMT</pubDate>
            <atom:updated>2019-08-20T16:42:29.665Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>What is NLP?</em></strong></p><ul><li>Natural Language Processing (NLP) refers to computers making sense of everyday human (or “natural”) languages</li><li>Because NLP is processing large volumes of textual and speech data in natural languages that is not always perfectly structured, it has been programmed to work with disorder and context assumptions</li></ul><p><strong><em>Why is it important?</em></strong></p><ul><li>It can very quickly read through and make sense of everyday human languages</li></ul><p><strong><em>What does Bag of Words mean?</em></strong></p><ul><li>Bag of Words essentially takes text and finds trends and patterns and then bags words that correspond accordingly, while excluding grammar and order</li></ul><p><strong><em>What are the different Bag of Words approaches?</em></strong></p><h3><strong>1. CountVectorizer</strong></h3><ul><li>The Count Vectorizer, as stated in the name, <em>counts</em> how many times a word appears in a document</li><li>Considering there are many words in the human language that are very commonly used, for example, “the, a, and” etc., we can implement what is called “stop-words”</li><li>Stop-Words refrain from counting the common, but irrelevant words</li></ul><h3><strong>2. HashingVectorizer</strong></h3><ul><li>Hashing consists of converting text into random numbers</li><li>These numbers give the set of texts a specific identity so that if that string of text appears again, it quickly is converted to the same number or “hash”</li><li>Converting strings of text into numbers makes it easier and faster to look up</li><li>However, the issue with hash vectorizer is that you can’t undo the hashing, therefore, you could lose valuable information about the original text for future use</li></ul><h3><strong>3. TF-IDF</strong></h3><ul><li>TFIDF, or term frequency-inverse document frequency, scores the frequency of a word in a specific document compared to the entire corpus (or set of texts)</li></ul><p>a)<strong> TF-</strong>IDF</p><ul><li>The TF (term-frequency) part of the equation is depicted as followed:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/0*84W7EQ5cmeROWds2" /></figure><ul><li>Where N_term represents how many times a particular word appears in document d</li><li>And where N_terms in document represents how many words there all in document d</li></ul><p>b) TF-<strong>IDF</strong></p><ul><li>The IDF (Inverse Document frequency) is depicted as followed:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/0*Ybs9NtBV4IoZRkRF" /></figure><ul><li>Where N_documents represents the number of documents in the entire corpus</li><li>And where N_documents that contain term represents the number of documents in the corpus where that term appears</li></ul><h3>TF-IDF conclusion:</h3><ul><li>Thus, by multiplying these two equations together, we calculate the term frequency inverse document frequency or TFIDF which is useful for targeting rare words and weighing their importance in the document</li></ul><blockquote><em>So, what are the downsides to Bag-of-Words?</em></blockquote><ul><li>Some of the cons of ‘Bag of Words’ are due to the structure of human language</li><li>One major con of the bag of words model is that several words that are spelled the same but take on different meanings depending on how or when they are used (homographs) are treated like equals with the bag of words model</li><li>Word order is also disregarded by Bag of Words, so the word <strong>important</strong> in “not important” and “very important” is treated equally in both scenarios but takes on different meaning</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8eaa8f2ce2fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inspired by TED Talks]]></title>
            <link>https://medium.com/@leticia.b/inspired-by-ted-talks-3e715139cdd9?source=rss-cfbc5d19b373------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e715139cdd9</guid>
            <category><![CDATA[storytelling-with-data]]></category>
            <category><![CDATA[storytelling]]></category>
            <category><![CDATA[ted]]></category>
            <category><![CDATA[tedtalks]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Leticia B]]></dc:creator>
            <pubDate>Mon, 16 Jul 2018 18:01:08 GMT</pubDate>
            <atom:updated>2018-08-10T12:48:18.955Z</atom:updated>
            <content:encoded><![CDATA[<p>Before diving into my 12 week immersive full-time Data Science program, I stumbled upon the following TED talk by Tera Wang:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fembed.ted.com%2Ftalks%2Ftricia_wang_the_human_insights_missing_from_big_data&amp;display_name=TED&amp;url=https%3A%2F%2Fwww.ted.com%2Ftalks%2Ftricia_wang_the_human_insights_missing_from_big_data&amp;image=https%3A%2F%2Fpi.tedcdn.com%2Fr%2Ftalkstar-photos.s3.amazonaws.com%2Fuploads%2F22696ce9-3576-4f47-bb0d-e56ddbbef8a3%2FTriciaWang_2016X-embed.jpg%3Fh%3D316%26w%3D560&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=ted" width="560" height="316" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8b241451d4d62b9176208d2629d0c24/href">https://medium.com/media/b8b241451d4d62b9176208d2629d0c24/href</a></iframe><p>I absolutely loved her key points (side note: she also references one of my favorite apps, “Dark Sky”, that provides very accurate weather predictions given your exact location-very useful and exciting for someone who grew up in Miami where it would downpour one second and be sunny the next). Anyway, this TED talk confirmed my decision to move into the field of data science and created a framework for what I truly wanted to explore during my journey into the field.</p><p>Tricia Wang is a technology ethnographer who “studies and advises companies on the patterns of how people use technologies.” In her TED talk, she explores a critical question that has been asked by both techies and non-techies:</p><p>“Why is having more data not helping us make better decisions?”</p><p>People believe that all answers lie in the data and the more data you have, the more insight and results you will find that will catalyze company growth. However, the old saying still remains prominent: <strong>Quality</strong> <em>over</em> quantity. Always.</p><p>Throughout my course, I’ve been inspired to find the story hidden behind the data. Being behind a computer and studying the dataset from the comfort of your home, office, or classroom doesn’t make you an expert in the story. Behind every data point there’s a story that cannot be simply told by just the number you see on the screen. Data isn’t always going to perfectly fit a model. As Wang mentions:</p><blockquote>“data comes from quantifying very specific environments... [and] not all systems are as neatly contained.. especially systems that involve human beings… forces are complex and unpredictable [and] conditions are constantly changing”</blockquote><p>Numbers will continue being numbers and those numbers will continue being data points until the story is extracted… until you find the underlying meaning.</p><p>I appreciated this TED talk because in technology, many speakers focus too much on the algorithms used, the “black-box”, and the computer driven processes. This talk gives human <strong>meaning</strong> to the data stored in the computer: “relying on big data alone increases the chance we’ll miss something while giving us the illusion that we already know everything” (Wang). We have to make sure to continue integrating the human “stories, emotions and interactions that cannot be quantified” into our data and keep asking questions about the <strong>why.</strong></p><p>If we channel our own human experiences when we study the data and create models, I have no doubt our models will be more useful and telling.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e715139cdd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[D.C. Lab Project]]></title>
            <link>https://medium.com/@leticia.b/d-c-lab-project-3902dad8074d?source=rss-cfbc5d19b373------2</link>
            <guid isPermaLink="false">https://medium.com/p/3902dad8074d</guid>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Leticia B]]></dc:creator>
            <pubDate>Mon, 16 Jul 2018 18:00:55 GMT</pubDate>
            <atom:updated>2018-07-16T18:00:55.205Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Data Scientist: The Sexiest Job of the 21st Century”</blockquote><p>This quote has been thrown around often lately. It makes the job very appealing, but the truth is, it’s not always going to be the sexiest job. To get to the sexy part, you have to go through the not-so-sexy parts.</p><p>In our latest project, we partnered with D.C. Labs. My group was hoping to create a model that accurately predicts the resolution time of a 311 request in D.C. We were excited to hopefully find something interesting.</p><p>We first collected two years of 311 service request calls and then merged both a weather and neighborhood clustering dataset. After data cleaning and munging, we ran a few different models and found that the best fit model was a Random Forest Regression Model, and even then, our model predicted an R² score of 57.7%.</p><p>However, sometimes data science projects aren’t going to produce the best results and you might not always find what you’re looking for but there’s always something to take away from each project and in this situation, we found that some categories, like snow removal, had significantly high average resolution time (200+ days) and hence, the cases were never closed. We also found the most challenging part of the project to be an inconsistency in reporting and categorizing service call requests. Some categories were renamed from one year to the next which made it difficult to find useful findings. You can’t overlook data collection and sorting!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3902dad8074d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Foo Bar?]]></title>
            <link>https://medium.com/@leticia.b/why-foo-bar-2512c6ea79aa?source=rss-cfbc5d19b373------2</link>
            <guid isPermaLink="false">https://medium.com/p/2512c6ea79aa</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[foobar]]></category>
            <dc:creator><![CDATA[Leticia B]]></dc:creator>
            <pubDate>Mon, 16 Jul 2018 18:00:32 GMT</pubDate>
            <atom:updated>2018-07-16T18:00:32.041Z</atom:updated>
            <content:encoded><![CDATA[<p>Following the theme of my last post, I decided to explore another question I kept wondering: Why Foo Bar? Just like the number ‘42’, the term foo bar is universally used in the world of Data Science. They are used as placeholders for variables or functions.</p><p>But why are two random words, one that even sounds like a joke, so widely used?</p><p><strong>Foo</strong></p><p>The origin of foo is accredited to an American cartoonist, Bill Holmon, who claimed to have seen the word at the bottom of a Chinese figurine in San Francisco, CA. The word means “Good Luck.” He went on to incorporate the word in one of his comics, “Smokey Stover” in the mid 1900s. The term “foo” appeared for the first time in programming context in 1960 when the Tech Model Railroad Club of MIT replaced all displays with FOO whenever a scram switch occurred. Five years later, the word reappeared when MIT’s Tech Engineering News wrote “Foobar” in one of its publications. This was the first time the two words were used together.</p><p>It is also believed that the term FooBar could have possibly been derived from the military term FUBAR meaning (F***ed up Beyond all Recognition). I’m not sure how convinced I am about this belief however.</p><p>While I now have an answer as to where the terms gained popularity, I’m still frazzled as to why a word from a comic and/or a military term ended up in the hands of programmers and has gained so much traction.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2512c6ea79aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Story of Seed(42)]]></title>
            <link>https://medium.com/@leticia.b/the-story-of-seed-42-874953452b94?source=rss-cfbc5d19b373------2</link>
            <guid isPermaLink="false">https://medium.com/p/874953452b94</guid>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Leticia B]]></dc:creator>
            <pubDate>Mon, 16 Jul 2018 18:00:04 GMT</pubDate>
            <atom:updated>2018-07-16T18:00:04.598Z</atom:updated>
            <content:encoded><![CDATA[<p>While learning about random seeds in Data Science, it was evident that the number 42 was used by default: in every lecture, Stack Overflow post, instructional video, etc. But WHY 42 you ask?</p><p>Because Data Scientists love numbers and love movies that refer to computers and numbers, it shouldn’t have come as a surprise to me that the number 42 become universally used because of a Sci-Fi movie/book: The Hitchhiker’s Guide to the Galaxy. In the novel, a group of geniuses seek to find the answer to the Ultimate Question of Life, The Universe, and Everything. They turn to a city-sized computer, Deep Thought, to try to obtain the answer. Seven and a half million years later, the computer spits out the number 42. However, the “ultimate question” is still unknown. And funnily enough, when you search “Answer to the Ultimate Question of Life, the Universe, and Everything” Google directs you to the built-in calculator that reads ‘42’. So moral of the story, don’t ask questions. The answer is always 42.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=874953452b94" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quick Explanation of the Naïve Bayes’ Model]]></title>
            <link>https://medium.com/@leticia.b/na%C3%AFve-bayes-model-5a5b254a5d3?source=rss-cfbc5d19b373------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a5b254a5d3</guid>
            <category><![CDATA[naive-bayes]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[applied-statistics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Leticia B]]></dc:creator>
            <pubDate>Mon, 16 Jul 2018 17:52:55 GMT</pubDate>
            <atom:updated>2020-04-11T03:58:11.758Z</atom:updated>
            <content:encoded><![CDATA[<p>There are two primary models in Machine Learning: Regression and Classification. In regression models, the output variable is continuous whereas the in classification models, the output variable is discrete. In this post, I will be delving deeper into one of the more common, yet effective models: Naïve Bayes.</p><p>The Naïve Bayes’ Model is based off the theorem of Naïve Bayes that is built off a few simple probability rules.</p><p><strong>Firstly</strong>,</p><p>The probability of no given event occurring is zero since the event has no outcomes. This rule is written as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/156/1*Tk2Y9xdum4BYoBQgFp8wYA.png" /></figure><p>where Ø indicates the “empty set.”</p><p><strong>Secondly</strong>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*sNGOHbSfzwOISAmNpcfLvw.png" /></figure><p>We can visually think of this with the following venn diagram. But note that a venn diagram is <strong>never </strong>a proof.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7422bdf977a778611b8d9e864e96bf77/href">https://medium.com/media/7422bdf977a778611b8d9e864e96bf77/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*LjaB_MxfhfkYhs68Ad5WYg.png" /></figure><p><strong>Thirdly,</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*bTB1qSf0M5cVTPa1yIwyjw.png" /></figure><p>A|B is translated into “A given B” or the chance of A occurring given that B occurred</p><p><strong>Next</strong>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*-30wgvYAQNPHO7g8R7xglA.png" /></figure><p>This rule is derived from the previous rule by just multiplying P(B) to both sides.</p><p>To put conditional probability into context, suppose you have a deck of 52 cards and you are calculating the probability of drawing an Ace (Event B) given that the first person already drew an Ace (Event A).</p><p>The chance of the first person drawing an Ace, since no one had drawn yet, was 4/52 since there are 4 Aces total in a deck of cards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/172/1*DAn6OIfcElrAqedLodhGVg.png" /></figure><p>You’re up next. You already know the first person drew an Ace and therefore your chances of drawing one will be lesser since now there are only three Aces remaining as well (3 instead of 4) as one less card in the deck (51 instead of 52).</p><p>Your probability of drawing an Ace is therefore denoted as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*toKd5DUSLqMFja9y2dWnMA.png" /></figure><p>Which indicates that the chance of both Event A to happen and Event B is about .5% of 1/221:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*Eq6si0a8rxdi2biaRJNhmA.png" /></figure><p>And for the grand finale, we have what is known as the <strong>Law of Total Probability:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*0ek1DK8ym31AotNcbYBZDA.png" /></figure><p>This rule is fundamental to expressing the relationship between marginal and conditional probabilities. It covers the probability of an outcome occurring according to various different events.</p><p>Now, that we have covered the basis of our probability rules, we are ready to learn Bayes’ Theorem and its application!</p><p><strong>Bayes’ Theorem</strong>, denoted as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*GP1EAkMT2KAFKPDyPR_XaA.png" /></figure><p>P(A) represents the probability of event A occurring</p><p>P(B) represents the probability of event B occurring</p><p>P(B|A)= P(B) given P(A)</p><p>P(A|B)= P(A) given P(B)</p><p><strong>Application of the Theorem:</strong></p><p>In Machine Learning, Bayes’ Theorem is used regularly with text data. One of its applications can be represented in a basic classification problem of whether an e-mail falls under the class “spam” or “ham.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*VYoiwMkdPDBGb_XCnzAELQ.png" /></figure><p>To translate this equation into plain English, we are calculating the probability of an e-mail being spam given the words that appear in that e-mail.</p><p>If we were to apply our rules of probability, this equation gets further broken down to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*KYrZgICC32cJQUBQySPwyA.png" /></figure><p>As we can see, this equation gets very complex and lengthy.</p><p>And <em>NOW</em> is when the Naïve Bayes Model comes into play!</p><p>In order to simplify the equation above, we apply the Naïve Bayes classification algorithm that is a classification model method created on the idea of Naïve Bayes Theorem. There is, however, one underlying issue:</p><p>It makes one unrealistic assumption: All our features are independent of one another. This is unrealistic because for example, in the case of words in an e-mail, many of the words will be correlated with one another.</p><p>By making this assumption, what before was this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*BUArizoxohMKWMBiZSBobg.png" /></figure><p>now gets simplified to this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*oGSBvpzuDj2Jdm6aos7-3w.png" /></figure><p>So, you might be thinking that this is a lot easier to work with is and you’re absolutely correct which is precisely why it is used so often in Machine Learning, especially text analysis such as our example above. Although the model is definitely not perfect due to its unrealistic assumption, it increases computational efficiency and produces surprisingly accurate classifications!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a5b254a5d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>