<?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 Alicia Horsch on Medium]]></title>
        <description><![CDATA[Stories by Alicia Horsch on Medium]]></description>
        <link>https://medium.com/@aliciahorsch?source=rss-ba4ebbd0afd2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*R9Py39Fgz10JDIygSdUuEA.jpeg</url>
            <title>Stories by Alicia Horsch on Medium</title>
            <link>https://medium.com/@aliciahorsch?source=rss-ba4ebbd0afd2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 14:50:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aliciahorsch/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[Effective coding with dates and times in Python]]></title>
            <link>https://medium.com/data-science/effective-coding-with-dates-and-times-in-python-3be13a77b45b?source=rss-ba4ebbd0afd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3be13a77b45b</guid>
            <category><![CDATA[time-series-analysis]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[datetime]]></category>
            <dc:creator><![CDATA[Alicia Horsch]]></dc:creator>
            <pubDate>Sat, 26 Aug 2023 13:03:46 GMT</pubDate>
            <atom:updated>2023-08-26T15:24:23.238Z</atom:updated>
            <content:encoded><![CDATA[<h4>Making use of datetime, zoneinfo, dateutil and pandas</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BwpjUD7SucInlsds5Vwmbw.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@bentonphotocinema/">Jordan Benton</a> from <a href="https://www.pexels.com/photo/shallow-focus-of-clear-hourglass-1095601/">Pexels</a></figcaption></figure><p>I have been working extensively with time series data lately and have dealt with date and time objects in Python. For this, I have learned some useful tricks for working with <em>datetime</em> objects in Python that removed complexity from my code. In this article, I would like to share and summarise the most valuable tips and tricks I learned.</p><p>For demonstration, I will use two Kaggle datasets, which I will link when I use them. If you want to follow along, you can import the following libraries.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0aac1542a5a2b514315eb1e8659041e/href">https://medium.com/media/b0aac1542a5a2b514315eb1e8659041e/href</a></iframe><h3>Datetime, zoneinfo, dateutil and pytz</h3><p>Commonly used packages that deal with dates and times in Python are <em>datetime, dateutil, pytz </em>and the <a href="https://docs.python.org/3/library/zoneinfo.html">recent<em> zoneinfo</em></a>. <em>Datetime</em> is the built-in module for working with times and dates in Python and lets you do most of the basics. <em>Dateutil </em>and<em> pytz </em>are third-party modules and powerful extensions to <em>datetime</em> when dealing with more complex manipulations like relative time deltas, time zones, and parsing of strings.</p><p>However, since Python version 3.9, <a href="https://docs.python.org/3/library/zoneinfo.html"><em>zoneinfo</em></a>, is incorporated in the Python Standard Library and, therefore, is considered “more convenient” for <strong>timezone support</strong> compared to other third-party modules like <em>dateutil</em> or <a href="https://docs.python.org/3/library/zoneinfo.html"><em>pytz</em></a>.</p><blockquote><em>So, depending on the Python version you are working with, the Python built-in modules might be already sufficient and no third-party modules (</em>dateutil<em> and </em>pytz<em>) are needed when dealing with </em><strong><em>different timezones</em></strong><em>!</em></blockquote><p>In the remainder of the article, I will focus mostly on handling dates and times with <em>datetime</em> but will also mention potential options for <em>zoneinfo</em> or <em>dateutil</em>. The article will first focus on single <em>datetime</em> objects, followed by dealing with dates in arrays and data frames using <em>numpy</em> and <em>pandas</em>:</p><ol><li>Creating a date or datetime from scratch</li><li>Converting to and parsing strings: strftime(), strptime() and dateutil</li><li>Dates and times in <em>numpy</em> — numPy’s datetime64</li><li>Dates and times in <em>pandas</em></li><li>Creating features from dates and times</li></ol><h3>1. Creating a date or datetime from scratch</h3><p>The <em>datetime</em> package lets you create date and datetime objects easily from scratch that can be used, for example, as thresholds for filtering (try printing the created objects below and their types to better understand their format).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/639223d29764c0267bffae782c9ebba3/href">https://medium.com/media/639223d29764c0267bffae782c9ebba3/href</a></iframe><p>Also, <em>datetime</em> lets you create date and time objects that refer to today or now.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f025b0e3adc45431c1e2869ff8e00ef6/href">https://medium.com/media/f025b0e3adc45431c1e2869ff8e00ef6/href</a></iframe><blockquote><em>Be careful here, as </em>datetime<em> objects are usually “timezone naive” and do not refer to a specific time zone, which may get you into trouble when working with international colleagues!</em></blockquote><p>With the help of the <em>zoneinfo</em> module (built-in since Python version 3.9), you can set the timezone with the <em>tz</em> parameter of <em>astimezone().</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de09ec05ca26f927a78173ad535658bd/href">https://medium.com/media/de09ec05ca26f927a78173ad535658bd/href</a></iframe><h3>2. Converting to and parsing strings: strftime(), strptime() and dateutil</h3><p>You might find yourself in a situation where you want to display your <em>datetime</em> object as a string or convert a string into a <em>datetime</em> object. Here, the functions <em>strftime()</em> and <em>strptime()</em> are helpful.</p><h4>Converting a datetime object (or parts of it) to a string</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9576d97aa595eb78e3edc1d7dd60b4c0/href">https://medium.com/media/9576d97aa595eb78e3edc1d7dd60b4c0/href</a></iframe><p>Commonly used format codes for describing datetime objects can be found <a href="https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes">here</a>.</p><h4>Converting a string into a datetime object</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce5198416a77e3fb67177e68b1d94e29/href">https://medium.com/media/ce5198416a77e3fb67177e68b1d94e29/href</a></iframe><h4>Parsing complex strings using dateutil</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19df75959729008c93331567b6e2e79b/href">https://medium.com/media/19df75959729008c93331567b6e2e79b/href</a></iframe><h3>3. Dates and times in numpy - numPy&#39;s datetime64</h3><p>If you are handling large datasets, <em>numpy’s</em> datetime64 may come in handy as, due to its design, it can be much faster than working with <em>datetime</em> and <em>dateutil</em> objects. The datetime64 data type in <em>numpy</em> encodes dates and times as 64-bit integers.</p><p>This stores dates and times compactly and allows vectorized operations (repeated operations applied to each element of a numpy array).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9ee5094ffb7edc66ce7d40369d12a19/href">https://medium.com/media/a9ee5094ffb7edc66ce7d40369d12a19/href</a></iframe><p>As you can see when running the code above, with a <em>datetime</em> or <em>dateutil</em> object, vectorized operations will give you an error.</p><h3>4. Dates and times in pandas</h3><p><em>Pandas</em> can be a good choice when working on a time series data project.</p><blockquote><em>The famous data-wrangling library </em>pandas<em> combines the convenience of </em>datetime<em> and </em>dateutil<em> with the effective storing and manipulation possibility from </em>numpy<em>.</em></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/15b062c4b351c330860635dae2b70755/href">https://medium.com/media/15b062c4b351c330860635dae2b70755/href</a></iframe><h4>Create a pandas dataframe (from CSV) parsing a date column</h4><p>Now, we have a basic understanding of handling dates and times in Python using <em>numpy</em> and <em>pandas</em>. However, often, we do not create dates and times ourselves, but they are already part of the dataset we are dealing with. Let’s create a <em>pandas</em> data frame with a date column (<a href="https://www.kaggle.com/c/nfl-big-data-bowl-2022/data?select=games.csv">Kaggle dataset NFL</a>).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7566ea573b79816b67e8013d51f06601/href">https://medium.com/media/7566ea573b79816b67e8013d51f06601/href</a></iframe><p>As you can see, when loading from a CSV, the column that holds a date is turned into a string format if not specified anywhere precisely. To receive the date format, you could create an extra column called “gameDate_dateformat” or directly pass the date column through the parameter <em>parse_dates</em> in pd.read_csv().</p><p>Another handy manipulation when working with time series data is to be able to filter by date/time or subsetting a data frame using date/time. There are two methods to do this: filtering/subsetting or indexing.</p><h4>Filtering pandas data frames by time</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1bf346581b47f3c8971b2119e18ed571/href">https://medium.com/media/1bf346581b47f3c8971b2119e18ed571/href</a></iframe><blockquote><em>Make sure that the threshold date you use for subsetting has the same format as the column!</em></blockquote><p>If the column you want to filter by has the format datetime (like in the example), the comparison date cannot be a date but needs to have a datetime format!</p><h4>Indexing pandas data frames by time</h4><p>Even more powerful is indexing a <em>pandas</em> data frame by date or time.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be885a595ffafa0b2744dd466aa21d0e/href">https://medium.com/media/be885a595ffafa0b2744dd466aa21d0e/href</a></iframe><p>Indexing can be especially useful when working with time series, as there are methods like rolling windows and time-shifting.</p><h3>5. Creating features from dates and times</h3><p>Often, we are not interested in the date itself but maybe the duration, the weekday, or just a part of the datetime, e.g. the year. For this, <em>datetime</em> but also <em>pandas</em> provide some useful manipulations.</p><h4>Timedelta</h4><p>With <em>pandas</em>, you can calculate, for example, the difference between two datetimes. For this, we will look at a different dataset of Uber trips (<a href="https://www.kaggle.com/datasets/zusmani/uberdrives/code?resource=download">Kaggle dataset Uber</a>) with a start and an end timestamp. Some preprocessing is needed (delete the Total Row) to start looking into timedelta.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/feaba1f1b85ff4dacde1916866f6e905/href">https://medium.com/media/feaba1f1b85ff4dacde1916866f6e905/href</a></iframe><h4>Extract the weekday or the month</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c27067ac8d9b80e2b593cef8cb9d76f7/href">https://medium.com/media/c27067ac8d9b80e2b593cef8cb9d76f7/href</a></iframe><p>This works slightly differently for the single <em>datetime</em> versus the <em>pandas</em> Series. While the weekday or the month of the single <em>datetime</em> object can be directly accessed by adding an attribute (e.g., <em>.month</em>) or method (e.g., <em>weekday()</em>), the <em>pandas</em> Series always needs the <em>.dt</em> accessor.</p><blockquote><em>The </em>dt. accessor<em> allows you to access datetime-specific attributes and methods from a </em>datetime<em> Series.</em></blockquote><h4>Create a date/time lag</h4><p>Another helpful manipulation for time series data could be to add an extra column that adds a lag of a date or datetime.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3927308c4b9ed23e7b14663c4ad025b7/href">https://medium.com/media/3927308c4b9ed23e7b14663c4ad025b7/href</a></iframe><h3>Summary</h3><p>To work with date or time objects in Python, knowing the basics of the built-in package <em>datetime</em> (e.g. <em>date()</em> or <em>strftime()</em> and <em>strptime()</em>) are beneficial. <em>Zoneinfo</em> is a new built-in package (since version 3.9) which is more convenient than third-party modules when working with different time zones. <em>Dateutil</em> is a valuable library for more advanced date and time manipulations when working with single date objects, e.g., parsing complex strings. When working with dates and times in data frames, Series, or arrays, <em>pandas</em> combines the benefits of <em>datetime</em>, <em>dateutil</em>, and <em>numpy</em> and serves as a convenient library.</p><h4>Sources</h4><ul><li>Modern Python Standard Library — Cookbook by Alessandro Molina (2018)</li><li>Python Data Science Handbook by Jake VanderPlas (2017)</li><li>Datacamp course: Working with Dates and Times in Python (2022)</li><li><a href="https://dateutil.readthedocs.io/en/stable/">https://dateutil.readthedocs.io/en/stable/</a></li><li><a href="https://docs.python.org/3/library/datetime.html">https://docs.python.org/3/library/datetime.html</a></li><li><a href="https://docs.python.org/3/library/zoneinfo.html">https://docs.python.org/3/library/zoneinfo.html</a></li><li><a href="https://peps.python.org/pep-0615/">https://peps.python.org/pep-0615/</a></li><li><a href="https://github.com/stub42/pytz/blob/master/src/README.rst#issues--limitations">https://github.com/stub42/pytz/blob/master/src/README.rst#issues--limitations</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3be13a77b45b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/effective-coding-with-dates-and-times-in-python-3be13a77b45b">Effective coding with dates and times in Python</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hypothesis testing for data scientists]]></title>
            <link>https://medium.com/data-science/hypothesis-testing-for-data-scientists-everything-you-need-to-know-8c36ddde4cd2?source=rss-ba4ebbd0afd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c36ddde4cd2</guid>
            <category><![CDATA[parametric-tests]]></category>
            <category><![CDATA[non-parametric]]></category>
            <category><![CDATA[frequentists]]></category>
            <category><![CDATA[data-science-training]]></category>
            <category><![CDATA[hypothesis-testing]]></category>
            <dc:creator><![CDATA[Alicia Horsch]]></dc:creator>
            <pubDate>Mon, 24 May 2021 17:34:59 GMT</pubDate>
            <atom:updated>2021-05-24T20:07:17.461Z</atom:updated>
            <content:encoded><![CDATA[<h4>The frequentist approach</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OMR-Fzb1IvVqi8pWLo5ew.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@anna-nekrashevich?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Anna Nekrashevich</a> from <a href="https://www.pexels.com/photo/pen-business-eyewear-research-6801648/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><p>Hypothesis testing is a common statistical tool used in research and data science to support the certainty of findings. The aim of testing is to answer how probable an apparent effect is detected by chance given a random data sample. This article provides a detailed explanation of the key concepts in Frequentist hypothesis testing using problems from the business domain as examples.</p><h4><strong>What is a hypothesis?</strong></h4><p>A hypothesis is often described as an “educated guess” about a specific parameter or population. Once it is defined, one can collect data to determine whether it provides enough evidence that the hypothesis is true.</p><h4><strong>Hypothesis testing</strong></h4><p>In hypothesis testing, two mutually exclusive statements about a parameter or population (hypotheses) are evaluated to decide which statement is best supported by sample data.</p><h4><strong>Parameters and statistics</strong></h4><p>In statistics, a <strong>parameter</strong> is a description of a <strong>population</strong>, while a <strong>statistic</strong> describes a small portion of a population (<strong>sample</strong>). For example, if you ask everyone in your class (population) about their average height, you receive a parameter, a true description about the population since everyone was asked. If you now want to guess the average height of people in your grade (population) using the information you have from your class (sample), this information turns into a statistic.</p><p>Hypothesis tests including a specific parameter are called <strong>parametric tests</strong>. In parametric tests, the population is assumed to have a<strong> normal distribution</strong> (e.g., the height of people in a class).</p><h4><strong>Non-parametric tests</strong></h4><p>In contrast, <strong>non-parametric tests</strong> (also distribution-free tests) are used when parameters of a population cannot be assumed to be normally distributed. For example, the price of diamonds seems exponentially distributed (below right). Non-parametric doesn’t mean that you do not know anything about a population but rather that it is not normally distributed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*T1nwkk9fNBoGaHoAIn16YQ.png" /><figcaption>Left: example of normally distributed data. Right: example of non-normal data distribution. Image by author.</figcaption></figure><p>For simplicity, I will focus on parametric tests in the following, with a few mentions on where to look further if a normal distribution cannot be assumed.</p><h4><strong>Real-world examples</strong></h4><p>An often-used example to explain hypothesis tests is the fair coin example. It is an excellent way to explain the basic concepts of a test but also very abstract. More tangible examples of possible hypotheses in business that one can ask itself could be:</p><p><strong>Hypothesis 1</strong><em>: Average order value has increased since last financial year</em></p><p><strong>Parameter</strong>: <em>Mean order value</em></p><p><strong>Test type</strong>: <em>one-sample, parametric test</em> (assuming the order value follows a normal distribution)</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Hypothesis 2</strong>: <em>Investing in A brings a higher return than investing in B</em></p><p><strong>Parameter</strong>: <em>Difference in mean return</em></p><p><strong>Test type</strong>: <em>two-sample, parametric test, also AB test </em>(assuming the return follows a normal distribution)</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Hypothesis 3</strong>: <em>The new user interface converts more users into customers than the expected 30%</em></p><p><strong>Parameter</strong>: <em>none</em></p><p><strong>Test type</strong>: <em>one-sample, non-parametric test</em> (assuming number of customers is not normally distributed)</p><h4><strong>One-sample, two-sample, or more-sample test</strong></h4><p>When testing hypotheses, it is distinguished between one-sample, two-sample or more-sample tests. This is not to be confused with one- and two-sided tests, which we will cover later. In a <strong>one-sample test</strong>, a sample (average order value this year) is compared to a known value (average order value of last year). In a <strong>two-sample test</strong>, two samples (investment A and B) are compared to each other.</p><h3><strong>Basic Steps of a hypothesis test</strong></h3><p>Several steps are used to test a hypothesis and verify its significance. In the following, I will explain each step in detail and will use the examples from above to explain all concepts.</p><h4><strong>1. Null &amp; Alternative hypothesis</strong></h4><p>The <strong>null</strong> and <strong>alternative</strong> <strong>hypotheses</strong> are the two mutually exclusive statements about a parameter or population mentioned in the introduction. The null hypothesis (often abbreviated as H0) claims that there is no effect or no difference. The alternative hypothesis (often abbreviated as H1 or HA) is what you want to prove. Using one of the examples from above:</p><p><strong>H0: </strong><em>There is no difference in the mean return from A and B, or the difference between A and B is zero.</em></p><p><strong>H1:</strong> <em>There is a difference in the mean return from A and B or the difference between A and B &gt; zero.</em></p><p><strong>One-sided and two-sided (one-tailed and two-tailed) tests</strong></p><p>The example hypotheses above describe a so-called <strong>two-tailed test</strong>. In a two-tailed test, you are testing <em>in both directions</em>, meaning it is tested whether the mean return from A is significantly greater and significantly less than the mean return from B.</p><p>In a <strong>one-tailed test</strong>, you are testing <em>in one direction</em>, meaning it is tested either if the mean return from A is significantly greater or significantly less than the mean return from B. In this case, the alternative hypothesis would change to:</p><p><strong>H1:</strong> The mean return of A is greater than the mean return of B. <strong>OR</strong></p><p><strong>H1:</strong> The mean return of A is lower than the mean return of B.</p><h4>2. <strong>Selection of an appropriate test statistic</strong></h4><p>To test your claims, you need to decide on the right <strong>test</strong> or <strong>test statistic</strong>. Often discussed tests are the t-test, z-test, or F-test, which all assume a normal distribution. However, in business, a normal distribution often cannot be assumed. Therefore, I will briefly explain the main concepts you need to know to find the proper test for your hypothesis.</p><p><strong>Test statistic</strong></p><p>Parametric or non-parametric test, each test has a <strong>test statistic</strong>. A test statistic is a numerical summary of a sample. It is a <em>random variable</em> as it is derived from a <strong>random sample</strong>. In hypothesis tests, it compares the sample statistic to the expected result of the null hypothesis. The selection of the test statistic is dependent on:</p><ul><li>Parametric vs. non-parametric</li><li>Number of samples (one, two, multiple)</li><li>Discrete (e.g. number of customers) or continuous variable (e.g. order value)</li></ul><p>Let’s assume that the mean average order value AOV in your web shop used to be $20. After hiring a new web designer with promising skills, the AOV increased to $22. You want to test whether the mean AOV has significantly increased:</p><p>Parameter: <em>mean AOV </em>(<strong>continuous variable</strong>, <strong>assumed to be normally distributed</strong>)</p><p>Sample statistic: <em>$22 </em>(<strong>one sample</strong>)</p><p>Expected value:<em> $20</em></p><p>Test statistic:<em> t-score</em></p><p>Test: <em>one-sample t-test</em></p><h4><strong>3. Selection of the appropriate significance level</strong></h4><p>When testing hypotheses, we cannot always test it on the whole population but only on randomly selected data samples. Can we, therefore, say that our conclusions are always 100% true for the population? Not really. There are two types of errors that we can make:</p><p><strong>Type I error</strong>: Rejecting the null hypothesis when it is true.</p><p><strong>Type II error</strong>: Accepting the null hypothesis when it is false.</p><p><strong>Alpha</strong> is the <em>probability of the type I error</em> and the chance of making a mistake by rejecting the null hypothesis when it is true. The lower the alpha, the better. It is, therefore, used as a threshold to make decisions. Before starting a hypothesis test, you generally pick an error level you are willing to accept. For example, you are willing to accept a 5% chance that you’re mistaken when you reject the null hypothesis.</p><p>But, wouldn’t I always want to be 100% confident that I didn’t make a mistake, so alpha = 0%?</p><p><strong>Power of a test</strong></p><p>Yes, this is where it gets problematic. Because next to alpha, we also have <strong>beta</strong>, the probability of the type II error. 1-beta is the probability of not making a Type II error and defined as the <em>power of a test</em>. The lower the beta, the higher the power. Naturally, you would like to keep both errors as low as possible. However, it is essential to note that both errors somewhat work against each other: Assume you want to minimise error I or the mistake of rejecting the null hypothesis when it is true. Then, the easiest way would be to just always accept it. But this would then work directly against the type II error, namely accepting it when it is not true.</p><p>Therefore, commonly used significance (alpha) levels 0.01, 0.05, or 0.10 serve as a good balance and should be determined before data collection. Note here that in a two-tailed test, the alpha level is split in half and applied to both sides of the <strong>sampling distribution</strong> of a statistic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*ZQivnp6Ma0KTfnZjSHOmpw.png" /><figcaption>Left: example of a sampling distribution with a rejection region on only one side. Right: example of a sampling distribution with a rejection region on both sides. Image by author.</figcaption></figure><h4>4. <strong>Data collection</strong></h4><p>To run a hypothesis test, we need a portion of the true population of interest, a <strong>random sample</strong>. The sample should be randomly selected to avoid any bias or undesirable effects.</p><p>The question about the optimal <strong>sample size</strong> is not an easy one to answer. Generally, it is safe to say: the more data, the better. However, there are cases where this hard to achieve due to budget or time constraints or just the nature of data. There are several formulas available that help finds the right sample size:</p><ul><li>Cochran sample size formula</li><li>Slovins’s formula</li></ul><p>Moreover, some tests can be used with small sample sizes, like e.g., the t-test or non-parametric tests which generally need fewer sample sizes as they do not require a normal distribution.</p><p><strong>Sample size in two-sample or multi-sample tests</strong></p><p>When conducting a two-sample or multi-sample test, be aware that your chosen test may require a similar sample size unless it is robust to different sample sizes. For example, a test like the t-test may not be appropriate anymore as an unequal sample size can affect the Type 1 error. In this case, it is best to search for a robust alternative (e.g., Welch’s t-test).</p><h4><strong>5. Calculation of the test statistics and the p-value</strong></h4><p>Once the data is collected, the chosen test statistic and the corresponding <strong>p-value</strong> can be calculated. Both values can be used to make your final decision on inference and are retrieved from the probability distribution from the test statistic (also <strong>sampling distribution</strong>).</p><p><strong>How to calculate the test statistic?</strong></p><p>You can calculate the test statistic traditionally using its formula (can be found online), or through a statistical software like SPSS or using R/python. For one of our examples from before, assuming a sample size (n) of 20 and a sample standard deviation (s) of 1.5, our test statistic is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*rtxjp3nUvcVx81LR0zKQ8A.png" /><figcaption><a href="https://www.statisticshowto.com/probability-and-statistics/hypothesis-testing/one-sample-t-test/">One-sample t-test</a></figcaption></figure><p><strong>The p-value</strong></p><p>The <strong>p-value</strong> (short for probability value) is the most critically viewed number in statistics. It is defined as the probability of receiving a result at least as extreme as the one observed, given that the null hypothesis is true. My favourite resource of describing the p-value in simple words is by <a href="https://www.youtube.com/watch?v=9jW9G8MO4PQ">Cassie Kozyrkov</a>:</p><blockquote>The p-value tells you, given the evidence that you have (data), if the null hypothesis looks ridiculous or not […] The lower the p-value, the more ridiculous the null hypothesis looks.</blockquote><p>The p-value is a value between 0% and 100% and can be retrieved from the null hypothesis, sampling distribution, and the data. Generally, it is calculated with the help of statistical software or reading off a distribution table with set parameters (degrees of freedom, alpha level etc.). Distribution tables with the most common parameters can be found online for most test statistics, like <a href="https://www.statisticshowto.com/tables/t-distribution-table/">t-score</a>, <a href="https://www.itl.nist.gov/div898/handbook/eda/section3/eda3674.htm">chi-squared score</a>, or <a href="http://www.socr.ucla.edu/Applets.dir/WilcoxonRankSumTable.html">Wilcoxon-rank-sum</a>.</p><h4>6. <strong>Decision</strong></h4><p>To decide on inference, either the test statistic is compared to a <strong>critical value</strong> (critical value approach), or the p-value is compared to the <strong>alpha-level</strong> (p-value approach).</p><p><strong>Critical value</strong></p><p>The critical value splits the sampling distribution into a “rejection region” and “acceptance region”. If the test statistic is greater than the critical value, then the null hypothesis is rejected in favour of the alternative hypothesis with a confidence level of 1-alpha. If the test statistic is smaller than the critical value, the null hypothesis is not rejected. Critical values are found with the sampling distribution and the alpha-level. However, a more common approach for making a test decision is the p-value approach.</p><p><strong>P-value vs. alpha level</strong></p><p>Given your alpha level, if the p &lt;= alpha, the null hypothesis is rejected in favour of the alternative hypothesis with confidence level 1-alpha. If the p-value is greater than the alpha-level, the null hypothesis is accepted.</p><h3><strong>Summary</strong></h3><p>In hypothesis testing, two mutually exclusive statements about a population are tested using a random data sample. It comprises many concepts and steps that greatly impact the results, like formulating the hypotheses or selecting the test statistic, alpha-level, and sample size.</p><p><strong>Resources</strong></p><ul><li><a href="https://greenteapress.com/thinkstats2/thinkstats2.pdf">https://greenteapress.com/thinkstats2/thinkstats2.pdf</a></li><li><a href="https://www.statisticshowto.com/">https://www.statisticshowto.com/</a></li><li><a href="https://openstax.org/books/introductory-business-statistics/pages/10-1-comparing-two-independent-population-means">https://openstax.org/books/introductory-business-statistics/pages/10-1-comparing-two-independent-population-means</a></li><li><a href="https://stats.libretexts.org/Courses/Highline_College/Book%3A_Statistics_Using_Technology_(Kozak)/07%3A_One-Sample_Inference/7.01%3A_Basics_of_Hypothesis_Testing">https://stats.libretexts.org/Courses/Highline_College/Book%3A_Statistics_Using_Technology_(Kozak)/07%3A_One-Sample_Inference/7.01%3A_Basics_of_Hypothesis_Testing</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c36ddde4cd2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/hypothesis-testing-for-data-scientists-everything-you-need-to-know-8c36ddde4cd2">Hypothesis testing for data scientists</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A quick introduction to ggplot2]]></title>
            <link>https://medium.com/data-science/a-quick-introduction-to-ggplot2-d406f83bb9c9?source=rss-ba4ebbd0afd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d406f83bb9c9</guid>
            <category><![CDATA[r]]></category>
            <category><![CDATA[plotting]]></category>
            <category><![CDATA[ggplot2]]></category>
            <category><![CDATA[plot]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Alicia Horsch]]></dc:creator>
            <pubDate>Sun, 14 Mar 2021 10:39:26 GMT</pubDate>
            <atom:updated>2021-03-14T22:03:08.593Z</atom:updated>
            <content:encoded><![CDATA[<h4>How understanding the grammar of graphics will help you build any plot with ggplot2</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCuGPaXZRbeNARSoyQrlog.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@hasanalmasi?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Hasan Almasi</a> on <a href="https://medium.com/s/photos/layer?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong>ggplot2</strong> is a widely used graphics library in R and also part of the <a href="https://www.tidyverse.org/">tidyverse</a>. The tidyverse is a collection of R packages that share a common design philosophy, grammar, and data structures. Other packages in the tidyverse are, for example, dplyr or purrr.</p><h3>The grammar of graphics</h3><p>ggplot2 is built on the <strong>grammar of graphics</strong>. Hadely Wickham, one of the developers of ggplot2, described grammar to be</p><blockquote>“the fundamental principles or rules of an art or science”.</blockquote><p>Therefore, the grammar of graphics is a way to describe and create a wide range of plots. In ggplot2, all plots are created using layers where each layer represents a component of a graph.</p><p>In this quick introduction to ggplot2, you will learn how a “gg-plot” is structured and built. I am sure that once you understand its basic structure, you can build any plot in the future building upon these basics. So let’s dive in and see what layers we need to create a basic plot using ggplot2.</p><h3>The basics</h3><p>Every graph in ggplot2 is built using at least these three components:</p><ol><li><strong>The data</strong> and how data points are mapped to each other</li><li>A set of <strong>geometric objects </strong>also referred to as <strong>geoms</strong> (visual marks that represent the data points like e.g. bar, dots, or lines)</li><li>A <strong>coordinate system</strong></li></ol><p>In addition to the base layers, ggplot2 offers many other layers to adjust plots through colouring, scaling, and faceting or adding statistical transformations to the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQ4k9vmzNDa2z9e-4kOoPw.png" /><figcaption>Base layers of ggplot2. Image by author.</figcaption></figure><p>Let’s build our first plot, to better grasp the explanation above. For this, I’ll be making use of the <em>Olympics dataset</em> available on <a href="https://www.kaggle.com/heesoo37/120-years-of-olympic-history-athletes-and-results">Kaggle</a>. Make sure you have the library “ggplot2” installed before you start plotting. Also, I will make use of the <em>dplyr </em>library<em> </em>here and there for data manipulation.</p><p>As a first example, we plot a histogram (geometry) of the height (data) of athletes who participated in the Olympic games. The graph includes all necessary components: the data + a geom + a coordinate system.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc13a799bfe44a77cff982bd45e11d60/href">https://medium.com/media/cc13a799bfe44a77cff982bd45e11d60/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*-ALJS8Qijp1q3Ool5xJv8A.png" /><figcaption>Distribution of height of athletes who participated int he Olympic games shown in a histogram. Image by author.</figcaption></figure><h4>Geometric objects (geoms)</h4><p>The available geoms change depending on the <em>dimensionality</em> and <em>type of variable(s)</em> displayed. In our first plot, for example, we plot one variable (height), which is continuous. I highly recommend opening the ggplot2 <a href="https://rstudio.com/wp-content/uploads/2015/03/ggplot2-cheatsheet.pdf">cheatsheet</a> from RStudio on the side as it provides a summary of available geoms. Let’s plot different dimensions and types of variables to get an idea:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b341301a60dc8b714558bfcc5aadb0a5/href">https://medium.com/media/b341301a60dc8b714558bfcc5aadb0a5/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*q0yj8cqDeBHcO8_vU6fZxQ.png" /><figcaption>Top left: plot 1 (1 variable, continuous), top right: plot 2 (1 variable, discrete), bottom left: plot 3 (2 variables, both continuous), bottom right: plot 4 (2 variables, one continuous, one discrete). Image by author.</figcaption></figure><p>Next to the different geoms, we can observe another thing: The second plot (1D, discrete) shows that a plot <strong>still shows</strong> even if <em>coord_cartesian() </em>is not added to the code. The third plot (2D, both continuous) shows that <em>coord_cartesian() </em>is mandatory if you want to adjust the coordinate system to your needs. In the following, I will refer to our four basic plots as plot 1, plot 2, plot 3 and plot 4.</p><h4>Adding some colour and shape</h4><p>In the examples above, all graphs look a little dull and could be improved with some colour or shapes. Let’s make the plots more interesting by adjusting the <strong>aesthetics properties</strong>.</p><p>The aesthetics properties can be adjusted in different ways. <em>aes()</em> can be either passed to <em>ggplot() </em>or to a specific layer, like a geom-layer. Especially, when working with one-dimensional data this can have an impact on your plot.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/301c6b1367d437c406b5114a8876ed12/href">https://medium.com/media/301c6b1367d437c406b5114a8876ed12/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*gJMA698kFQSgvss2l6Hjlw.png" /><figcaption>Top row: adjustments to basic plot 1. Aesthetics properties need to be passed to the geom-layer to receive the wanted outcome. Middle row (left): adjustment to basic plot 3. Shapes and colours are added. Bottom row &amp; middle row (right): adjustment to plot 4. Image by author.</figcaption></figure><p>In adjustment two of plot 1, we can see that “green” is treated as a constant variable. This happens because the first two arguments of <a href="https://ggplot2.tidyverse.org/reference/aes.html"><em>aes(x,y..)</em></a> are expected to be variables. This is different when working with two-dimensional data (see adjustments one and two for plot 4). Here, <em>aes()</em> can be passed to <em>ggplot()</em> or the geom-layer without an impact.</p><h4>Statistical transformation</h4><p>Alternatively to a <em>geom</em>-layer, data points can be mapped to a coordinate system using a <em>stat</em>-layer. Moreover, you may need to statistically transform the data for your plot instead of using the raw data (stat=“identity”). Then you can set the stat-argument of the <em>geom</em>-layer to e.g. “count” or “summary”. Let’s see in a plot how stat is affecting your graph.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d2f85fc7a8679cfa2e6f4d1bd372ee9/href">https://medium.com/media/0d2f85fc7a8679cfa2e6f4d1bd372ee9/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L380gRt9KKMuW4h3Cj0Onw.png" /><figcaption>Left: plot created with stat_layer <strong>counting</strong> the number of athletes. Right: Mean weight used as statistical transformation to variable Weight. Image by author.</figcaption></figure><p>The first plot shows the number of athletes (counts) per Olympic city, and by sex. Compared to this, stat_plot2 shows the mean weight of athletes by sex using the transformation “summary”.</p><h4>Position, title, legends, and grids</h4><p>Now, you already know the basics of ggplot2. However, additional layers can be <em>easily added</em> and greatly impact the quality of your plots: title, legends, position, or grids. Append layers to adjust the plot title or axes titles using <em>labs()</em>, the legend using <em>theme()</em> or <em>scale_fill_discrete()</em> or add grids using <em>facet_grid()</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/653e56e2ee08852326f06c363d26f851/href">https://medium.com/media/653e56e2ee08852326f06c363d26f851/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7hCaGPIGYFXgUv6RGB80Jg.png" /><figcaption>Left: Gender ratio per Olympic city with added layer to adjust title, legend and bars. Right: Correlation between height and weight of athletes by season with added layers to add grid and titles.</figcaption></figure><p>Now you have all the tools needed to build a basic plot in <strong>ggplot2,</strong> and in my opinion, also the requirements to build any more sophisticated plot. You already won half the battle by understanding the philosophy behind <strong>ggplot2</strong> and seeing each adjustment as another layer. Happy plotting!</p><p><strong>Resources</strong></p><ul><li><a href="https://rpubs.com/aelhabr/tidyverse-basics">https://rpubs.com/aelhabr/tidyverse-basics</a></li><li><a href="https://www.tandfonline.com/doi/abs/10.1198/jcgs.2009.07098">https://www.tandfonline.com/doi/abs/10.1198/jcgs.2009.07098</a></li><li><a href="https://cfss.uchicago.edu/notes/grammar-of-graphics/">https://cfss.uchicago.edu/notes/grammar-of-graphics/</a></li><li><a href="https://rstudio.com/wp-content/uploads/2015/03/ggplot2-cheatsheet.pdf">https://rstudio.com/wp-content/uploads/2015/03/ggplot2-cheatsheet.pdf</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d406f83bb9c9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/a-quick-introduction-to-ggplot2-d406f83bb9c9">A quick introduction to ggplot2</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting and Treating Outliers In Python — Part 3]]></title>
            <link>https://medium.com/data-science/detecting-and-treating-outliers-in-python-part-3-dcb54abaf7b0?source=rss-ba4ebbd0afd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcb54abaf7b0</guid>
            <category><![CDATA[winsorizing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[outliers]]></category>
            <category><![CDATA[imputation]]></category>
            <dc:creator><![CDATA[Alicia Horsch]]></dc:creator>
            <pubDate>Mon, 15 Feb 2021 05:57:30 GMT</pubDate>
            <atom:updated>2021-02-15T13:38:33.940Z</atom:updated>
            <content:encoded><![CDATA[<h3>Detecting and Treating Outliers In Python — Part 3</h3><h4>Hands-On Tutorial On Treating Outliers — Winsorizing and Imputation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qEO7SZgZKuOQlY8Db-0YCg.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@rethaferguson?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">RF._.studio</a> from <a href="https://www.pexels.com/photo/crop-focused-repairman-fixing-graphics-card-on-computer-3825582/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><p>An Exploratory Data Analysis (EDA) is crucial when working on data science projects. Understanding your underlying data, its nature, and structure can simplify decision making on features, algorithms or hyperparameters. A critical part of the EDA is the detection and treatment of outliers. <strong>Outliers </strong>are observations that deviate strongly from the other data points in a random sample of a population.</p><p>In two previously published articles, I discussed how to detect different types of outliers using well-known statistical methods. One article focuses on <a href="https://towardsdatascience.com/detecting-and-treating-outliers-in-python-part-1-4ece5098b755">univariate</a> and the other on <a href="https://towardsdatascience.com/detecting-and-treating-outliers-in-python-part-2-3a3319ec2c33">multivariate</a> outliers.</p><p>In this final post, I want to discuss how to treat extreme values once they are detected. After a theoretical introduction, I will provide two practical examples written in python. For this, I will make use of the Boston housing data set like in my previous posts.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4fbd775a1b1373ca586798236f83ea7e/href">https://medium.com/media/4fbd775a1b1373ca586798236f83ea7e/href</a></iframe><h4>Treating outliers: A subjective task</h4><p>Similar to not detecting outliers at all, handling outliers can bear the risk of having a substantial impact on the outcome of an analysis or machine learning model. In practice, it is often not very obvious what to do with outlying observations.</p><p>The good news is: From a mathematical point of view, there is no right and wrong answer on how to treat outlying observations. A more important role, next to mathematics, can be given to <em>qualitative information</em> you have available in the decision process around outliers. For example, knowing how an outlier arose in the first place can be beneficial for decisions on extreme values.</p><p>Therefore, I want to highlight possible <em>sources of outliers </em>before going deeper into available options for outlier treatment.</p><h4>Sources of outliers</h4><p>Next to the distinction between univariate and multivariate, extreme values can be differentiated by source. An <strong>error outlier</strong> is an outlying observation that stems from an inaccurate measurement, wrong data entry, or is the result of data manipulation. In this case, these data points are usually not part of the population of interest.</p><p>On the other hand, <strong>non-error outliers</strong>, also called <strong>interesting</strong> or <strong>random outliers</strong>, are part of the population of interest and may hold interesting information.</p><h3>Handling error Outliers</h3><p>Error outliers should be either removed or corrected. The easiest way would be to remove the observations that emerged through inaccurate measurements or data manipulation. Suppose there is a raw version of the underlying data available. In that case, it can be worth retracing the original entry of a data point to avoid a significant loss of information through deletion.</p><p>However, if you do not have a raw data version at hand but you are sure that you are looking at an error outlier (e.g., a human height measurement of 4 meters/200 inches or a fourth class of a dimension even though you know there should be only three classes of a variable), your best option is to simply remove these entries.</p><h3>Handling non-error outliers</h3><p>There exist three different options on how to treat non-error outliers:</p><ol><li>Keep</li><li>Delete</li><li>Recode</li></ol><h4>Keep</h4><p>When most of the detected outliers are non-error outliers and rightfully belong to the population of interest, this is a good strategy. Also, you often cannot easily identify whether or not an extreme value is a part of the population of interest or not.</p><p>When keeping outliers, be aware that they can distort the results of your actual task: e.g. lead to a rejection of the null hypothesis or an over-optimistic prediction. Therefore, it might be worth your while to report your findings, including outliers and excluding outliers to highlight the impact they can have.</p><p>Another option are robust methods for your actual prediction task or analysis. These methods reduce the influence of extreme values using more robust statistics (e.g., median) or other non-parametric settings (e.g., rank-tests, bootstrapping, or Support Vector Machines).</p><p><strong>For univariate and multivariate outliers:</strong></p><ul><li>Collect qualitative information by including and excluding outliers in your analysis to assess their actual impact</li><li>Use robust methods to reduce the impact of outliers</li><li>Keep outliers if they are likely to belong to the population of interest and beware of the risks they bring when making decisions</li><li>And always and most importantly: <em>Report all findings</em>!</li></ul><h4>Delete</h4><p>The most straightforward option is to delete any outlying observation. However, this strategy bears a high risk of losing information. Especially if you find many outlying data points, try to avoid this. Also, deleting interesting and influential outliers (points that belong to the population of interest) can falsely impact any output, e.g., prediction or test result, you aim to achieve.</p><p><strong>For univariate and multivariate outliers:</strong></p><ul><li>Remove outliers on a low scale and those that are not likely to be from another population</li><li>If you choose deletion, always provide two reports of your analysis or outcomes: one with and one without outlying observations</li></ul><h4>Recode</h4><p>Recoding outliers is a good option to treat outliers and keep as much information as possible simultaneously. This option should always be accompanied by sound reasoning and explanation. There are several different methods to recode an outlier, and in this article, I want to focus on two widely used methods:</p><ul><li>Winsorizing</li><li>Imputation</li></ul><h4>Winsorizing</h4><p>Winsorizing was introduced by Tukey &amp; McLaughlin in <a href="https://www.jstor.org/stable/25049278?seq=1">1963</a> and is often recommended in research papers (e.g., <a href="http://www.hermanaguinis.com/ORMoutliers.pdf">2013</a> or <a href="http://doi.org/10.5334/irsp.289">2019</a>) dealing with outlier treatment. With winsorizing, any value of a variable above or below a percentile <em>k</em> on each side of the variables’ distribution is replaced with the value of the <em>k-</em>th percentile itself. For example, if <em>k</em>=5, all observations above the 95th percentile are recoded to the value of the 95th percentile, and values below the 5th percent are recoded, respectively. Compared to <em>trimming</em>, winsorizing is a less extreme option by recoding outliers rather than cutting them altogether.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ZpWyy5_CTHjarjIWzemtQ.png" /><figcaption>Left: Values of the original data. Right: Recoded values with k=5 — All values above the 95th percentile are replaced with the value of the 95th percentile (here 2.5). Image by the author.</figcaption></figure><p>Winsorization also directly intervenes with the process of outlier detection. The data points above or below a certain threshold are treated, and no independent detection method is needed. However, it goes hand-in-hand with Tukey’s boxplot method as <em>k</em> is often recommended to be set at a <strong>sample’s outer fence</strong> (3 standard deviations around the mean). This is often at k=5 and, therefore, used as the default value.</p><p>Let’s look at an example from the previously used Boston housing data set. For the crime rate per capita by town, we found 30 probable outliers (using the Tukey method). First, I will re-use some code from the first tutorial to determine the outer fence.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30f4dc2a4b10b3657806d38e81632ff3/href">https://medium.com/media/30f4dc2a4b10b3657806d38e81632ff3/href</a></iframe><p>The upper outer fence for the variable “CRIM” is roughly 14.46, while the lower end is <em>below zero</em>. Because a crime rate below zero is not meaningful, the data should only be winsorized on its<em> right tail</em>. Now, we can look at values at different percentiles to set <strong>k</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/11bcab84ec542847517de1e3f5359468/href">https://medium.com/media/11bcab84ec542847517de1e3f5359468/href</a></iframe><p>It looks like the value at 92.5% (13.54) and 95% (15.79) are closest to the upper outer fence. As 95% is more common, I will winsorize the data on <em>k=5</em> using the winsorize function from scipy:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5bfef74210e95787db1ae92ac46dad1d/href">https://medium.com/media/5bfef74210e95787db1ae92ac46dad1d/href</a></iframe><p>With winsorizing, the mean crime rate per capita changed from 3.61 to 2.80 (95%).</p><p><strong>For univariate outliers</strong>:</p><ul><li>Winsorize to keep as much data as possible</li><li>To find the right winsorization level, know your data! A percentage point close to the outer fence is considered best practice</li><li><em>Zero limits</em> can be meaningful if a variable can not have a value below zero</li><li>Report main statistics (e.g., mean, std) before and after winsorizing</li></ul><p><strong>For multivariate outliers</strong>:</p><ul><li>For multivariate outliers, winsorizing is done on the <em>ellipsoid</em> (holding information from more than one variable)</li><li>There doesn’t seem to be an existing python package that deals with winsorization on ellipsoids. Yet, there exists a function called <em>mvTopCoding</em> as part of an <strong>R package</strong> <a href="https://www.rdocumentation.org/packages/sdcMicro/versions/5.5.0">sdcMicro</a> that winsorizes outliers on the ellipsoid defined by the (robust) Mahalanobis distance.</li></ul><h4>Imputation</h4><p>Imputation is a method that is often used when handling <em>missing data</em>. However, it is also applied when dealing with extreme values. When using imputation, outliers are removed (and with that become missing values) and are replaced with <strong>estimates</strong> based on the remaining data.</p><p>There are several imputation techniques. One that is often used, yet comes with a strong <em>bias</em>, is the simple mean substitution. Here, all outlier or missing values are substituted by the variables’ mean. A better alternative and more robust imputation method is the <strong>multiple imputation.</strong></p><p>In multiple imputation, missing values or outliers are replaced by <strong>M</strong> plausible estimates retrieved from a prediction model. The outlier becomes the dependent variable of a prediction model (e.g., regression, random forest etc.), and is estimated based on the remaining information non-missing/non-outlier values in an observation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OywpRVqMAgcDkf3WSbqtCQ.png" /><figcaption>First row: variable 1 — variable 4 (red) help predict M plausible values for variable 5 (yellow). Image by author.</figcaption></figure><p>Choosing the right number of plausible estimates <strong>M</strong> for a missing value or outlier is frequently discussed in literature and it is often <a href="https://stefvanbuuren.name/fimd/sec-howmany.html">recommended</a>:</p><blockquote>Using m=5−20 will be enough under moderate missingness […]</blockquote><p>Practically, multiple imputation is not as straightforward in python as it is in R (e.g. mice, missForest etc). However, the <strong>sklearn</strong> <strong>library</strong> has an iterative imputer which can be used for multiple imputations. It is based on the R package <strong><em>mice</em></strong> and is still in an <a href="https://scikit-learn.org/stable/modules/generated/sklearn.impute.IterativeImputer.html#sklearn.impute.IterativeImputer">experimental phase</a>.</p><p>Sklearns’ default version is very basic and uses mean substitution but can be adjusted easily by passing other regressors to the function, like linear regression, KNN or a decision tree. In order to receive multiple estimates, like mice provides in R, the imputer needs to be run multiple times (e.g. in a for-loop).</p><p>Coming back to our example of crime rate per capita, we first need to transform the outliers into missing values. For this, I use the list of probable outliers detected by the Tukey method (see in article 1).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/febe4fd2a6e3e26f38387c98e992ff9d/href">https://medium.com/media/febe4fd2a6e3e26f38387c98e992ff9d/href</a></iframe><p>As an estimator, I chose regularized linear regression (BayesianRidge), and for simplicity, I will set m=1 (single imputation). As already mentioned and also written in sklearns <a href="https://scikit-learn.org/stable/modules/impute.html#iterative-imputer">user-guide</a>, the imputer can be used for multiple imputations</p><blockquote>“by applying it repeatedly […] with different random seeds when sample_posterior=True”.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4d54dab4cc8f014b679d194bca9a310/href">https://medium.com/media/d4d54dab4cc8f014b679d194bca9a310/href</a></iframe><p>Again, the mean crime rate per capita changed from 3.61 to 2.36.</p><p><strong>For univariate outliers</strong>:</p><ul><li>Next to treating missing data, often used technique for recoding outliers</li><li>Multiple imputation more robust, single (e.g., mean) imputation biased</li><li>For imputation, R offers more mature and flexible packages than python.</li></ul><p><strong>For multivariate outliers</strong>:</p><ul><li>Imputation does not really make sense for multivariate outliers as they are defined as outlying observations across multiple variables (for a multiple outlier all entries would turn into a missing value leaving little space for prediction)</li></ul><h4>Wrapping up</h4><p>The treatment of outlying data points is a highly subjective task as there is no mathematical right or wrong solution. Qualitative information, such as knowing the source of an outlier or an outlier’s influence, can simplify treatment decisions. Error outliers are best to be corrected or deleted, while non-error outliers can be <strong>kept, deleted, or recoded</strong>. Several recoding methods exist for extreme values, with <strong>winsorizing</strong> and <strong>multiple imputations</strong> being among the popular ones.</p><p>An essential task is to report the outcome with and without outliers and supplying sound reasoning and explanation when treating outliers.</p><p><strong>Resources:</strong></p><ul><li><a href="http://www.hermanaguinis.com/ORMoutliers.pdf">http://www.hermanaguinis.com/ORMoutliers.pdf</a></li><li><a href="https://www.rips-irsp.com/articles/10.5334/irsp.289/">https://www.rips-irsp.com/articles/10.5334/irsp.289/</a></li><li><a href="https://stefvanbuuren.name/fimd/sec-howmany.html">https://stefvanbuuren.name/fimd/sec-howmany.html</a></li><li><a href="https://scikit-learn.org/stable/modules/impute.html#iterative-imputer">https://scikit-learn.org/stable/modules/impute.html#iterative-imputer</a></li><li><a href="https://www.r-bloggers.com/2019/01/a-new-way-to-handle-multivariate-outliers/">https://www.r-bloggers.com/2019/01/a-new-way-to-handle-multivariate-outliers/</a></li><li><a href="https://ww2.amstat.org/meetings/ices/2007/proceedings/ICES2007-000210.PDF">https://ww2.amstat.org/meetings/ices/2007/proceedings/ICES2007-000210.PDF</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcb54abaf7b0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/detecting-and-treating-outliers-in-python-part-3-dcb54abaf7b0">Detecting and Treating Outliers In Python — Part 3</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting And Treating Outliers In Python — Part 2]]></title>
            <link>https://medium.com/data-science/detecting-and-treating-outliers-in-python-part-2-3a3319ec2c33?source=rss-ba4ebbd0afd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a3319ec2c33</guid>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[anomaly-detection]]></category>
            <category><![CDATA[outliers]]></category>
            <category><![CDATA[outlier-detection]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Alicia Horsch]]></dc:creator>
            <pubDate>Mon, 14 Dec 2020 06:40:02 GMT</pubDate>
            <atom:updated>2020-12-14T13:32:29.142Z</atom:updated>
            <content:encoded><![CDATA[<h3>Detecting And Treating Outliers In Python — Part 2</h3><h4>Hands-On Tutorial On Multivariate Outliers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DUbkYrvRZjR7rLjOt9W3XQ.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@legioseven?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">LegioSeven</a> from <a href="https://www.pexels.com/photo/shepherd-dog-with-flock-of-sheep-5384726/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><p>An Exploratory Data Analysis (EDA) is essential when working on data science projects. Understanding your underlying data, its nature, and structure can simplify decision making on features, algorithms, and hyperparameters. One crucial part of the EDA is the detection of <strong>outliers</strong>. Outliers are observations that are far away from the other data points in a random sample of a population.</p><p>In a <a href="https://towardsdatascience.com/detecting-and-treating-outliers-in-python-part-1-4ece5098b755">previously posted article</a>, I introduced statistical methods to detect <em>univariate outliers</em> commonly used in practice. In this post, I want to discuss what <strong>multivariate outliers</strong> are, how they can be detected, and visualized during EDA. In an third and last article, I would like to explain how both types of outliers can be treated:</p><p>1. <a href="https://towardsdatascience.com/detecting-and-treating-outliers-in-python-part-1-4ece5098b755">Detecting univariate outliers</a></p><p><strong>2. Detecting multivariate outliers</strong></p><p>3. Treatment of both types of outliers</p><p>There are many ways to detect outliers, including statistical methods, proximity-based methods, or supervised outlier detection. Again, I will solely focus on commonly used statistical methods. As in my previous post, I will use the Boston housing data set (sklearn library) for illustration and provide example code in Python so you can easily follow.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c9b1c9a1104c15388e009068ed7629c9/href">https://medium.com/media/c9b1c9a1104c15388e009068ed7629c9/href</a></iframe><h4>Multivariate outliers (Recap)</h4><p>A multivariate outlier is an unusual combination of values in an observation across several variables. For example, it could be a human with a height measurement of 2 meters (in the 95th percentile) and weight measurement of 50kg (in the 5th percentile).</p><h4>Visualization</h4><p>A common way to plot multivariate outliers is the <strong>scatter plot</strong>. Keep in mind that visualizing multivariate outliers across more than two variables is not feasible in a 2D space. Therefore, we will stick to outliers found across two variables for visualization — so-called <em>bi-variate outliers</em>.</p><p>The scatterplot visualizes the relationship between two (numerical) variables. In a scatterplot, every observation is plotted as a point with two coordinates (X,Y) that represent two variables. Here, for example, X represents the value for variable 1 and Y the value for variable 2.</p><p>Let’s create a scatterplot between two variables from the Boston housing data set. I choose the variables ‘CRIM’ and ‘LSTAT’ to understand the relationship between the crime rate per capita by town and the percentage of lower status in the population. You can play around and choose any set of numerical variables from the data set and see what changes. Other meaningful combinations worth looking at are, for example, ‘DIS’ &amp; ‘INDUS’, ‘LSTAT’ &amp; ‘PTRATIO’ or ‘INDUS’ &amp; ‘ZN’.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/afc93118a0bbeee3670543b928df0122/href">https://medium.com/media/afc93118a0bbeee3670543b928df0122/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*Q-yaKKV2Hi933a0n8gTj-Q.png" /><figcaption>Scatterplot: crime rate per capita by town (CRIM) against the percentage of lower status in the population (LSTAT). Image by author.</figcaption></figure><p>Like box plots, scatter plots visualize outlying observations very well but do not identify or mark them for easy treatment. When dealing with multivariate outliers, <strong>distance metrics</strong> can be helpful for detection. With distance metrics, the distance between two vectors is determined. These two vectors can be two different observations (rows) or an observation (row) compared to the mean vector (row of means of all columns). Distance metrics can be calculated independent of the number of variables in the dataset (columns).</p><h3>Mahalanobis Distance</h3><p>A widely used distance metric for the detection of multivariate outliers is the <strong>Mahalanobis distance</strong> (MD). The MD is a measure that determines the distance between a <em>data point</em> x and a <em>distribution</em> D. It is a <strong>multivariate generalization</strong> of the internally studentized residuals (z-score) introduced in my last article. This means the MD defines how many standard deviations x is away from the mean of D.</p><p>It is defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*O51giyF0VmVXHKmprf0bGg.png" /><figcaption>Image by author</figcaption></figure><p>Here, <strong><em>x</em></strong> represents an observation vector and <strong><em>µ</em></strong> the arithmetic mean vector of independent variables (columns) in the sample. <strong><em>C</em></strong>(-1) is the <strong>inverse covariance matrix</strong> of the independent variables in the sample. To better understand the mathematical intuition behind the MD, I recommend reading under point four in <a href="https://www.machinelearningplus.com/statistics/mahalanobis-distance/">this blog post</a>.</p><p>Like the z-score, the MD of each observation is compared to a cut-off point. Assuming a multivariate normal distribution of the data with K variables, the Mahalanobis distance follows a chi-squared distribution with K degrees of freedom. Using a reasonable significance level (e.g., 2.5%, 1%, 0.01%), the cut-off point is defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*JsMhL1DHVS5cJ7jU8c3KJg.png" /><figcaption>Image by author</figcaption></figure><p>Let’s see an example using a 0.01% significance level and searching for bi-variate outliers in the subset used before.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b40156cc2e2e583239998fbbd396a37/href">https://medium.com/media/0b40156cc2e2e583239998fbbd396a37/href</a></iframe><p>Using the Mahalanobis distance, we can see that 8 observations are marked as bi-variate outliers. When including <em>all variables</em> of the Boston dataset (df=13), we detect 17 multivariate outliers.</p><p>Look closer at observation 398. It seems like when looking at the subset of two variables, it is an outlier. However, when considering the whole dataset, it is not. Therefore, when running your own data science project, make sure to only include variables in your detection process that are interesting for your further analysis. Otherwise, some observations may be flagged as outliers because of an irrelevant variable.</p><p>A drawback of the MD is that it uses the arithmetic mean and covariance matrix and, with that, is <em>highly sensitive to outliers in the data</em>. Several methods exist that use robust estimates for <strong><em>µ</em></strong> and <strong><em>C</em></strong>. In the following passage, I will explain the Minimum Covariance Determinant method, introduced by Rousseeuw, as an example.</p><h3>Robust Mahalanobis Distance</h3><p>The Minimum Covariance Determinant method (MCD) provides robust estimates for <strong><em>µ</em></strong> and <strong><em>C</em></strong> by only using a subset of the sample. It only uses the observations where the determinant of the covariance matrix is as small as possible. It is defined as the classic MD but with robust estimates for mean and covariance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*TZwPN7HFBHDNUe86LGArkQ.png" /><figcaption>Image by author.</figcaption></figure><p>The Python library sklearn includes a function to fit the MCD to any dataset to receive a robust covariance matrix and mean. Let’s go back to our example and see how the result changes:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f438f6b02c4c0f2ac0fba7ea5b5b38d/href">https://medium.com/media/5f438f6b02c4c0f2ac0fba7ea5b5b38d/href</a></iframe><p>We can see that the robust MD finds a few more outliers than the classic MD. 10 bi-variate outliers for the 2D dataset example and 21 multivariate outliers when considering all features of the Boston dataset.</p><p>The two plots below (based on the 2D dataset example) help visualizing the difference between the classic (left) and robust (right) distance measurement:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qgPhnchKxhPhHwh0vNIGA.png" /><figcaption>Left: CRIM by LSTAT with outliers in orange using MD. Right: CRIM by LSTAT with outliers in orange using robust MD. Image by author.</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d3a1dab2f34d98ccf18e700b090d536/href">https://medium.com/media/2d3a1dab2f34d98ccf18e700b090d536/href</a></iframe><h4>Wrapping up</h4><p>Next to <em>univariate outliers</em>, it is also important to examine an underlying data set for <em>multivariate outliers</em>. Both types of outliers can significantly impact the outcomes of a data analysis or machine learning projects. In this post, we learned that multivariate outliers are a unique combination of values in an observation and can be detected through distance metrics.</p><p>A commonly used distance metric is the <em>Mahalanobis distance</em>. Its classic definition relies on the mean and covariance between all variables of a dataset. It is, therefore, sensitive to outliers. One way to receive more robust estimates for the mean and covariance is the <em>Minimum Covariance Determinants method</em> (MCD).</p><p>Finally, it is important to note that there are several other ways of detecting univariate and multivariate outliers. Other popular methods are k-nearest neighbours, DBSCAN, or isolation forests, just to name a few. There is no right or wrong method, but one might be more appropriate than another for your data set. When deciding on the outlier detection method you would like to use, I recommend basing your decision on the data’s distribution, sample size, and the number of dimensions.</p><p>Now that we know how to detect univariate and multivariate outliers: what now? In an upcoming post, I want to discuss how outliers can be treated.</p><p><strong><em>Resources:</em></strong></p><ul><li><a href="https://link.springer.com/chapter/10.1007/978-3-319-43742-2_14">https://link.springer.com/chapter/10.1007/978-3-319-43742-2_14</a></li><li><a href="http://www.hermanaguinis.com/ORMoutliers.pdf">http://www.hermanaguinis.com/ORMoutliers.pdf</a></li><li><a href="https://www.machinelearningplus.com/statistics/mahalanobis-distance/">https://www.machinelearningplus.com/statistics/mahalanobis-distance/</a></li><li><a href="https://onlinelibrary.wiley.com/doi/full/10.1002/wics.1421">https://onlinelibrary.wiley.com/doi/full/10.1002/wics.1421</a></li><li><a href="https://scikit-learn.org/stable/modules/generated/sklearn.covariance.MinCovDet.html">https://scikit-learn.org/stable/modules/generated/sklearn.covariance.MinCovDet.html</a></li><li><a href="https://www.khanacademy.org/math/statistics-probability/describing-relationships-quantitative-data/introduction-to-scatterplots/a/scatterplots-and-correlation-review">https://www.khanacademy.org/math/statistics-probability/describing-relationships-quantitative-data/introduction-to-scatterplots/a/scatterplots-and-correlation-review</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a3319ec2c33" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/detecting-and-treating-outliers-in-python-part-2-3a3319ec2c33">Detecting And Treating Outliers In Python — Part 2</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[6 Tips I Learned From A Recruiting Specialist At A Business School]]></title>
            <link>https://medium.com/data-science/6-tips-i-learned-from-a-recruiting-specialist-at-a-business-school-49b17249607e?source=rss-ba4ebbd0afd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/49b17249607e</guid>
            <category><![CDATA[application]]></category>
            <category><![CDATA[cv]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[resume]]></category>
            <dc:creator><![CDATA[Alicia Horsch]]></dc:creator>
            <pubDate>Sun, 29 Nov 2020 12:06:22 GMT</pubDate>
            <atom:updated>2020-11-29T13:36:01.337Z</atom:updated>
            <content:encoded><![CDATA[<h4>Freshen up your resume, optimize your job hunt and master the initial interview</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1j2pEUB5Ty1YK_uBcMe_Ig.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@mentatdgt-330508?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">mentatdgt</a> from <a href="https://www.pexels.com/photo/two-woman-chatting-1311518/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><p>In my job search process at the beginning of this year, I had the opportunity to meet a recruitment specialist from a renowned business school. Although his usual work involves dealing with business students, he shared some valuable advice with me, which, I believe, could benefit any job seeker. Please note that the examples I will use for illustration in this article are tailored to my personal job hunt in <em>data science</em> but can be exchanged by other roles.</p><h3>Tips for your resume</h3><h4>1. Have a short and customized “About me” section</h4><p>At the top of your CV, implement an “About me” section consisting of 2–3 sentences where you briefly describe yourself, state your skills and experience, and even your motivation. Make sure to <em>customize this section to each job </em>description you want to apply to.</p><p>For example, if the job description says “data analyst”, focus on emphasizing your data analysis skills (as opposed to e.g., data science, data engineering, or business intelligence).</p><p>Another example is a sentence from my own introduction section on my resume, where I highlight all the parts that can be customized to every new job application you sent out.</p><p>“Knowing how to <strong>find and communicate data insights</strong>, I am looking for a job as a <strong>Data Scientist </strong>to tackle challenges in the <strong>business domain</strong>.”</p><h4>2. Research all required skills and add as many as possible to your CV</h4><p>For every application you want to send out, copy the job description into a Word document or Google doc, and highlight <em>every skill</em> they are looking for in a candidate. Collect them in a list and re-phrase them in your own words with the help of a thesaurus. Try to implement most of those skills into your CV in either an “About me” section, as explained above, or your work experiences or skills section.</p><p>In the example below, I highlighted all skills needed for a Data Analyst job in the Finance and Accounting department. It is an artificial job description I wrote, so I won’t get in trouble with copyrights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K8X-KziJZz8GqiFyrNZkgQ.png" /><figcaption>Hypothetical job description on an online job board. Image by author.</figcaption></figure><p>This is how you could cover two of the named skills in your work experience section in your CV:</p><p><strong>Data Analyst at XYZ (2018–Now)</strong></p><ul><li>Created and updated 2–5 KPI reports per month using <strong>Tableau</strong></li><li><strong>Analyzed</strong> the lifetime journey of key customers and supported product owner with data insights to <strong>assist in decision making</strong></li></ul><h4>3. Use the STAR or CAR method to describe previous work or project experience</h4><p>When listing your previous work experience or project work (recommended if you haven’t got any relevant work experience), you should describe every role in one or two bullet points. The <strong>STAR</strong> or <strong>CAR</strong> method can help you sell your experience &amp; skills more appealingly. Rather than just adding random bullet points, tell a coherent story that makes you stand out of the crowd. The STAR method stands for “Situation, Task, Activity, Result” and the CAR method for “Challenge, Activity, Result”.</p><p>When writing on your short descriptions, start with the</p><ol><li><strong>Situation</strong> and <strong>Task</strong> or the <strong>Challenge</strong> you saw yourself exposed to. This could be a problem your company was facing, or you saw yourself confronted within your own project. Follow with the</li><li><strong>Action</strong> you took to solve the task or overcame the challenge. And finish it up with the</li><li><strong>Result</strong> you achieved by tackling the challenge</li></ol><p>If possible, <em>quantify</em> the results or the added value for your company. This makes it very easy for recruiters to assess your achievements, value, and contributions to a company (or own project). For example:</p><p>Data Scientist at XYZ (<strong>Situation/Task</strong>)</p><ul><li>Analyzed workforce tenure and developed a termination prediction model (<strong>Action</strong>), which resulted in a 5% reduction of employee turnover (<strong>Result</strong>)</li><li>Identified bottlenecks (<strong>Challenge</strong>) in the production process (<strong>Action</strong>) that contributed to reducing the overall production time by 30% (<strong>Result</strong>)</li></ul><p>The CAR and STAR method can also be applied as a strategy when answering questions in an interview.</p><h3>Tips for the job hunt</h3><h4>4. Read Steve Daltons “The 2-hour job search”</h4><p>The <a href="https://2hourjobsearch.com/">2 Hour Job Search</a> (2HJS) by Steve Dalton is a guide on job hunting and its new meaning in the 21st century. In his book, Dalton stresses on the importance of networking in the digital era of information overexposure and short attention spans.</p><blockquote>Who has the time to read hundreds of CVs? Recruiters today read resumes the way most of us read websites — ignoring a majority of what’s on the page […] Employers these days rely instead on internal referrals to decide whom to interview. […] The only way to get internal referrals is through networking.</blockquote><p>The book is divided into three parts. The first part deals with how to efficiently prioritize future employers and move away from reading through online job postings for hours. The second part of the book addresses the approach of future contacts who work for an employer of interest to you. Here, Dalton provides useful tools and strategies (e.g., the 6-Point Email process) to efficiently and effectively build a network of Advocates around you.</p><p>In a third part of the book, called “Convince”, he discusses how to build a good relationship with the newly built contact in an <strong>informational interview</strong>, which ideally would lead to a referral. However, Dalton definitely sells the other benefits an informational can have: <em>learning</em> and <em>getting insights</em> from an expert in the field.</p><p>I read the book but did not apply the exact 2HJS strategy because I heard about it too late. Nevertheless, I must say that I learned a lot about time management in the job search and the recruiters’ perspective. I recommend reading it if you do not yet have a strong professional network, are procrastinating with your job hunt, or still haven’t heard back from any of the many applications you have sent so far. This book may help you change your view and strategy.</p><h4>5. Use LinkedIn to network</h4><p>Tying in with Daltons’ book, the business school’s recruiter advised me to use <strong>LinkedIn</strong> as my main networking platform. He also encouraged me to approach strangers at my dream company to get “a foot in the door” using <strong>customized messages</strong>. This advice is definitely NOT what I would have ever imagined myself doing, but I was quickly convinced this is such a useful way to build relationships.</p><p>Of course, not everyone you randomly reach out to on LinkedIn will take the bait, but once you start, you will be surprised how many actually get back to you. And why? Because most of the people in desired positions are proud of what they do and, even better: love talking about their job and successes.</p><p>Although I did not get my job through this approach, I can tell that this has greatly extended my network in the field and location I recently moved to. For concrete tips and tools on how to approach people and build your network, I would recommend Daltons’ 2HJS again.</p><h3>Tips for an initial interview</h3><h4>6. Create a company profile with all essential information</h4><p>Once you got a referral or passed the CV screening and the company believes you are a good fit, you most likely will be contacted to schedule a first <strong>initial interview</strong>. This is not to confuse with the informational meeting covered in point 4. Although sometimes these can overlap.</p><p>Initial interviews are often via phone and led by a general recruiter to get to know you better and learn about your intentions and expectations. Also, recruiters often test whether you have prepared yourself and done some research on the company. So preparation is everything!</p><p>The recruiting agent advised me to prepare a <strong>company profile</strong> for each firm I had an interview with, including the essential information about the company. This could comprise names of the founders or management board, flagship products, financing rounds or known investors, and also current news and critiques in the media. Since most initial interviews are over the phone, you can have the company profile in front of you at any time instead of clicking through the web without orientation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*U8ihegmtDoNBzoMtiVaZXw.png" /><figcaption>Example of a company profile. It again is based on an artificial company that doesn’t exist. Make sure to at least <strong>google</strong> the company and scan <strong>its website</strong>. Image by author.</figcaption></figure><p>The most obvious benefit from preparing a company profile is being able to answer questions about the company and showing off that you have done your research.</p><p>However, I can tell from my own experience that they are also an excellent source for developing questions you may have. Asking questions is another good way to show a recruiter that you have been engaged with the company’s story and products. It shows you are curious, eager to learn more, and often sends the right signals.</p><p><em>Now, I wish you a successful application process and please leave a comment if you have any doubts, comments or suggestions!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49b17249607e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/6-tips-i-learned-from-a-recruiting-specialist-at-a-business-school-49b17249607e">6 Tips I Learned From A Recruiting Specialist At A Business School</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting And Treating Outliers In Python — Part 1]]></title>
            <link>https://medium.com/data-science/detecting-and-treating-outliers-in-python-part-1-4ece5098b755?source=rss-ba4ebbd0afd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ece5098b755</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[outlier-detection]]></category>
            <category><![CDATA[outliers]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Alicia Horsch]]></dc:creator>
            <pubDate>Sun, 22 Nov 2020 16:50:43 GMT</pubDate>
            <atom:updated>2021-12-21T13:43:26.717Z</atom:updated>
            <content:encoded><![CDATA[<h3>Detecting And Treating Outliers In Python — Part 1</h3><h4>Hands-On Tutorial On Univariate Outliers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYvBx5XscH73vrrZ5EevTg.jpeg" /><figcaption>Image by Will Myers on <a href="https://unsplash.com/photos/ku_ttDpqIVc">Unsplash</a></figcaption></figure><p>An Explorative Data Analysis (EDA) is crucial when working on data science projects. Knowing your data inside and out can simplify decision making concerning the selection of features, algorithms, and hyperparameters. One essential part of the EDA is the detection of <strong>outliers</strong>. Simply said, outliers are observations that are far away from the other data points in a random sample of a population.</p><h4><strong>But why can outliers cause problems?</strong></h4><p>Because in data science, we often want to make assumptions about a specific population. Extreme values, however, can have a significant impact on conclusions drawn from data or machine learning models. With outlier detection and treatment, anomalous observations are viewed as part of different populations to ensure stable findings for the population of interest.</p><p>When identified, outliers may reveal unexpected knowledge about a population, which also justifies their special handling during EDA.</p><p>Moreover, inaccuracies in data collection and processing can create so-called error-outliers. These measurements often do not belong to the population we are interested in and therefore need treatment.</p><h4><strong>Different types of outliers</strong></h4><p>One must distinguish between <strong>univariate</strong> and <strong>multivariate outliers</strong>. Univariate outliers are extreme values in the distribution of a specific variable, whereas multivariate outliers are a combination of values in an observation that is unlikely. For example, a univariate outlier could be a human age measurement of 120 years or a temperature measurement in Antarctica of 50 degrees Celsius.</p><p>A multivariate outlier could be an observation of a human with a height measurement of 2 meters (in the 95th percentile) and a weight measurement of 50kg (in the 5th percentile). Both types of outliers can affect the outcome of an analysis but are detected and treated differently.</p><h3>Tutorial on univariate outliers using Python</h3><p>This first post will deal with the detection of univariate outliers, followed by a second article on multivariate outliers. In a third article, I will write about how outliers of both types can be treated.</p><p>Outliers can be discovered in various ways, including statistical methods, proximity-based methods, or supervised outlier detection. In this article series, I will solely focus on commonly used <em>statistical methods</em>.</p><p>I will use the Boston housing data set for illustration and provide example code in Python (3), so you can easily follow along. The Boston housing data set is part of the sklearn library.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a196ec84075b414080626a24c8a4bf8/href">https://medium.com/media/4a196ec84075b414080626a24c8a4bf8/href</a></iframe><h4><strong>Visualizing outliers</strong></h4><p>A first and useful step in detecting univariate outliers is the visualization of a variables’ distribution. Typically, when conducting an EDA, this needs to be done for all interesting variables of a data set individually. An easy way to visually summarize the distribution of a variable is the <strong>box plot</strong>.</p><p>In a box plot, introduced by John Tukey in 1970, the data is divided into quartiles. It usually shows a rectangular box representing 25%-75% of a sample’s observations, extended by so-called whiskers that reach the minimum and maximum data entry. Observations shown outside of the whiskers are outliers (explained in more detail below).</p><p>Let’s see an example. The plot below shows the majority of variables included in the Boston housing dataset. To receive a quick overview of all variables’ distributions, you can use a group plot. Be aware that variables can differ in scale, and adding all variables into one grid may lead to some hard to read charts. I ran df.describe() first to get an idea of each variable’s scale and then created three group plots for three different variable groups. Here is an example of medium scaled variables:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e03f2accce69b7122873a18a5f4af513/href">https://medium.com/media/e03f2accce69b7122873a18a5f4af513/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*tqVMtZJyfV1nj_eSSKUOnw.png" /><figcaption>Image by author</figcaption></figure><p>It appears there are three variables, precisely AGE, INDUS, and RAD, with no univariate outlier observations. The remaining variables all have data points beyond their whiskers.</p><p>Let’s look closer into the variable ‘CRIM’, which encodes the crime rate per capita by town. The individual box plot below shows that the crime rate in most towns is below 5%.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/094773c37ac568700c48692163f57388/href">https://medium.com/media/094773c37ac568700c48692163f57388/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*22Xulo9DtDe7RW5QGYURHw.png" /><figcaption>Image by author</figcaption></figure><p>Box plots are great to summarize and visualize the distribution of variables easily and quickly. However, they do not identify the actual indexes of the outlying observations. In the following, I will discuss three quantitative methods commonly used in statistics for the detection of univariate outliers:</p><ul><li>Tukey’s box plot method</li><li>Internally studentized residuals (AKA z-score method)</li><li>Median Absolute Deviation method</li></ul><h4><strong>Tukey’s box plot method</strong></h4><p>Next to its visual benefits, the box plot provides useful statistics to identify individual observations as outliers. Tukey distinguishes between <strong>possible</strong> and <strong>probable outliers</strong>. A possible outlier is located between the <strong>inner</strong> and the <strong>outer fence</strong>, whereas a probable outlier is located outside the outer fence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*vQyvZ7yZpLcFk7eDdoc5lg.png" /><figcaption>Example of a box plot including the inner and outer fences and minimum and maximum observations (known as whiskers). Image by Stephanie Glen on <a href="https://www.statisticshowto.com/upper-and-lower-fences/">statisticsHowTo.com</a></figcaption></figure><p>While the inner (often confused with the whiskers) and outer fence are usually not shown on the actual box plot, they can be calculated using the <strong>interquartile range </strong>(IQR) like this:</p><p><em>IQR =Q3 - Q1, whereas q3 := 75th quartile and q1 := 25th quartile</em></p><p><em>Inner fence = [Q1-1.5*IQR, Q3+1.5*IQR]</em></p><p><em>Outer fence = [Q1–3*IQR, Q3+3*IQR]</em></p><p>The distribution’s inner fence is defined as 1.5 x IQR below Q1, and 1.5 x IQR above Q3. The outer fence is defined as 3 x IQR below Q1, and 3 x IQR above Q3. Following Tukey, only the probable outliers are treated, which lie outside the outer fence. For the underlying example, this means:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7853b86393f9c5119854a584dc67e6d/href">https://medium.com/media/c7853b86393f9c5119854a584dc67e6d/href</a></iframe><p>30 observations of the variable ‘crime rate per capita by town’ can be seen as probable and 66 as possible outliers and need further attention. You can easily find the outliers of all other variables in the data set by calling the function <strong>tukeys_method</strong> for each variable (line 28 above).</p><p>The great advantage of Tukey’s box plot method is that the statistics (e.g. IQR, inner and outer fence) are robust to outliers, meaning to find one outlier is independent of all other outliers. Also, the statistics are easy to calculate. Furthermore, this method does not require a normal distribution of the data, which is often <em>not</em> guaranteed in real-life settings. If a distribution is highly skewed (usually found in real-life data), the Tukey method can be extended to the <strong>log-IQ method</strong>. Here, each value is transformed to its logarithm before calculating the inner and outer fences.</p><p><em>Edit from December 2021: I used a log(x+1) transformation to avoid log(0) which is not defined and can cause errors. Read more about different options </em><a href="https://discuss.analyticsvidhya.com/t/methods-to-deal-with-zero-values-while-performing-log-transformation-of-variable/2431/3"><em>here</em></a><em>.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d8fd6bd72b7993fcc8e7509ec15f1b53/href">https://medium.com/media/d8fd6bd72b7993fcc8e7509ec15f1b53/href</a></iframe><h4><strong>Internally studentized residuals AKA z-score method</strong></h4><p>Another commonly used method to detect univariate outliers is the <strong>internally standardized residuals</strong>, aka the <strong>z-score method</strong>. For each observation (Xn), it is measured how many standard deviations the data point is away from its mean (X̄).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*2nsMcdyUFXe44SXKiqgHOA.png" /><figcaption>Image by author</figcaption></figure><p>Following a common rule of thumb, if z &gt; C, where C is usually set to 3, the observation is marked as an outlier. This rule stems from the fact that if a variable is normally distributed, 99.7% of all data points are located 3 standard deviations around the mean. Let’s see on our example, which observations of ‘CRIM’ are detected to be outliers using the z-score:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca9c60b8368369c50c5b1f65556a387e/href">https://medium.com/media/ca9c60b8368369c50c5b1f65556a387e/href</a></iframe><p>When using the z-score method, 8 observations are marked as outliers. However, this method is highly limited as the distributions mean and standard deviation are sensitive to outliers. This means that finding one outlier is dependent on other outliers as every observation directly affects the mean.</p><p>Moreover, the z-score method assumes the variable of interest to be normally distributed. A more robust method that can be used instead is the externally studentized residuals. Here, the influence of the examined data point is removed from the calculation of the mean and standard deviation, like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*nPcDCx1YsRwprn65lxE3Hg.png" /><figcaption>Image by author</figcaption></figure><p>Nevertheless, the externally studentized residuals have limitations as the mean and standard deviations are still sensitive to other outliers and still expect the variable of interest X to be normally distributed.</p><h4><strong>Median Absolute Deviation method</strong></h4><p>The <strong>median absolute deviation method</strong> (MAD) replaces the mean and standard deviation with more robust statistics, like the median and median absolute deviation. The median absolute deviation is defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*u16eJX1px133bsMJa6fMbg.png" /><figcaption>Image by author</figcaption></figure><p>The test statistic is calculated like the z-score using robust statistics. Also, to identify outlying observations, the same cut-off point of 3 is used. If the test statistic lies above 3, it is marked as an outlier. Compared to the internally (z-score) and externally studentized residuals, this method is more robust to outliers and does assume X to be parametrically distributed (Examples of <a href="https://wiki.analytica.com/index.php?title=Parametric_discrete_distributions">discrete</a> and <a href="https://wiki.analytica.com/index.php?title=Parametric_continuous_distributions">continuous</a> parametric distributions).</p><p>Let’s see how many outliers are detected for variable ‘CRIM’ using the MAD method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e5be0b058afb39d8cbd4793764d8376/href">https://medium.com/media/0e5be0b058afb39d8cbd4793764d8376/href</a></iframe><p>We can see that the MAD method detects 165 outliers for the crime rate per capita by town and with that the most outliers of all methods.</p><h4>Wrapping up</h4><p>There are different ways to detect univariate outliers, each one coming with advantages and disadvantages. The <strong>z-score</strong> needs to be applied critically due to its sensitivity to mean and standard deviation and its assumption of a normally distributed variable. The <strong>MAD method</strong> is often used instead and serves as a more robust alternative. <strong>Tukey’s box plot method</strong> offers robust results and can be easily extended when the data is highly skewed.</p><p>To decide on the right approach for your own data set, closely examine your variables’ <em>distribution</em>, and use your <em>domain knowledge</em>.</p><p>In the next posting, I will address the <a href="https://towardsdatascience.com/detecting-and-treating-outliers-in-python-part-2-3a3319ec2c33">detection of multivariate outliers</a>.</p><p><strong><em>Resources:</em></strong></p><ul><li><a href="https://link.springer.com/chapter/10.1007/978-3-319-43742-2_14">https://link.springer.com/chapter/10.1007/978-3-319-43742-2_14</a></li><li><a href="https://www.rips-irsp.com/articles/10.5334/irsp.289/">https://www.rips-irsp.com/articles/10.5334/irsp.289/</a></li><li><a href="http://d-scholarship.pitt.edu/7948/1/Seo.pdf">http://d-scholarship.pitt.edu/7948/1/Seo.pdf</a></li><li><a href="http://www.hermanaguinis.com/ORMoutliers.pdf">http://www.hermanaguinis.com/ORMoutliers.pdf</a></li><li><a href="https://www.statisticshowto.com/upper-and-lower-fences/">https://www.statisticshowto.com/upper-and-lower-fences/</a></li><li><a href="https://wiki.analytica.com/index.php?title=Probability_Distributions">https://wiki.analytica.com/index.php?title=Probability_Distributions</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ece5098b755" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/detecting-and-treating-outliers-in-python-part-1-4ece5098b755">Detecting And Treating Outliers In Python — Part 1</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[6 Podcasts For Building A Career In Data Science]]></title>
            <link>https://medium.com/data-science/6-podcasts-for-building-a-career-in-data-science-cd0b5ec3e40e?source=rss-ba4ebbd0afd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd0b5ec3e40e</guid>
            <category><![CDATA[podcast]]></category>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[career-paths]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[career-advice]]></category>
            <dc:creator><![CDATA[Alicia Horsch]]></dc:creator>
            <pubDate>Sun, 15 Nov 2020 17:54:32 GMT</pubDate>
            <atom:updated>2020-11-20T13:30:38.437Z</atom:updated>
            <content:encoded><![CDATA[<h4>From building your brand and interview tips to the essential technical skills</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n7bs6sIpi26fqQfdXvqBjw.jpeg" /><figcaption>Photo by Angelique Rademakers from <a href="https://www.reshot.com/photos/young-man-sitting-on-the-beach-listen-to-some-music-thruw-his-headphone-and-next-to-him-lay-his-bike_rs_x6o0AX">Reshot</a></figcaption></figure><p>There are many free resources on the web to become a better data scientist. One of them being podcasts. Podcasts are a useful source to learn from professionals with experience in the field, technical hacks, or to get used to the data science jargon. Most episodes are between 30–60 minutes and, therefore, a great companion for your daily trip to work or university, while working out or just in between.</p><p>You can find some great collections of the best podcasts in data science, engineering, and business already on Medium. While I find some of these podcasts very technical, often covering niche projects, I have enjoyed listening to talks dedicated explicitly to career development in data science and personal growth.</p><p>Here is a list of 6 podcasts I regularly listen to that focus on how to succeed in data science and progress in your career:</p><h3>1. Build a Career in Data Science</h3><p>In this fairly new podcast (since September 2020), Jaqueline Nolis and Emily Robinson bring their newly published book with the same title to life. It is not the audio version of the print but rather complementary chats to the topics covered in their book, such as starting a career, getting the first job, and growing in data science.</p><p>They are first on my list because Jaqueline and Emily have been frequent guests in most of the shows I will list below, proving they are trusted experts in career building in data science. Also, both with interesting backgrounds, they have a lot to share and do that in a fun way (and I mean the intro jingle!!!). In the first published episodes, you learn about various job descriptions in data science, different responsibilities depending on the size of the employer, or discussing Ph.D. versus Bootcamp options.</p><p><strong>Available on</strong>: Spotify, Apple Podcasts, Google Podcasts, Pocket casts, or <a href="https://anchor.fm/datascicareer">here</a>.</p><p><strong>Favourite episode so far</strong>: Chapter 2 — Data Science Companies</p><h3>2. The Artists of Data Science</h3><p>In the Artists of Data Science, Harpreet Sahota interviews professionals and academics about career development and their job experiences in data science. I enjoy this podcast a lot because Harpreet dedicates his podcast solely to personal growth. He is also fun to listen to and always seems 100% engaged in the show.</p><p>Moreover, he posts a few episodes per week, making him the most frequent podcaster on my list with a lot of content to learn from. Next to his interviews, Harpreet records the so-called weekly “Office hours,” for which you can sign up and ask data-science-related questions. I recommend listening or signing up for those episodes to hear other people’s questions or asking your own.</p><p><strong>Available on</strong>: Spotify, Google Podcasts, Apple Podcasts, or <a href="https://theartistsofdatascience.fireside.fm/">here</a>.</p><p><strong>Favourite episode so far</strong>: Become an Ultralearner with Scott H. Young</p><h3>3. SuperDataScience</h3><p>In contrast to the reasonably new podcasts introduced above, Kirill Eremenko has been publishing podcast episodes for SuperDataScience every week for the last four years. Sponsored by the learning platform with the same name, Kiril talks experienced professionals from the field to discuss data-related topics ranging from data visualisation over mastering job interviews to working better remotely.</p><p>I enjoy the podcast because Kirill also covers personal growth topics like productivity, meditation, or the imposter syndrome. He finds the right mix between technical and self-development talk. Moreover, every Friday, Kirill posts a “Friday Five minutes” episode to either briefly explain technical concepts such as the p-value or share tips and ideas to progress in your career. For me, especially those short episodes have been a great source of inspiration.</p><p><strong>Available on</strong>: Spotify, Listen Notes, Soundcloud, or <a href="https://www.superdatascience.com/podcast">here</a>.</p><p><strong>Favourite episode so far</strong>: SDS 399 — Contributing to the Community and SDS 303 — Proper Hypothesis Testing For Every Field</p><h3>4. Towards Data Science Podcast</h3><p>The Towards Data Science podcast is the official podcast series from the famous Medium publication. It specialises in sharing general ideas around data science, also covering career advice, self-learning stories, and industry trends. I enjoy this podcast series, although it sometimes depends on who is hosting it. Whenever Jeremy Harris is hosting, who I believe is the primary host, it is worth tuning in!</p><p><strong>Available on</strong>: Spotify, Google Podcasts, Apple Podcasts, or <a href="https://towardsdatascience.com/podcast/home">here</a>.</p><p><strong>Favourite episode so far</strong>: Edouard Harris — Mastering the data science job hunt</p><h3>5. DataFramed</h3><p>The DataFramed podcast, hosted by Hugo Bowne-Anderson, is the podcast series from the learning platform Datacamp. Like the TDS podcast, DataFramed is not solely dedicated to career-building; however, a few episodes address personal development and career. I feel like Hugo does a lot of chattering but it is worth listening to the episodes until the end when the most exciting things are discussed. Here, I have learned some great stuff!</p><p>One thing I cannot make my mind up about are the segments that are played during every episode. A segment is sometimes for advertisement or sometimes to briefly explain a vital statistical concept like AB-testing. These segments are often <em>super</em> interesting, but they are also completely out of context.</p><p><strong>Available on</strong>: Spotify, Google Podcasts, Apple Podcasts, or <a href="https://www.datacamp.com/community/podcast">here</a>.</p><p><strong>Favourite episode so far</strong>: #55 Getting your first data science job</p><h4>And especially for the ladies…</h4><h3>6. Women in Data Science</h3><p>In her podcast, Women in Data Science, Prof. Margot Gerritsen interviews only women who apply data science in many different industries and sectors. These are truly inspirational stories from powerful individuals. Throughout the show, you learn about the vast number of domains data can have an impact on and listen to women’s personal experiences in a STEM-related job.</p><p><strong>Available on</strong>: Spotify, Google Podcasts, Apple Podcasts, Stitcher, or <a href="https://www.widsconference.org/podcast.html">here</a>.</p><p><strong>Favourite episode so far</strong>: Ya Xu — Using Data To Create Economic Opportunities For All Members Of Global Workforce</p><p>Happy listening!</p><p><em>And if you think my list is missing a great podcast for career building in data science, please leave a comment!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd0b5ec3e40e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/6-podcasts-for-building-a-career-in-data-science-cd0b5ec3e40e">6 Podcasts For Building A Career In Data Science</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>