<?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 Andrew Walsh on Medium]]></title>
        <description><![CDATA[Stories by Andrew Walsh on Medium]]></description>
        <link>https://medium.com/@4thLawOfRobotics?source=rss-a61253e8882e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5d_n6gzukmxRjyIagJlC_A.jpeg</url>
            <title>Stories by Andrew Walsh on Medium</title>
            <link>https://medium.com/@4thLawOfRobotics?source=rss-a61253e8882e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:55:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@4thLawOfRobotics/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[The Journey of the Runny Nose]]></title>
            <link>https://medium.com/@4thLawOfRobotics/the-journey-of-the-runny-nose-74370bea743f?source=rss-a61253e8882e------2</link>
            <guid isPermaLink="false">https://medium.com/p/74370bea743f</guid>
            <category><![CDATA[allergies]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Andrew Walsh]]></dc:creator>
            <pubDate>Mon, 28 Jan 2019 11:04:22 GMT</pubDate>
            <atom:updated>2019-01-30T21:44:30.459Z</atom:updated>
            <content:encoded><![CDATA[<h4>My Second Metis Data Science Bootcamp Project</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lri6GF18TTOZGdm9v4PFrw.jpeg" /><figcaption>Various Pollen Seen Up Close</figcaption></figure><h3>Introduction</h3><p>This is a reproduction of my Series as a normal blog post for non-mobile users. If you would like to read it as I wrote it, please <a href="https://medium.com/series/metis-data-science-bootcamp-project-2-a-journey-9870ab93b6ac">check out the series</a>. I used the series to document the ups and downs of my second project at Metis. I started the series part way through the project and decided to publish it as my blog post.</p><p>For this project, we need to train a model using linear regression. In addition to working on our own, we also get to pick our goal and data! (Un)surprisingly this is harder than it sounds.</p><p>For one, a linear regression model needs continuous data (e.g. temperature). Also, I need to scrape the data from a web page. Unsurprisingly, sites with good and/or interesting data aren’t too keen on you harvesting it all for your own use. At least, not without paying them!</p><p>So, what’s my question? And how will I get the data?</p><h3>My question</h3><p>I found this part harder than expected. One problem was all the ideas I had were categorical, not continuous. Still, after a lot of thought, I finally figured it out.</p><p>My question is going to be to determine a model for <strong>predicting pollen/mold counts</strong> for a location based on weather data.</p><p>Now to get some data! My wife loves the <a href="https://twitter.com/GottliebAllergy">Gottlieb allergy Twitter </a>feed for its accuracy, so that seems like a good place to start.</p><p>— Special thanks to <a href="https://medium.com/u/69d266764fb9">caseyhess </a>for talking me through how he got his idea, which helped me get my idea.</p><h3>What data?</h3><p>Getting usable data has been harder than expected! The Gottlieb feed contains only generalized levels (high, low, etc). And the government shutdown prevents me from easily accessing air quality data.</p><p>In looking for data I came across the <a href="https://deq.nc.gov/about/divisions/air-quality/air-quality-data/nata-epa-national-air-toxics-assessment-for-north-carolina/pollen-monitoring">NC Division of Air Quality</a>. They have a graph showing pollen levels for the last year. I accidentally hovered over a data point and, surprise, a specific number showed up under my mouse!</p><p>Looking through the page source, I found all of the 2018 pollen counts! They were stored in a JavaScript variable, making this a great data source. Not only do I now have some data, but I also have to scrape the web page to get it.</p><p>The only downside is that my wife was looking forward to me predicting pollen &amp; mold here in Chicago.</p><h3>But wait, there’s more!</h3><p>So the NC pollen count data has a bit of a problem. Specifically, there’s not enough of it. They only take readings during the season, and it looks like only on non-holiday work days. So for all of 2018, I have ~150 data points.</p><p>Thankfully, the Internet Archive captured the graph about a half dozen times over the last six years. It wasn’t every year, and an early year capture only gives a few months of data. However, after harvesting and deduplication, I have 800 rows of pollen data!</p><h3>The Weather</h3><p>I scraped the weather data for the nearby airport from Weather Underground. Specifically, I found their pages called a web service that returned a ton of data in JSON format.</p><p>I was able to limit my impact by getting the data a month at a time. I also only requesting the month for which I had pollen data.</p><p>After harvesting the data I merged it with the pollen data using the date. And now I have 800 rows of data for over 30 features!</p><h3>Cleanup</h3><p>I think if anything gives a Data Scientist nightmares it has to be bad data! My favorite is the <strong><em>197,667 °F</em></strong> minimum and maximum normal temperature for August 31st, 2012.</p><p>I’m using Pandas DataFrames to hold my data. I have become a <em>huge</em> fan of the <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.describe.html">describe</a> function. For every numeric column, it generates a set of common mathematical values. The most useful for me right now is min, 25th percentile, 75th percentile, and max.</p><p>These are very helpful in finding outlier values. These values can then either be excluded, corrected, or limited. For example, my tree pollen has a maximum value of 3257. However, since 90% of tree pollen counts are under 475 I have capped this value to 501.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*qj_FuVPaDerK4xeBUBm7Nw.png" /><figcaption>Left-skewed Maximum Normal Temperature</figcaption></figure><h3>Data Shaping</h3><p><em>aka “Wow, I’m becoming a Data Scientist!”</em></p><p>Now it gets interesting! My allergen data is right-skewed and a bunch of my feature data is left-skewed!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*Ccvi9D6e8A0VuwgqU6-Y-g.png" /><figcaption>Same data after flipping and taking the log</figcaption></figure><p>Fixing this requires first “flipping” the data to make it all right-skewed. Then I can take the natural log (ln). But since ln(0) is infinity, I also need to add 1 to a number of my columns.</p><p>The results vary by field, but the overall effect is to give a more “normal” distribution of values.</p><h3>Modeling</h3><p>This is where the rubber meets the road.</p><p>Sort of.</p><p>Using Linear Regression I didn’t find a strong linear relationship with weed and grass pollen and that days weather. And this makes some logical sense; these are more likely to be influenced by yesterdays weather.</p><p>With tree pollen, I was able to find a fairly strong linear relationship. Interestingly, my model appeared to get stronger when I added the day of the year. However, that feature appears to have no bearing on the model.</p><p>The biggest predictor for tree pollen is temperature. Every degree change in temperature results in a 120% change in tree pollen levels!</p><h3>Two Fun Graphs</h3><p>I’ll end this on two interesting graphs that I produced.</p><p>The first is a sample of what’s called a “pair plot”. For a given set of values, it shows scatter plots of all the A vs. B combinations. When it’s A vs. A it shows a histogram of that value. This is one of 9 pair plots I examined.</p><p>The second graph is a LARS graph. It shows how important each feature is to the overall model. It’s easiest to read from left to right. The first colored line represents the most important feature. The next line is the next most important, and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Jx31FHzAX2sIrVqObi_KjA.png" /><figcaption>Pair Plot with tree pollen data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*tNSXVJqc6PbUni_8QPCArw.png" /><figcaption>LARS for Tree Pollen</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74370bea743f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Journey of the Runny Nose]]></title>
            <link>https://medium.com/series/metis-data-science-bootcamp-project-2-a-journey-9870ab93b6ac?source=rss-a61253e8882e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9870ab93b6ac</guid>
            <dc:creator><![CDATA[Andrew Walsh]]></dc:creator>
            <pubDate>Thu, 24 Jan 2019 14:38:35 GMT</pubDate>
            <atom:updated>2019-01-30T21:47:52.659Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Journey of the Runny Nose</h3><h4>My Second Metis Data Science Bootcamp Project</h4><p>I will be using this series to document the ups and downs of my second project at Metis. I started this series part way through the project and have decided to publish it as my blog post.</p><h3>Introduction</h3><p>For this project, we need to train a model using linear regression. In addition to working on our own, we also get to pick our goal and data! (Un)surprisingly this is harder than it sounds.</p><p>For one, a linear regression model needs continuous data (e.g. temperature). Also, I need to scrape the data from a web page. Unsurprisingly, sites with good and/or interesting data aren’t too keen on you harvesting it all for your own use. At least, not without paying them!</p><p>So, what’s my question? And how will I get the data?</p><h3>My question</h3><p>I found this part harder than expected. One problem was all the ideas I had were categorical, not continuous. Still, after a lot of thought, I finally figured it out.</p><p>My question is going to be to determine a model for <strong>predicting pollen/mold counts</strong> for a location based on weather data.</p><p>Now to get some data! My wife loves the <a href="https://twitter.com/GottliebAllergy">Gottlieb allergy Twitter </a>feed for its accuracy, so that seems like a good place to start.</p><p>— Special thanks to <a href="https://medium.com/u/69d266764fb9">caseyhess </a>for talking me through how he got his idea, which helped me get my idea.</p><h3>What data?</h3><p>Getting usable data has been harder than expected! The Gottlieb feed contains only generalized levels (high, low, etc). And the government shutdown prevents me from easily accessing air quality data.</p><p>In looking for data I came across the <a href="https://deq.nc.gov/about/divisions/air-quality/air-quality-data/nata-epa-national-air-toxics-assessment-for-north-carolina/pollen-monitoring">NC Division of Air Quality</a>. They have a graph showing pollen levels for the last year. I accidentally hovered over a data point and, surprise, a specific number showed up under my mouse!</p><p>Looking through the page source, I found all of the 2018 pollen counts! They were stored in a JavaScript variable, making this a great data source. Not only do I now have some data, but I also have to scrape the web page to get it.</p><p>The only downside is that my wife was looking forward to me predicting pollen &amp; mold here in Chicago.</p><h3>But wait, there’s more!</h3><p>So the NC pollen count data has a bit of a problem. Specifically, there’s not enough of it. They only take readings during the season, and it looks like only on non-holiday work days. So for all of 2018, I have ~150 data points.</p><p>Thankfully, the Internet Archive captured the graph about a half dozen times over the last six years. It wasn’t every year, and an early year capture only gives a few months of data. However, after harvesting and deduplication, I have 800 rows of pollen data!</p><h3>The Weather</h3><p>I scraped the weather data for the nearby airport from Weather Underground. Specifically, I found their pages called a web service that returned a ton of data in JSON format.</p><p>I was able to limit my impact by getting the data a month at a time. I also only requesting the month for which I had pollen data.</p><p>After harvesting the data I merged it with the pollen data using the date. And now I have 800 rows of data for over 30 features!</p><h3>Cleanup</h3><p>I think if anything gives a Data Scientist nightmares it has to be bad data! My favorite is the <strong><em>197,667 °F</em></strong> minimum and maximum normal temperature for August 31st, 2012.</p><p>I’m using Pandas DataFrames to hold my data. I have become a <em>huge</em> fan of the <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.describe.html">describe</a> function. For every numeric column, it generates a set of common mathematical values. The most useful for me right now is min, 25th percentile, 75th percentile, and max.</p><p>These are very helpful in finding outlier values. These values can then either be excluded, corrected, or limited. For example, my tree pollen has a maximum value of 3257. However, since 90% of tree pollen counts are under 475 I have capped this value to 501.</p><h3>Data Shaping</h3><p><em>aka “Wow, I’m becoming a Data Scientist!”</em></p><p>Now it gets interesting! My allergen data is right-skewed and a bunch of my feature data is left-skewed!</p><p>Fixing this requires first “flipping” the data to make it all right-skewed. Then I can take the natural log (ln). But since ln(0) is infinity, I also need to add 1 to a number of my columns.</p><p>The results vary by field, but the overall effect is to give a more “normal” distribution of values. See the next card for a before and after example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*qj_FuVPaDerK4xeBUBm7Nw.png" /><figcaption>Left-skewed Maximum Normal Temperature</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*Ccvi9D6e8A0VuwgqU6-Y-g.png" /><figcaption>Same data after flipping and taking the log</figcaption></figure><h3>Modeling</h3><p>This is where the rubber meets the road.</p><p>Sort of.</p><p>Using Linear Regression I didn’t find a strong linear relationship with weed and grass pollen and that days weather. And this makes some logical sense; these are more likely to be influenced by yesterdays weather.</p><p>With tree pollen, I was able to find a fairly strong linear relationship. Interestingly, my model appeared to get stronger when I added the day of the year. However, that feature appears to have no bearing on the model.</p><p>The biggest predictor for tree pollen is temperature. Every degree change in temperature results in a 120% change in tree pollen levels!</p><h3>Two Fun Graphs</h3><p>I’ll end this on two interesting graphs that I produced.</p><p>The first is a sample of what’s called a “pair plot”. For a given set of values, it shows scatter plots of all the A vs. B combinations. When it’s A vs. A it shows a histogram of that value. This is one of 9 pair plots I examined.</p><p>The second graph is a LARS graph. It shows how important each feature is to the overall model. It’s easiest to read from left to right. The first colored line represents the most important feature. The next line is the next most important, and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Jx31FHzAX2sIrVqObi_KjA.png" /><figcaption>Pair Plot with Tree Pollen</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*tNSXVJqc6PbUni_8QPCArw.png" /><figcaption>LARS for Tree Pollen</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9870ab93b6ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snakes and Bears: Python, Pandas & My First Data Science Project]]></title>
            <link>https://medium.com/@4thLawOfRobotics/snakes-and-bears-python-pandas-my-first-data-science-project-f5093e70c5e6?source=rss-a61253e8882e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5093e70c5e6</guid>
            <category><![CDATA[bootcamp]]></category>
            <category><![CDATA[learning-python]]></category>
            <category><![CDATA[time]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[personal]]></category>
            <dc:creator><![CDATA[Andrew Walsh]]></dc:creator>
            <pubDate>Mon, 14 Jan 2019 10:34:53 GMT</pubDate>
            <atom:updated>2019-01-14T21:27:59.407Z</atom:updated>
            <content:encoded><![CDATA[<h3>Off to camp</h3><p>Despite being in Technology for over 20 years, I apparently haven’t learned my lesson. After attending the <a href="https://cloudplatformonline.com/Chicago-Summit-Roadshow-Home.html">Chicago Google Cloud Summit Roadshow</a> in October I decided to become a Data Scientist. I looked at several options before deciding to try for the <a href="https://www.thisismetis.com/data-science-bootcamps">Metis Data Science Bootcamp</a>; specifically the Winter 2019 cohort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*69hNbSb5p24p38aM9pOTvQ.jpeg" /><figcaption>Chicago Google Cloud Summit</figcaption></figure><p>That was at the end of October; on Friday I completed both my first week of boot camp and the first of several projects.</p><p>The time before boot camp started was busy. There was an application process that was more test then application. After that, I had 48 hours to take another test, complete a programming challenge, and prepare for an interview. Once I was finally accepted, <strong>then</strong> I started the 60 hours of pre-work.</p><h4>Our First Project Is Due When!?!</h4><p>Ok, I’ll admit that I kind of knew this was coming. I heard about it when I was invited to see the presentation of passion projects by the previous cohort.</p><p>Still, we started class on Monday and our first project was due Friday afternoon. And it wasn’t a fluff piece either. It was a group project to develop a 6-minute presentation. Our topic was how we, as a team of Data Scientists, could help an organization best target sign-up teams canvasing outside NYC subway stations.</p><p>If you want to know more check out the <a href="https://medium.com/@caseyhess/back-to-school-20-years-later-2e8131aa388f">great article</a> by one of my partners, <a href="https://medium.com/u/69d266764fb9">caseyhess</a>. He does a great job of explaining our project so, like any good programmer, I’m going to reuse his code. 😁</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LuItCaoFpzGSq3lDMUmSew.png" /><figcaption><a href="https://medium.com/@caseyhess/back-to-school-20-years-later-2e8131aa388f">Casey’s Article</a></figcaption></figure><p>Instead, I’m going to touch on some things that I need to remember. Especially given the hour at which I am writing this article.</p><h4>Ouroboros</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*JzkZ6vDxvSGzmVjCCNrdkg.png" /></figure><p>Obviously, the snakes are a reference to Python. While I can’t say that I love Python, I don’t hate it. I like it more than Perl, but that isn’t saying much.¹ I’ll admit that the idea of white space controlling code execution made my skin crawl. However, Guido van Rossum is right: you spend more time reading code than running code.</p><p>So why Ouroboros, the snake that eats its own tail? Because its the best way to describe what happens to me when I program. I will get pulled down into and go around and around and around.²</p><p><strong><em>I need to stop trying to write beautiful, elegant, fancy, or even generic code. I need to start with code that works.</em></strong></p><p>Later, when I have more free time, I can improve my code. But it doesn’t matter what kind of nice, generic ufuncs I’ve written if I haven’t processed any data!</p><h4>Pandas</h4><p>For those who don’t know, pandas is a Python library (hence bears). I currently have a love/hate relationship with Pandas. I love the idea of it. I hate having to code with it. I keep running into weird errors, type clashes, or my favorite: code doesn’t project correctly.</p><p>Some of this may be due to the Ouroboros problem. But I suspect not all of it. I think some of it is because I know SQL and Perl, so I keep expecting things to work a certain way.</p><p>If I continue to have problems, and with the goal of <a href="https://gettingthingsdone.com/"><strong><em>Getting Things Done</em></strong></a>, I may move to NumPy. Every time I use NumPy and basic Python structures I don’t seem to have a problem.</p><h4>Hello Muddah, Hello Fadduh.</h4><p>In conclusion, I don’t want to go home! I haven’t been this excited about IT in a long time. Up until this weekend, I was doing OK on time management. I’ve seen the mistakes I made both last week and over the weekend. And I think I know how I’ll deal with them.</p><p>If you’ve made it this far, thank you! I’ll be posting additional stories as I continue my journey to become a Data Scientist. Keep an eye out for my next story, in which I will talk about my investigation into CUDA and Python!</p><h4>My Fellow Campers</h4><p>My partners on this project were <a href="https://medium.com/u/69d266764fb9">caseyhess</a> and <a href="http://www.chicagoan.io/">Blake Gideon</a>. I linked to Casey’s blog post above. You can find Blake’s blog post <a href="http://www.chicagoan.io/what-happens-on-the-first-week-of-metis-bootcamp-an-analysis-new-york-citys-transit-system/">here</a>.</p><h4>Footnotes</h4><p>¹Although Perl does have great regex support. And I <strong>love</strong> regex!</p><p>²and around and around and &#39;around&#39;*np.iinfo(np.int64).max</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5093e70c5e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>