<?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 Marcus on Medium]]></title>
        <description><![CDATA[Stories by Marcus on Medium]]></description>
        <link>https://medium.com/@svenssonmarcus?source=rss-135dac1d8e6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HSByV33e9m15p0p8_ZXEsA.jpeg</url>
            <title>Stories by Marcus on Medium</title>
            <link>https://medium.com/@svenssonmarcus?source=rss-135dac1d8e6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:31:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@svenssonmarcus/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[Becoming a Data Scientist in 2021]]></title>
            <link>https://medium.com/swlh/becoming-a-data-scientist-in-2021-db7adec6ccfe?source=rss-135dac1d8e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/db7adec6ccfe</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Marcus]]></dc:creator>
            <pubDate>Fri, 26 Feb 2021 11:01:37 GMT</pubDate>
            <atom:updated>2021-02-28T15:02:50.502Z</atom:updated>
            <content:encoded><![CDATA[<h4>Including a powerful guide for serious beginners</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IvW1SHWUzDr1QY_q" /><figcaption>Photo by <a href="https://unsplash.com/@franki?utm_source=medium&amp;utm_medium=referral">Franki Chamaki</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Data Science is a field that has a lot of mixed emotions — massive hype around recent innovations, and plenty of resources telling you that in order to be a Data Scientist, you need to have an advanced math degree under your belt.</p><p>I disagree.</p><p>Now don’t get me wrong. Data Science <em>is </em>hard — there are a lot of things you’ll need to know about before you can call yourself a “Data Scientist”.</p><p>But take it one step at a time. There are slight workarounds to this rule, and this article will present you with a powerful learning guide if you are serious about becoming a Data Scientist.</p><h3>Start with the Mathematics</h3><p>Yes, you read that right. 99.9% of articles I come across instruct you to start with programming first. Bad move!</p><p>Data Science is a <em>math-laden</em> field, and in order to understand the many constructs in the field, you’ll need to have some kind of familiarity with math. Now, you <em>don’t </em>need a math degree for this, but you can use some of the following resources to (at least) read up on.</p><p>This Github repo includes a free roadmap to learn all the math behind AI:</p><p><a href="https://github.com/jasmcaus/ai-math-roadmap">jasmcaus/ai-math-roadmap</a></p><p>3 topics that are absolutely essential are Linear Algebra, Calculus, and Statistics. For the most part, you can get away with just Statistics, but either way, it’s good to know about the concepts that drive the field:</p><h4>Linear Algebra</h4><p>This branch of math is used (almost) everywhere in Data Science. Your computer uses a lot of Linear Algebra in a majority of its calculations. The processing and representation of deep neural networks use Linear Algebra. Quite frankly, you’re missing out on a lot if you don’t have at least a basic understanding of the concept.</p><ul><li><a href="https://www.khanacademy.org/math/linear-algebra">Khan Academy</a></li><li><a href="https://www.udemy.com/course/linear-algebra-theory-and-implementation/">Master Linear Algebra: From Theory to Implementation</a></li></ul><h4>Calculus</h4><p>Like Linear Algebra, Calculus too plays a large role in Data Science. But you don’t need to be a <em>guru</em>. All you need is a basic understanding of the core principles that affect your models.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8stueNPVl-I%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8stueNPVl-I&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8stueNPVl-I%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/83ab19abe6236701e45fee4ac8895801/href">https://medium.com/media/83ab19abe6236701e45fee4ac8895801/href</a></iframe><h4>Statistics &amp; Probability</h4><p>This topic will probably take up a significant chunk of your time. Good news: these concepts aren’t difficult, so there’s no reason why you shouldn’t master it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXwS2WTP1PI0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXwS2WTP1PI0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FXwS2WTP1PI0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a9e3f7b5b12a8ed1621bd398024e613/href">https://medium.com/media/1a9e3f7b5b12a8ed1621bd398024e613/href</a></iframe><h4>Miscellaneous Topics</h4><p>There are other topics that are useful, such as Graph Theory and Discrete Mathematics. You won’t be using them daily as a beginner, but expect to encounter them as you progress up the experience chain.</p><p>Still, if you’d like to have a quick read through:</p><ul><li><a href="https://cse.buffalo.edu/~rapaport/191/S09/whatisdiscmath.html">What Is Discrete Math?</a></li><li><a href="https://www.coursera.org/learn/graphs">Introduction to Graph Theory</a></li></ul><p>If you are terrified at the mere mention of “math”, you’re probably not going to have much fun as a Data Scientist. However, if you’re willing to invest time to improve your familiarity with the principles underlying calculus, linear algebra, stats, and probability, nothing — not even math — should get in the way of you becoming a Data Scientist.</p><p>PS: Math <em>really</em> is fun. As you go deeper into math, be sure to understand the beauty of a certain math concept and <em>how</em> it affects something. You’ll soon share the unbridled passion that many mathematicians and Data Scientists share!</p><h3>Programming</h3><p>Now to the more exciting part: programming. With <a href="https://www.socialmediatoday.com/news/how-much-data-is-generated-every-minute-infographic-1/525692/">more than 2.5 exabytes of data</a> being generated every day, it would be absurd <em>not</em> to use computers to analyze/find meaningful representations from that data.</p><p><strong>“How much programming is required in data science, particularly statistical analysis and machine learning?”</strong></p><p>A lot. In practice, most data science jobs will require you to code, and also because most companies require some data cleaning, implementation and productization, and adaptation of algorithms to their own specific purposes. If you can’t implement your own solutions into something product-ready, then you are a much less useful employee. (<a href="https://www.quora.com/How-much-programming-is-required-in-data-science-particularly-statistical-analysis-and-machine-learning-Should-a-data-scientist-care-more-about-analysis-interpretation-mathematics-rather-than-programming-What%E2%80%99s-wrong-in-using-a-GUI-based-tool">Source</a>)</p><h4>Python &amp; R</h4><p>Python is, by far, the most widely used programming language when it comes to Data Scientist. Almost four out of five developers say that Python is their main language in JetBrains’ 2016 survey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*E8tr-DCF2q2nHKMm.png" /><figcaption><a href="https://opensource.com/article/18/5/numbers-python-community-trends">Source</a></figcaption></figure><p>While Python may suffice for a majority of your tasks, you’ll need to have R on your toolkit as well to consider yourself a “<em>well-rounded</em>” Data Scientist. I recommend you focus on Python, and spend a little time on <a href="https://www.r-project.org/">R</a> as well.</p><ul><li><a href="https://docs.python-guide.org/intro/learning/">Learning Python - The Hitchhiker&#39;s Guide to Python</a></li><li><a href="https://www.datamentor.io/r-programming/">R Tutorial - Learn R Programming</a></li></ul><h4>Computer Vision</h4><p>Computer Vision today is at the forefront of many exciting developments in the fields of autonomous vehicles, medical image analysis and so much more. This field is responsible for deriving useful insights into, primarily, image data (although videos are used to some extent).</p><p>While many Computer Vision libraries like OpenCV and Torchvision exist today, I <em>highly recommend</em> you use <a href="https://github.com/jasmcaus/caer">Caer</a>, my Computer Vision library — it’s fast, lightweight, and extremely beginner-friendly.</p><p><a href="https://github.com/jasmcaus/caer">jasmcaus/caer</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FoXlwWbU8l2o%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DoXlwWbU8l2o&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FoXlwWbU8l2o%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d6522972bdbe13d088b2cc3f10ba861/href">https://medium.com/media/7d6522972bdbe13d088b2cc3f10ba861/href</a></iframe><h4>Machine Learning &amp; Deep Learning</h4><p>Today, Machine Learning and Deep Learning algorithms are at the core of Data Science. For most job openings, this is where the demand lies.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVyWAvY2CF9c%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVyWAvY2CF9c&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVyWAvY2CF9c%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a6db11fa08a37daf15b9dc3cbaa713d/href">https://medium.com/media/7a6db11fa08a37daf15b9dc3cbaa713d/href</a></iframe><p><a href="https://github.com/amueller/introduction_to_ml_with_python">GitHub - amueller/introduction_to_ml_with_python: Notebooks and code for the book &quot;Introduction to Machine Learning with Python&quot;</a></p><h3>Gaining Practical Experience</h3><p>If you follow the resources I’ve mentioned above, you’re just halfway there. Now, you need to put your skills into practice!</p><p>To truly master the concepts you’ve learned, invest your time in working on problems that closely resemble a real-world application. Working through erroneous data, and picking yourself up when you fail will help you gain a deep level of expertise in Data Science.</p><p>Platforms like <a href="https://kaggle.com/">Kaggle</a> offer a good starting point. Their machine learning competitions serve as a channel for brainstorming and it’s a great way to apply your newly-gained skills.</p><p>Here is a list of 10 Data Science Competitions for you to hone your skills:</p><p><a href="https://towardsdatascience.com/10-data-science-competitions-for-you-to-hone-your-skills-for-2020-32d87ee19cc9">11 Data Science Competitions for you to hone your skills for 2020</a></p><h3>Contributing to Open-Source</h3><p>An extremely good option to consider is to contribute to open-source projects, such as <a href="https://github.com/jasmcaus/caer">Caer</a>. Many people find it useful to gain “practical experience” while communicating on a pull request with many like-minded individuals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*oYG5qFbeENfSKLim940ctA.png" /><figcaption>An open-source project like <a href="https://github.com/jasmcaus/caer">Caer</a> is a good place to start.</figcaption></figure><h3>Closing Notes</h3><p>This article presented a powerful learning guide for those serious about getting into Data Science in 2021.</p><p>I do want to point out that this guide <strong>won’t </strong>work for you if you’re not willing to put in the work. It will help make your journey <em>smoother </em>and you’ll well be on your way to pursuing a career in Data Science!</p><p>Remember,</p><blockquote>Keep the big picture in mind!</blockquote><p>Happy Learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db7adec6ccfe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/becoming-a-data-scientist-in-2021-db7adec6ccfe">Becoming a Data Scientist in 2021</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Truth About Data Science —Why It Isn’t As Rosy as You Might Imagine]]></title>
            <link>https://medium.datadriveninvestor.com/the-truth-about-data-science-why-it-isnt-as-rosy-as-you-might-imagine-c2cf9864be0?source=rss-135dac1d8e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2cf9864be0</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Marcus]]></dc:creator>
            <pubDate>Sat, 20 Feb 2021 06:54:01 GMT</pubDate>
            <atom:updated>2021-02-20T15:41:18.634Z</atom:updated>
            <content:encoded><![CDATA[<h4>Before jumping into a career in Data Science, it’s best to look at the market from a different lens</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b3JNm5rLaE1J-Ilb" /><figcaption>Photo by <a href="https://unsplash.com/@icons8?utm_source=medium&amp;utm_medium=referral">Icons8 Team</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When Harvard Business Review came out with its article labelling <a href="https://hbr.org/2012/10/data-scientist-the-sexiest-job-of-the-21st-century">Data Science the sexiest job of the 21st century</a>, it grabbed a lot of eyeballs. Safe to say that that ~3000-word article initiates a mad frenzy as people scrambled to learn Data Science with the eventual hope of becoming a Data Scientist.</p><p>About 10 years later, that hype doesn’t seem to be dying anytime soon (if any, it has exploded exponentially).</p><p>But before you think about transitioning into this — admittedly — very lucrative field, there are a few truths that no one seems to be talking about, and which you <em>absolutely must</em> know before the eventual career shift.</p><h3>Supply far exceeds Demand</h3><p>A few years ago, if you knew at least a little bit about Machine Learning and Data Visualization techniques, you’d be hired for $100k+ jobs and get to work on interesting projects.</p><p>However, this landscape looks very different now for Data Scientists. Each year, universities, online courses and (dozens) of YouTube videos pump out tens of thousands of <em>newly-minted</em> Data Scientists. Besides them, many Data Analysts switched their LinkedIn “profession” to <strong>Data Scientist</strong><em>.</em></p><p>And all of a sudden, you see this huge bubble of Data Scientists whose count far exceeds the number of available jobs. As you can imagine:</p><blockquote>Supply &gt;&gt; Demand</blockquote><h3>Recruiters often have no idea of what a “Real Data Scientist” looks like</h3><p>The title says it all. Some recruiters for Data Scientists jobs are <em>terrible</em> at spotting good talent: <em>“Oh, you’ve got 6–10 years of experience? Let’s hire ya”.</em></p><p>Coming back to the first point: most small-scale companies literally aren’t ready to take on a Data Scientist. So whether their “data journey” is at the point of deploying Machine Learning algorithms in production or not, they <em>must </em>absolutely need Data Scientists because <em>“Data Science is cool now”.</em></p><blockquote>So while you might spend years perfecting all these Machine Learning algorithms and skills, all you might end up doing is manually filling in Excel spreadsheets (after all, a Data Scientist does work with “data”, no?).</blockquote><p>It’s a clear example of Expectation vs Reality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/0*6Oa7OW5Gewzak5KB.png" /><figcaption><a href="https://blog.penquin.co.za/blog/the-6-instances-where-expectations-didnt-match-reality-in-the-world-of-marketing">Source</a></figcaption></figure><p>Every company is different, so I can’t really speak for all of them. But, many don’t have the necessary infrastructure in place to derive real value from data. This eventually lends itself to the <a href="https://towardsdatascience.com/the-cold-start-problem-with-artificial-intelligence-49938ed3f612"><em>cold start problem</em> in Artificial Intelligence</a>.</p><p>Oh, and if you see a prospective job specification that cites a long list (&gt;5) of software and skills you must have, stay well clear: it reeks of a fundamental problem of a company that has no idea what their data strategy should be and their willingness to hire anyone because they think that “hiring any data person will fix all of their data problems”.</p><h3>Data Science involves a lot of Math</h3><p>Emphasis on <em>a lot</em>. I suppose this point would make more sense to those toying with the idea of becoming a Data Scientist than it would to professional Data Scientists.</p><p>You’ll see a lot of multivariate calculus, linear algebra, statistics, probability, and information theory used in several Machine Learning algorithms and even in Data Mining.</p><p>So, if you’re terrified of math and disregard the sight of mathematical equations, you’re not going to have much fun as a data scientist. But luckily there are <a href="https://towardsdatascience.com/all-the-mathematics-you-need-for-artificial-intelligence-abdd26895977">articles</a> and <a href="https://www.coursera.org/specializations/mathematics-machine-learning">courses</a> that bridge this gap and make it a tad bit easier to transition into Data Science especially if you don’t have a math degree under your belt.</p><p><a href="https://towardsdatascience.com/all-the-mathematics-you-need-for-artificial-intelligence-abdd26895977">All The Mathematics You Need For Artificial Intelligence</a></p><h3>Is Data Science Right For You?</h3><p>Before you rush into things, its always best to take a few minutes and analyze whether or not Data Science is right for you.</p><p>Are you driven solely by the high salaries and the prestige that comes along with it?</p><p>Bad move!</p><p>The thing with Data Science is that even if you’re deeply passionate about it, you can’t force yourself to love the process. If you dislike the feelings that come with Data Science, it will be difficult to maintain your motivation in the long run.</p><p>My advice: <strong>Do your research!</strong></p><p>Watch videos and read articles on the <a href="https://www.youtube.com/watch?v=Ck0ozfJV9-g">day-to-day life of a Data Scientist</a> and the <a href="https://youtu.be/8LucP1wiX1g">Reality vs Expectation</a>. A little research, in the beginning, will go a long way in helping you make the right choice.</p><h3>What You Can Do</h3><p>Simple: stay ahead of the bubble (or burst it wide open)!</p><p>I could go the usual approach and recommend you take on 15 courses online, get a math degree, yada yada. But this is fundamentally WRONG.</p><p>I’m sure — judging from many of my friends’ experiences — that you might <em>already</em> be in the possession of dozens of certifications (if not, don’t worry), but I’ll give you 3 simple — yet effective — tips that might actually bear fruit to you in the long run:</p><h3>1. Understand the field &amp; identify the right company</h3><p>Many companies in different fields require Data Scientists for different reasons. A financial conglomerate might require you to use historical data to minimize risk; a governmental organization might need smart technology implemented in a city; a sales company might need you to help them effectively tailor their marketing campaigns to target the right customer.</p><p>The better you understand the field — financial, sales, video-publishing — the more likely you are to succeed in it. Identify a company that actually has a more-or-less reasonable data strategy and stay clear from companies that don’t themselves understand what they want.</p><h3>2. Find a Mentor</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PHC4OQW7v93gcUN5" /><figcaption>Photo by <a href="https://unsplash.com/@neonbrand?utm_source=medium&amp;utm_medium=referral">NeONBRAND</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’re planning to apply to company X, find an employee/executive who works at the same company and have a quick chat — virtual or in-person — with them. Many folks are happy to help others and give (often) very helpful advice. Speak to other data scientists on Twitter, reach out to them on LinkedIn, or even join a discussion on Reddit.</p><h3>3. Read, Read, and Read the News</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6IKgmWAovdDNj1jg" /><figcaption>Photo by <a href="https://unsplash.com/@timmossholder?utm_source=medium&amp;utm_medium=referral">Tim Mossholder</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you don’t read the news every day, there’s a pretty good chance you won’t be ahead of the game.</p><p>Data, today, is exploding at an exponential rate. Chances are that the algorithm you were tinkering around for months on was solved by someone else this morning. But of course, you didn’t know this because you were too busy sipping your hot morning latte.</p><p>Keep up with the news, subscribe to the right blog/podcast, or receive the right email newsletter might <em>just </em>be the solution you’ve overlooked.</p><h3>Conclusion</h3><p>To be an effective data scientist in the industry today, it doesn’t quite suffice to do well in Kaggle competitions and complete popular online courses. (Un)fortunately — depending on how you look at it — aiming to become a full-time Data Scientist may not currently be the best career move for you: it involves understanding how business works and finding a company that is aligned with your critical path which may not agree with certain individuals.</p><p>But needless to say, there may be times when you’ll need to readjust your expectations of what to expect from a data science role in this ever-changing field.</p><p>While this article is not a way to put you off the job, it is a means to open your eyes to the actuality of this supposed “rosy” field of Data Science.</p><p>I am strongly against the view that you must plainly submit yourself to this hype solely because of its lucrative offerings. Consider both sides, and understand what you might be getting into.</p><blockquote>Remember, your expectations may not match the reality.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2cf9864be0" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/the-truth-about-data-science-why-it-isnt-as-rosy-as-you-might-imagine-c2cf9864be0">The Truth About Data Science —Why It Isn’t As Rosy as You Might Imagine</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Caer — A GPU-accelerated Computer Vision Library]]></title>
            <link>https://medium.com/data-science/introducing-caer-a-gpu-accelerated-computer-vision-library-37d359439658?source=rss-135dac1d8e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/37d359439658</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Marcus]]></dc:creator>
            <pubDate>Thu, 03 Dec 2020 10:24:02 GMT</pubDate>
            <atom:updated>2020-12-06T06:22:28.645Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introducing Caer — A GPU-Accelerated Computer Vision Library</h3><h4>A Python library that changes your approach towards Machine Vision</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gTHqUE1jBWKg09F4" /><figcaption>Photo by <a href="https://unsplash.com/@lime517?utm_source=medium&amp;utm_medium=referral">Joseph Greve</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When I released <a href="https://github.com/jasmcaus/caer">Caer</a> back in August of this year, I have received hundreds of emails from researchers and computer vision enthusiasts around the world thanking me for releasing the library. Their good (and bad) feedback pushed and motivated me to take the library to another level.</p><p>Today, I’m excited to announce the first-ever <em>stable </em>release of Caer, a lightweight open-source Python library that simplifies the way you approach Computer Vision. It abstracts away unnecessary boilerplate code enabling maximum flexibility. By offering powerful image and video processing algorithms, Caer provides both casual and advanced users with an elegant interface for Machine vision operations.</p><p>It leverages the power of libraries like OpenCV and Pillow to speed up your Computer Vision workflow — making it ideal if you want to quickly test out something.</p><p>This design philosophy makes Caer ideal for students, researchers, hobbyists and even experts in the fields of Deep Learning and Computer Vision to quickly prototype deep learning models or research ideas.</p><p><a href="https://www.github.com/jasmcaus/caer">jasmcaus/caer</a></p><h3>What is Caer?</h3><blockquote>Caer is a GPU-accelerated Computer Vision library in Python that’s designed to help speed up your Computer Vision workflow.</blockquote><p>It’s ideal for rapid prototyping so you can focus more on the experimenting rather than the building. I use this package every single day when working on image and video processing workflows and it saves me tons of time!</p><h3>Installing Caer</h3><p>The latest release of <a href="https://github.com/jasmcaus/caer">Caer</a> can be installed via a simple pip install</p><pre>pip install --upgrade caer</pre><p>Read the complete <a href="https://github.com/jasmcaus/caer/blob/master/INSTALL.md">Installation Guide</a> for more platform-specific download instructions.</p><h3>Using Caer</h3><p>I recommend going through the <a href="https://github.com/jasmcaus/caer/blob/master/docs/README.md">documentation</a> for a look at all the methods in Caer.</p><h3>1. Standard Test Images</h3><p>Caer currently ships out of the box with 29 high-quality images from Unsplash. These are extremely handy if you want to test out a feature quickly. Simply call caer.data.&lt;image&gt;() to get a standard 640x427 image.</p><p>Read the <a href="https://github.com/jasmcaus/caer/blob/master/docs/README.md">documentation</a> for details on all the images you can reference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cFo65FMhoA0uJ9M3" /><figcaption>To get this image, simply call <strong>caer.data.beverages(). </strong>Image by Author</figcaption></figure><h3>2. Advanced Resizing</h3><p>Most libraries today like OpenCV and Pillow perform <em>hard-resizing</em>, meaning that you lose the original aspect ratio of your image. When training Deep Neural Networks, this is not such a big deal, but in other cases, it makes a big difference.</p><p>caer.resize() resizes your images to a certain target size (400x400, for instance) <strong><em>while still maintaining </em></strong>the original aspect ratio. Behind the scenes, it uses an advanced cropping mechanism that crops out the most useful part of the image.</p><p>We are currently working on a <em>Context-Aware</em> smart image resizer to retain the most useful information in your image without the need for cropping.</p><pre># A standard 640x427 image<br>&gt;&gt; img = caer.data.sunrise()</pre><pre># Resizing to 400x400 maintaing aspect ratio<br>&gt;&gt; resized = caer.resize(img, (400,400), keep_aspect_ratio=True)</pre><pre>&gt;&gt; plt.imshow(resized)<br>&gt;&gt; plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vfnh9VhesHLmUm54HlvG9Q.png" /><figcaption>Image by Author</figcaption></figure><h3>3. Translation and Rotation</h3><p>Translating an image in Caer is as easy as calling caer.translate() . Behind the scenes, it defines a translation matrix and translates the image.</p><p>Rotation follows the same principle — a rotation matrix defined is defined and the image is rotated).</p><pre># Shifts an image 50 pixels to the right and 100 pixels up<br>&gt;&gt; translated = caer.translate(img, 50, -100)</pre><pre># Rotates an image around the centre counter-clockwise by 45 degrees<br>&gt;&gt; rotated = caer.rotate(img, 45, rotPoint=None)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KisRMSvwKZpWs4rDjOaTZw.png" /><figcaption>Image by Author</figcaption></figure><h3>4. Batch Pre-processing</h3><p>Got several hundred images and want to quickly compute the mean pixel intensity?</p><p>caer.preprocessing.compute_mean_from_dir() iterates over all the images in a directory and returns a tuple of the average mean intensities which can be used to perform mean subtraction.</p><pre># Computes the mean per channel of the image<br>&gt;&gt; mean = caer.preprocessing.compute_mean_from_dir(path, channels=3, per_channel_subtraction=True)</pre><pre>&gt;&gt; mean<br>(56.935615485948475, 79.85257611241218, 100.95970799180328)</pre><pre># Subtracting the mean using these values<br>&gt;&gt; mp = MeanProcess(mean, channels=3)<br>&gt;&gt; sub = mp.mean_preprocess(img, channels=3)</pre><pre>&gt;&gt; plt.imshow(sub)<br>&gt;&gt; plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IxxMYUy7uU3wQ4WCqJ_ynw.png" /><figcaption>Image by Author</figcaption></figure><h3>What’s Next?</h3><p>Caer is by no means an attempt to reinvent the wheel. In fact, we utilize backend frameworks like OpenCV to ensure maximum flexibility and performance for your Computer Vision models.</p><p>We are actively working to improve Caer’s functionality (<em>contributions welcome!</em>). In the coming days, we will be releasing a <strong><em>context-aware </em>image resizer</strong> that we’ve been testing out for weeks. If you’d like to request a specific functionality, you can do so on our <a href="https://github.com/jasmcaus/caer/">Github page</a> or <a href="https://twitter.com/jasmcaus">tweet me</a>!</p><h3>Useful Links</h3><ol><li><a href="https://github.com/jasmcaus/caer/">Github Repo</a></li><li><a href="https://github.com/jasmcaus/caer/tree/master/docs">Documentation</a></li><li><a href="https://github.com/jasmcaus/caer/wiki/How-to-Contribute">Contribute to the codebase</a></li><li><a href="https://twitter.com/jasmcaus">Tweet about us!</a></li></ol><p>If you like Caer, give us a ⭐️ on the <a href="https://github.com/jasmcaus/caer">repo</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37d359439658" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/introducing-caer-a-gpu-accelerated-computer-vision-library-37d359439658">Introducing Caer — A GPU-accelerated Computer Vision Library</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[Python is Slowly Losing its Charm]]></title>
            <link>https://medium.com/data-science/python-is-slowly-losing-its-charm-9ca652726492?source=rss-135dac1d8e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ca652726492</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Marcus]]></dc:creator>
            <pubDate>Tue, 06 Oct 2020 09:56:55 GMT</pubDate>
            <atom:updated>2020-11-23T09:56:04.647Z</atom:updated>
            <content:encoded><![CDATA[<h4>Opinion</h4><h4>The Swiss Army Knife of Programming Languages has its problems and may be replaced by other languages better suited for the task</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5Q1joBvY2S01IeMz" /><figcaption>Photo by <a href="https://unsplash.com/@thenightstxlker?utm_source=medium&amp;utm_medium=referral">Tamara Gore</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Ever since Python was released in the early 1990s, it has generated a lot of hype. Sure, it took the programming community at least 2 decades to appreciate its existence, but since then, it has far surpassed C, C#, Java and even Javascript in popularity.</p><p>Although Python dominates the fields of Data Science and Machine Learning, and, to some extent, Scientific and Mathematical computing, it does have its share of disadvantages when compared to newer languages like Julia, Swift and Java.</p><h3>What made Python so popular?</h3><p>One of the main driving points behind Python’s meteoric growth was how easy it was to learn and how powerful it was to use, making it extremely appealing to beginners and even those who shied away from programming because of the hard, unfamiliar syntax of languages like C/C++.</p><p>The language, at its very core, emphasised extensively on <em>code readability. </em>With its concise and expressive syntax, it allowed developers to express ideas and concepts without writing tons of lines code (as would be the case in lower-level languages like C or Java). Its simplicity a given, Python seamlessly integrates with other programming languages (like offloading CPU-intensive tasks to C/C++), making it an added bonus to polyglot developers.</p><p>Yet another reason for Python’s versatility is its heavy usage by enterprises (FAANG included) as well as countless smaller ventures. Today, you’ll find a Python package for pretty much anything you can think of — for scientific computing, you’ve got <a href="https://pypi.org/project/numpy">Numpy</a>, <a href="https://pypi.org/project/scikit-learn/">Sklearn</a> for Machine Learning and <a href="https://github.com/jasmcaus/caer">Caer</a> (my Computer Vision package) for Computer Vision.</p><p><a href="https://github.com/jasmcaus/caer">jasmcaus/caer</a></p><h3>Python’s Got Weaknesses</h3><h3>It’s slow, terribly slow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Eo5QOIHC32ddKXWA" /><figcaption>Photo by <a href="https://unsplash.com/@nbabrams?utm_source=medium&amp;utm_medium=referral">Nick Abrams</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This is probably a no-brainer. Speed is generally considered to be one of the key focuses of a developer and will probably continue to be for an unforeseeable amount of time.</p><p>Among the major reasons why Python is “slow”, it really boils down to 2 — Python is <em>interpreted </em>as opposed to compiled, ultimately leading to slower execution times; and the fact that it is <em>dynamically typed</em> (data types of variables are automatically inferred by Python during execution).</p><p>In truth, this argument that “Python is slow”<em> </em>tends to factor a lot among beginners. Yes, it&#39;s true. But only <em>partially.</em></p><p>Take, for example, TensorFlow, a Machine Learning library available in Python. These libraries were actually written in C++ and made available in Python, sort of forming a Python “wrapper” around the C++ implementation. The same goes for Numpy and, to an extent, even Caer.</p><h3>It’s got a GIL(l)</h3><p>One of the major reasons for Python’s slowness is the presence of GIL (Global Interpreter Lock) which allows only one thread to execute at a time. While this boosts the performance of single threading, it places a limitation on parallelism where developers have to implement multiprocessing programs as opposed to multi-threaded ones, to improve speeds.</p><h3>Not the best for memory-intensive tasks</h3><p>When objects go out of scope, Python has automatic garbage collections. It aims to remove a lot of the complexities involved in memory management that C and C++ involve. Owing to the flexibility (or lack thereof) of specifying data types, the amount of memory Python consumes can quickly explode.</p><p>Moreover, some bugs that may go unnoticed by Python may pop up during runtimes, ultimately slowing down the development process by a considerable factor.</p><h3>Weak Presence in Mobile Computing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OIQlZrD0wmXGw_xo" /><figcaption>Photo by <a href="https://unsplash.com/@mr_fresh?utm_source=medium&amp;utm_medium=referral">Yura Fresh</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>With a large shift from desktops to smartphones, it&#39;s obvious that more robust languages are required to build software for mobiles. While Python has a sizable representation in desktop and server platforms, it tends to lose out on mobile development owing to the lack of strong mobile computing processing.</p><p>Over the recent years, there has been a lot of advancements in this area, but these newly added libraries aren’t even close to their strong competitors like Kotlin, Swift and Java.</p><h3>The Rise of Other Languages</h3><p>Recently, newer languages like Julia, Rust and Swift have popped up on the radar, borrowing a lot of the good design concepts from Python, C/C++ and Java — <a href="https://www.rust-lang.org/"><strong>Rust</strong></a><strong> </strong>pretty much guarantees memory safety and concurrency at runtimes, and offers first-class interoperability with WebAssembly; <a href="https://developer.apple.com/swift/"><strong>Swift</strong></a><strong> </strong>is almost as fast as C due to its support for the LLVM Compiler Toolchain, and <a href="https://julialang.org/"><strong>Julia</strong></a><strong> </strong>offers asynchronous I/O for I/O intensive tasks and is blazingly fast.</p><h3>Conclusion</h3><p>Python was never built to be the best programming language. It was never built to take on C/C++ and Java. It was built to be a <em>general-purpose</em> programming language that emphasised on human-readable, English-centered syntax that allowed for the quick development of programs and applications.</p><p>Python, like every other language at the end of the day, is a tool. Sometimes, it is the best tool. Sometimes it&#39;s not. Most often, it’s “just okay”.</p><p>So, is Python as a programming language, dying?</p><p>I hardly think so.</p><p>Is it losing its charm?</p><p>Ah, maybe just a bit. Just a bit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ca652726492" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/python-is-slowly-losing-its-charm-9ca652726492">Python is Slowly Losing its Charm</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[Building an Image Classifier in Python]]></title>
            <link>https://svenssonmarcus.medium.com/building-an-image-classifier-in-python-3b2f8eb76536?source=rss-135dac1d8e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b2f8eb76536</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Marcus]]></dc:creator>
            <pubDate>Tue, 15 Sep 2020 17:48:59 GMT</pubDate>
            <atom:updated>2020-09-15T17:48:59.904Z</atom:updated>
            <content:encoded><![CDATA[<h4>A step-by-step implementation of a Dogs vs Cats classifier in Keras</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qMJmjgS5nR58X360" /><figcaption>Photo by <a href="https://unsplash.com/@andrewlancaster?utm_source=medium&amp;utm_medium=referral">Andrew Lancaster</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Almost everything around you today is empowered by Machine Learning and Deep Learning. From the way Google Photos recognizes your face from a bunch of people in an image, to autonomous vehicles, these algorithms have changed the landscape of machine-centred thinking.</p><p>Among the most recent (and exciting) contributions is in the field of Computer Vision where insights are derived from media files (images and video). The most noted part is Image Classification — the ability for a machine to distinguish, or classify, between objects when given an image.</p><p>In this article, we’ll be building an image classifier to distinguish cats from dogs (and vice-versa) with sizable accuracy.</p><h3>Picking up the dataset</h3><p>In this article, we’ll be using a filtered version of the <a href="https://www.kaggle.com/c/dogs-vs-cats/data">Dogs vs Cats</a> dataset from Kaggle. You can download it from <a href="https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip">here</a>.</p><p>We’ll be using Tensorflow’s high-level API, <em>Keras</em>, for this lesson. So, go ahead and import the necessary packages.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5b227cc0684778b8d7b4b2d0d8814a8/href">https://medium.com/media/e5b227cc0684778b8d7b4b2d0d8814a8/href</a></iframe><p>On lines 13–14, we are downloading the filtered dataset and unzipping it to a folder `cats_and_dogs_filtered``</p><p>The dataset has the following structure</p><pre><strong>cats_and_dogs_filtered</strong><br>|__ <strong>train</strong><br>    |______ <strong>cats</strong>: [cat.0.jpg, cat.1.jpg, cat.2.jpg ....]<br>    |______ <strong>dogs</strong>: [dog.0.jpg, dog.1.jpg, dog.2.jpg ...]<br>|__ <strong>validation</strong><br>    |______ <strong>cats</strong>: [cat.2000.jpg, cat.2001.jpg, cat.2002.jpg ....]<br>    |______ <strong>dogs</strong>: [dog.2000.jpg, dog.2001.jpg, dog.2002.jpg ...]</pre><p>Next, we’re going to assign variables for the training and validation set:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/94dc778781864d7530d36fb75173c4e1/href">https://medium.com/media/94dc778781864d7530d36fb75173c4e1/href</a></iframe><p>To visualize the number of classes within the training and validation set, go ahead and use the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d324107a22d5272b68d75845331ec86/href">https://medium.com/media/8d324107a22d5272b68d75845331ec86/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*bjEXZ23IUDyzATFw.png" /></figure><h3>Preprocessing the Data</h3><p>The images we use will have to be appropriately preprocessed before feeding them into our model.</p><p>We’re going to instantiate the ImageDataGenerator class to generate a batch of images that will be fed into the model. We are rescaling our pixel value to the range [0,1] to help the network converge faster.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f950d3aa4e7a436f1b0648f3f8e11cc/href">https://medium.com/media/3f950d3aa4e7a436f1b0648f3f8e11cc/href</a></iframe><p>We will now extract a batch of images from the train_data_gen generator to visualize our training set and then plot 5 of them using matplotlib.pyplot</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6dc5873af82c03808f7212ecea7da5ef/href">https://medium.com/media/6dc5873af82c03808f7212ecea7da5ef/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UZOV99yoPq8l5YRe.png" /><figcaption>5 Images from the training set plotted in Matplotlib</figcaption></figure><h3>Defining the Model Architecture</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e755235fa00bba967d7faee55908a698/href">https://medium.com/media/e755235fa00bba967d7faee55908a698/href</a></iframe><h3>Compiling the Model</h3><p>We’ll use the <em>ADAM</em> optimizer and the <em>Binary Cross Entropy</em> as the loss</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3aa91560d68312f73da96022ee3a7b8/href">https://medium.com/media/a3aa91560d68312f73da96022ee3a7b8/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/0*90NanISJFZvJ1wgK.png" /><figcaption>Our Model’s Architecture so far</figcaption></figure><h3>Training the model</h3><p>Here’s where the magic happens! We’re going to actually train the model by feeding our input images to it. For this, we’ll use model.fit</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dddab83b97572dc965fda3b1c0a2ec21/href">https://medium.com/media/dddab83b97572dc965fda3b1c0a2ec21/href</a></iframe><p>We will allow the model to train over 15 epochs. This is relatively small, but remember, we have a small dataset (~3000 images).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NGwmg6yl22AeRIRj.png" /><figcaption>Training progress of your model</figcaption></figure><h3>Visualizing the Training Results</h3><p>We’re now going to plot a graph that will allow us to see the accuracy and loss as our model trained.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a840875b847356017bb8b72c9e430eba/href">https://medium.com/media/a840875b847356017bb8b72c9e430eba/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/0*iQBVsHYAkFaSYz3s.png" /><figcaption>Training and Validation Accuracy (left); Training and Validation Loss (right)</figcaption></figure><p>It’s quite clear that we’ve achieved a test accuracy of ~85% and a validation accuracy of ~70%. Our model is <em>clearly </em>overfitting!</p><h3>Preventing Overfitting</h3><p>Overfitting usually happens when your model has learnt to recognize patterns specific to the training set only. As a result, when tested on the validation data, we didn’t get very good results.</p><p>To mitigate this issue, we will employ <em>Data Augmentation</em> and <em>Dropout.</em></p><p>Data augmentation is synthesizing more data from already existing data. This can include (in our case) <strong>flipping, rotation and zoom.</strong></p><p>We can achieve this by use of the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/15d66324746207f91c58b9f73ad408ce/href">https://medium.com/media/15d66324746207f91c58b9f73ad408ce/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vNbCI3TSh06ko4yv.png" /><figcaption>Visualizing Data Augmentation on a random image from our training set</figcaption></figure><p>Similarly, we can create a validation data generator. Remember, we <em>never </em>apply augmentation on the validation set.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1fc5a195d8b4fb2e688ba18906834bf2/href">https://medium.com/media/1fc5a195d8b4fb2e688ba18906834bf2/href</a></iframe><p>In addition to Data Augmentation, we’ll be using Dropout, a regularization technique, that commonly helps to <strong>spread out the weights of the network</strong>.</p><p>We’ve added a 20% dropout twice in the model architecture:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e781c1294dc4c23ac64571c1fd5390f2/href">https://medium.com/media/e781c1294dc4c23ac64571c1fd5390f2/href</a></iframe><p>When you train the model, you’ll notice that there was significantly less overfitting that before.</p><p>Plotting the graphs, we get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/0*QxxRqpze7EqIdifF.png" /><figcaption>We’ve obtained an accuracy of ~65%</figcaption></figure><p>That’s it! You’ve built an image classifier that distinguishes cats from dogs with an overall accuracy of 65%. It’s not the best but given the limited size of the dataset and model architecture we’ve used, it’s pretty good.</p><p>Thanks for reading! Let me know what you think in the comments below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b2f8eb76536" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Resources I wish I knew when I started out with Data Science]]></title>
            <link>https://medium.com/data-science/resources-i-wish-i-knew-when-i-started-out-with-data-science-9a8889654c36?source=rss-135dac1d8e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a8889654c36</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Marcus]]></dc:creator>
            <pubDate>Thu, 30 Apr 2020 09:26:17 GMT</pubDate>
            <atom:updated>2020-08-16T11:20:21.351Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zxYPT0MjIG36k66L" /><figcaption>Photo by <a href="https://unsplash.com/@timmossholder?utm_source=medium&amp;utm_medium=referral">Tim Mossholder</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Resources I Wish I Knew When I Started Out With Data Science</h3><h4>A Powerful Learning Guide for Serious Data Scientists</h4><p>Data Science can be overwhelming. There are plenty who’ll tell you that in order to become a data scientist, you’ll have to learn heavy mathematics and computer science — Statistics, Calculus, Linear Algebra, Distributed Computing, Clustering and more.</p><p>It’s easy to feel like an antelope caught in the headlights — with no clue where to get started.</p><p><strong>I understand what you’re feeling — I’ve been in your shoes not too long ago.</strong></p><p>This post is dedicated to the resources that I wish I had at my disposal as a beginner to Data Science. I hope that sharing my experience in this post will put you on the right track to pursuing a data science career and make your learning journey that much more enjoyable.</p><blockquote>If you want to get started with Deep Learning, here’s a quick 1.5-hour free crash course:</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FOrxfB1L7P3Q%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOrxfB1L7P3Q&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FOrxfB1L7P3Q%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/953e032e36ae2150f86cb7a987b21ff3/href">https://medium.com/media/953e032e36ae2150f86cb7a987b21ff3/href</a></iframe><h3>Is Data Science right for you?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uLK1PVcDCTv1pZ-t" /><figcaption>Photo by <a href="https://unsplash.com/@isaacmsmith?utm_source=medium&amp;utm_medium=referral">Isaac Smith</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Before you move forward, you need to analyze whether or not Data Science is right for you. Data Science is sexy — salaries are high and there’s <em>significant </em>prestige that comes with it.</p><p>Ask yourself: Is this the reason why you’re transitioning into Data Science?</p><p>If yes, <strong>turn back right now! Data Science is NOT for you.</strong></p><p>The thing with Data Science is that even if you’re deeply passionate about it, you can’t force yourself to love the process. If you dislike the feelings that come with Data Science, it will be difficult to maintain your motivation in the long run.</p><h4><strong>My Advice to you: Do your research</strong></h4><p>Before you make your mind up, research, research, research!</p><p>Watch videos and read articles on the day-to-day life of Data Scientist.</p><p><a href="https://www.youtube.com/watch?v=Ck0ozfJV9-g">A Day in the Life of a Data Scientist</a> — Joma Tech</p><p><a href="https://www.youtube.com/watch?v=8LucP1wiX1g">Data Science: Reality vs Expectations</a> — Matt Tran</p><p>A little research, in the beginning, will go a long way in helping you make the right choice.</p><p>PS: Here’s a handy Data Science <a href="https://online.maryville.edu/online-bachelors-degrees/data-science/careers/">career guide</a> from Maryville University that you can use to gauge your interests!</p><h3>A Powerful Learning Path</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CzQBTLl5TFzGbf0B" /><figcaption>Photo by <a href="https://unsplash.com/@radu_marcusu?utm_source=medium&amp;utm_medium=referral">Radu Marcusu</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’re reading this, you’ve probably made the decision to continue with Data Science. Congratulations!</p><blockquote>Learning Data Science is mammoth. The only way to eat an elephant is one bite at a time.</blockquote><p>It isn’t too much different from any other challenging task. There might be more bites you need to take depending on where you start but there’s no magic to it; no shortcut. It’s just one bite at a time.</p><p>The learning path below consists of 2 main parts — the Mathematics, and the Technical Skills. It’s a good idea to start with the Maths so you can gauge whether Data Science is for you. For some, Mathematics can be daunting since Data Science primarily uses a lot of Mathematical concepts. Identifying that, in the beginning, can save you from regret later on.</p><p>To summarize,</p><blockquote><strong>Start with the Mathematics</strong></blockquote><h3>Part 1: Mathematics</h3><p>3 topics that are essentially important in Data Science are Linear Algebra, Calculus and Statistics. For the majority of tasks though, you can get away with just Statistics. Even then, I’ve linked useful resources under all 3 concepts, if you’d like to read more about each.</p><h4>Linear Algebra</h4><p>Linear Algebra is (almost) everywhere in Data Science. In a majority of calculations, your computer’s going to use a lot of Linear Algebra. In neural networks, the representation and processing of the network use Linear Algebra. It’s quite hard to think about any model that isn’t implemented using this branch of Mathematics.</p><p>But just as important as this looks, for the majority of cases, you <em>won’t </em>be handwriting code to apply matrix transformations in your dataset. Really what you need is a good intuition about its <em>core principles.</em></p><p><a href="https://www.khanacademy.org/math/linear-algebra">Khan Academy</a></p><p>Use the following resource if you’d like to learn about the theory about Linear Algebra and <em>apply </em>it in code:</p><p><a href="https://www.udemy.com/course/linear-algebra-theory-and-implementation/">Master Linear Algebra: From Theory to Implementation</a></p><h4>Calculus</h4><p>Like Linear Algebra, Calculus too plays a large role in Data Science, specifically with algorithms used in Machine Learning. Also, like the former, you <em>don’t </em>have to be a Calculus guru to master Data Science. What you need is understanding its core principles and how those principles might affect your models.</p><p><a href="https://www.coursera.org/learn/first-steps-in-linear-algebra-for-machine-learning">First Steps in Linear Algebra for Machine Learning | Coursera</a></p><h4>Statistics &amp; Probability</h4><p>Statistics &amp; Probability is a topic that <strong>you’re really going to have to learn.</strong> This will take a significant chunk of your time, but the good news is that the concepts aren’t that difficult, so there’s no reason why you shouldn’t master this topic.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXwS2WTP1PI0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXwS2WTP1PI0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FXwS2WTP1PI0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb8b42555cbf58da86a29f497f154462/href">https://medium.com/media/bb8b42555cbf58da86a29f497f154462/href</a></iframe><p><a href="https://www.khanacademy.org/math/statistics-probability">Khan Academy</a></p><h4>Other Topics in Math</h4><p>These are topics that you probably won’t use on a daily basis as a beginner Data Scientist, but if you want to up your game, they are particularly useful.</p><ol><li><strong>Graph Theory</strong></li></ol><blockquote>“Graph Theory is the study of <strong>relationships</strong>. Given a set of nodes — which can be used to abstract anything from cities to computer data — Graph Theory studies the relationship between them in a very deep manner and provides answers to many arrangement, networking, optimisation, matching and operational problems. And the strength of it is the power to be used to abstract such a vast array of real problems.” — <a href="https://apps.dtic.mil/dtic/tr/fulltext/u2/705364.pdf">Frank Hannary</a></blockquote><p>If you’re looking to build models to optimize routes for a logistics company or building a fraud detection system, a graph-based approach will sometimes outperform other solutions.</p><p><a href="https://www.coursera.org/learn/graphs">Introduction to Graph Theory</a></p><p><strong>2. Discrete Mathematics</strong></p><p>Discrete mathematics is the branch of mathematics which deals with objects that can assume only distinct, separated values. Whereas discrete objects can often be characterized by integers, continuous objects require real numbers.</p><p>As soon as you start to use mathematics with machines, you’re in the world of discrete mathematics where each number only has so many “bits” available to represent it.</p><ul><li><a href="https://cse.buffalo.edu/~rapaport/191/S09/whatisdiscmath.html">What Is Discrete Math?</a></li><li><a href="https://www.coursera.org/specializations/discrete-mathematics">Introduction to Discrete Mathematics for Computer Science</a></li></ul><p>If you’re terrified of math and disregard the sight of mathematical equations, you’re not going to have much fun as a data scientist. If, however, you’re willing to invest time to improve your familiarity with probability and statistics and to learn the principles underlying calculus and linear algebra, math should not get in the way of you becoming a professional data scientist.</p><p>PS: Math really is fun. As you go deeper into math, you too will share Data Scientists’ unbridled passion for Mathematics.</p><h3>Part 2: Technical Skills</h3><p>Now to the next/slightly more interesting part. <a href="https://www.socialmediatoday.com/news/how-much-data-is-generated-every-minute-infographic-1/525692/">2.5 exabytes of data are generated <em>every day</em></a><em> </em>(1 exabyte = 10¹⁸ bytes) and it would be absurd not to use computers to analyze small portions of that data (referred to as ‘Big Data’).</p><p><strong>“How much programming is required in data science, particularly statistical analysis and machine learning?”</strong></p><p>A lot. In practice, most every data science job will require you to code, for the reasons specified above, and also because most companies require some data cleaning, implementation and productization, and adaptation of algorithms to their own specific purposes. If you can’t implement your own solutions into something product-ready, then you are a much less useful employee. (<a href="https://www.quora.com/How-much-programming-is-required-in-data-science-particularly-statistical-analysis-and-machine-learning-Should-a-data-scientist-care-more-about-analysis-interpretation-mathematics-rather-than-programming-What%E2%80%99s-wrong-in-using-a-GUI-based-tool">Source</a>)</p><h4>Python</h4><p>Python is by far the world’s most widely used programming language in Data Science. Almost four out of five developers say that Python is their main language in JetBrains’ 2016 survey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*2RQA8IEoDI0gljlS.png" /><figcaption><a href="https://opensource.com/article/18/5/numbers-python-community-trends">Source</a></figcaption></figure><p>I would recommend that you focus on Python and spend a little time on <a href="https://www.r-project.org/">R</a> as well.</p><ul><li><a href="https://docs.python-guide.org/intro/learning/">Learning Python - The Hitchhiker&#39;s Guide to Python</a></li><li><a href="https://www.coursera.org/learn/python">Programming for Everybody (Getting Started with Python)</a></li><li><a href="https://www.codecademy.com/learn/learn-python-3">Learn Python 3 | Codecademy</a></li></ul><h4>R</h4><p>Python will suffice for a majority of your Data Science projects, but to really be called a well-rounded Data Scientist, you need to have R in your toolkit. You don’t have to be a guru in R <strong><em>and </em></strong>Python. Choose one and learn the fundamentals about the other.</p><p><a href="https://www.datamentor.io/r-programming/">R Tutorial - Learn R Programming</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F_V8eKsto3Ug%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_V8eKsto3Ug&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F_V8eKsto3Ug%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b1b302f20add1df3a5625c7e1a3abf2/href">https://medium.com/media/1b1b302f20add1df3a5625c7e1a3abf2/href</a></iframe><h4>Data Analysis with Python (Numpy, Pandas &amp; Matplotlib)</h4><p>If you’re learning Python specifically for Data Science, you’ll need to know how to analyze data, specifically how to load, manipulate, and visualize data.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fr-uOLxNrNk8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dr-uOLxNrNk8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fr-uOLxNrNk8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c1b2f1c318c9675bb0955a6b74ae826/href">https://medium.com/media/9c1b2f1c318c9675bb0955a6b74ae826/href</a></iframe><p><a href="https://cs231n.github.io/python-numpy-tutorial/">Python Numpy Tutorial (with Jupyter and Colab)</a></p><h4>Machine Learning with Python</h4><p>Machine learning algorithms are at the core of Data Science. Invest some time to grasp their theory and applications.</p><ul><li><a href="https://github.com/amueller/introduction_to_ml_with_python">GitHub - amueller/introduction_to_ml_with_python: Notebooks and code for the book &quot;Introduction to Machine Learning with Python&quot;</a></li><li><a href="https://developers.google.com/machine-learning/crash-course">Machine Learning | Google for Developers</a></li></ul><h4>SQL</h4><p>SQL, or Structured Query Language, is extremely vital for a data scientist. One of the fundamental processes in data modelling is extracting the data in the first place. This will more often than not involve running SQL queries against a database.</p><ul><li><a href="https://medium.com/swlh/want-to-learn-sql-heres-everything-you-need-baffadc89291">Want To Learn SQL? Here’s Everything You Need</a></li><li><a href="https://websitesetup.org/sql-cheat-sheet/">SQL Cheat Sheet (2020) | websitesetup.org</a></li></ul><h4>Production Systems</h4><p>If you’re in a job you’ll be utilizing the company’s computational resources to extract, transform and analyze data. It’s not enough to use a single machine to perform these tasks.</p><p>It’ll be worth the time learning about these tools specifically because they’re used extensively in the industry today.</p><p>SQL is one of the tools used today. Cloud-computing platforms like <a href="http://aws.amazon.com/">Amazon Web Services (AWS)</a>, <a href="http://cloud.google.com/">Google Cloud</a> and <a href="http://azure.microsoft.com/">Microsoft Azure</a> are used extensively by a large number of businesses.</p><p>Another useful skill is <a href="https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control"><strong>Version Control</strong></a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FU3VSJhaC4kc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DU3VSJhaC4kc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FU3VSJhaC4kc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b42bec81782d11dd05e46d7f30c88d8/href">https://medium.com/media/2b42bec81782d11dd05e46d7f30c88d8/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUSjZcfj8yxE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUSjZcfj8yxE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUSjZcfj8yxE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/89d32d4967cfc538a686d563f78e5e7a/href">https://medium.com/media/89d32d4967cfc538a686d563f78e5e7a/href</a></iframe><h3>Gaining Practical Experience</h3><p>Following the resources I mentioned above will get only get you <em>half </em>the way. To apply the knowledge you’ve just gained, you need to, well, apply that knowledge by <strong>practising</strong>!</p><p>To truly master these concepts, you will need to use the skills in some projects that ideally closely resemble a real-world application. You will encounter problems — there’s no escaping this — to work through such as erroneous data and develop a really deep level of expertise in Data Science.</p><p>Here are a couple of good places where you can get this practical experience from (for free):</p><h4>Kaggle</h4><p>Machine Learning competitions serve many purposes. They serve as a channel for problem-solving and brainstorming. <a href="http://kaggle.com/">Kaggle </a>is one of the most well-known platforms for Data Science. It’s a great way to apply your newly-gained skills.</p><p>Here is a list of 10 Data Science Competitions for you to hone your skills:</p><p><a href="https://towardsdatascience.com/10-data-science-competitions-for-you-to-hone-your-skills-for-2020-32d87ee19cc9">11 Data Science Competitions for you to hone your skills for 2020</a></p><h4>UCI Machine Learning Repository</h4><p>The <a href="https://archive.ics.uci.edu/ml/index.php">UCI machine learning repository</a> is a large source of publically available data sets which you can use to put together your own data projects.</p><p>It is worth noting that storing your projects publically on Github is a good idea as this can create a portfolio showcasing your skills to use for future job applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JlBg6NbeBm2XRDIz6nNx5w.png" /><figcaption>UCI ML Repository</figcaption></figure><h4>Contributing to Open Source</h4><p>A good option to consider is contributing to open source projects. There are <a href="https://data-flair.training/blogs/python-open-source-projects/">many Python projects</a> that rely on the developer community to maintain them. <a href="http://github.com/">Github </a>is a good place to start.</p><p><a href="https://numfocus.org/">Numfocus</a> is a good example of a project like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2L1ae6476Xd4IkZ5waIH7Q.png" /><figcaption><a href="http://github.com/">Github</a></figcaption></figure><h3>Closing Notes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7zOL3KhwQrhlrgBb" /><figcaption>Photo by <a href="https://unsplash.com/@harleydavidson?utm_source=medium&amp;utm_medium=referral">Harley-Davidson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this article, I described a learning path that will guide you in your journey in Data Science.</p><p>The golden rule,</p><blockquote><em>Be better at programming than an average mathematician.</em></blockquote><blockquote><em>Be better at math than an average programmer</em></blockquote><p>Data science is a mixture of fields. You shouldn&#39;t strive to be the best at just one thing, but instead good enough at everything.</p><blockquote><strong>Keep the big picture in mind.</strong></blockquote><p>I do want to point out, that these resources <strong>won’t </strong>work for you if you’re not willing to put in the time. Data Science is a marathon, not a sprint. There’s a long journey ahead. If you follow this path, your entry into Data Science will be <em>smoother </em>rather than easier and you’ll be on your way to pursuing your career in Data Science.</p><p>Happy Learning!</p><p>Until next time…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a8889654c36" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/resources-i-wish-i-knew-when-i-started-out-with-data-science-9a8889654c36">Resources I wish I knew when I started out with 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>
        <item>
            <title><![CDATA[What is a GPU and do you need one in Deep Learning?]]></title>
            <link>https://medium.com/data-science/what-is-a-gpu-and-do-you-need-one-in-deep-learning-718b9597aa0d?source=rss-135dac1d8e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/718b9597aa0d</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Marcus]]></dc:creator>
            <pubDate>Sat, 25 Apr 2020 13:04:39 GMT</pubDate>
            <atom:updated>2020-12-26T16:35:35.591Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ugfDFEAZuHuVzMTL" /><figcaption>Photo by <a href="https://unsplash.com/@mukilmenon?utm_source=medium&amp;utm_medium=referral">Mukil Menon</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>In Deep Learning, everyone seems to recommend using a GPU. What is it, can you do without one, and who is it exactly for?</h4><p>Any data scientist or machine learning enthusiast who has been trying to elicit performance of training models at scale will at some point hit a cap and start to experience various degrees of processing lag. Tasks that take minutes with smaller training sets may now take more hours — in some cases weeks — when datasets get larger.</p><p>But what are GPUs? How do they stack up against CPUs? Do I need one for my deep learning projects?</p><p>If you’ve ever asked yourself these questions, read on…</p><blockquote>I recently open-sourced my Computer Vision library that utilizes the GPU for image and video processing on the fly. I’ll leave the link to the Github repo in case you’re interested :)</blockquote><p><a href="https://github.com/jasmcaus/caer">jasmcaus/caer</a></p><p>Any data scientist or machine learning enthusiast would have heard, at least once in their life, that Deep Learning requires <em>a lot</em> of hardware. Some train simple deep learning models for days on their laptops (typically without GPUs) which leads to an impression that Deep Learning requires big systems to run execute.</p><p>This has created a myth surrounding deep learning which creates a roadblock for beginners.</p><p>Every book that I’ve referred to in the past few years has the author always mentioning the following:</p><blockquote>Deep learning requires a lot of computational power to run on.</blockquote><p>But I don’t have datacentres at my command and when I built my <a href="https://medium.com/@jasmcaus/data-science-with-python-image-classification-with-d87e1234e20b">first deep learning model</a> on a sizable laptop, I knew that the consensus was either wrong or portrayed with <em>some </em>truth.</p><blockquote>You don’t have to take over Google to be a deep learning expert.</blockquote><h3>Why do we need more hardware for deep learning?</h3><p>For any neural network, the <strong>training phase </strong>of the deep learning model is the most resource-intensive task</p><p>While training, a neural network takes in inputs, which are then processed in hidden layers using <em>weights </em>that are adjusted during training and the model then spits out a prediction. Weights are adjusted to find patterns in order to make better predictions.</p><p>Both these operations are essentially <em>matrix multiplications</em>. A simple matrix multiplication can be represented by the image below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FlJ_ZPMSlpCdeuAYzC0gPw.png" /><figcaption>Source: jeremyjordan.me</figcaption></figure><p>In a neural network, we can the first array is the <em>input </em>to the neural network, while the second array forms its <em>weight.</em></p><p>Easy, right?</p><p>Yes, if your neural network has around 10, 100 or even 100,000 parameters. A computer would still be able to handle this in a matter of minutes, or even hours at the most.</p><p>But what if your neural network has <a href="https://www.popsci.com/science/article/2013-06/stanfords-artificial-neural-network-biggest-ever/">more than 10 billion parameters</a>? It would take <em>years </em>to train this kind of systems employing the traditional approach. Your computer would probably give up before you’re even one-tenth of the way.</p><blockquote>“A neural network that takes search input and predicts from 100 million outputs, or products, will typically end up with about 2,000 parameters per product. So you multiply those, and the final layer of the neural network is now 200 billion parameters. And I have not done anything sophisticated. I’m talking about a very, very dead simple neural network model.” — a Ph.D. student at Rice University</blockquote><h3>Making deep learning models train faster</h3><p>Deep Learning models can be trained faster by simply running all operations at the <em>same time</em> instead of one after the other.</p><p>You can achieve this by using a <strong>GPU </strong>to train your model.</p><blockquote>A GPU (Graphics Processing Unit) is a specialized processor with dedicated memory that conventionally perform floating point operations required for rendering graphics</blockquote><p>In other words, it is a single-chip processor used for extensive Graphical and Mathematical computations which frees up CPU cycles for other jobs.</p><blockquote>The main difference between GPUs and CPUs is that GPUs devote proportionally more transistors to arithmetic logic units and fewer to caches and flow control as compared to CPUs.</blockquote><p>While CPUs are mostly applicable for problems that require <em>parsing </em>through or <em>interpreting </em>complex logic in code, GPUs are designed to the dedicated graphical rendering workhorses of computer games, and which were later enhanced to accelerate other geometric calculations (for instance, transforming polygons or rotating verticals into different coordinate systems like 3D).</p><p>A GPU is smaller than a CPU but tends to have more <em>logical </em>cores (arithmetic logic units or ALUs, control units and memory cache) than the latter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1TJ6wZR_ojRGSE3GKw4UBg.png" /><figcaption>Source: fast.ai</figcaption></figure><p>In the chart above, you can see that GPUs (red/green) can theoretically do 10–15x the operations of CPUs (in blue). This speedup very much applies in practice too.</p><blockquote>If you consider a CPU as a Maserati, a GPU can be considered as a big truck.</blockquote><blockquote>The CPU (Maserati) can fetch small amounts of packages (3 -4 passengers) in the RAM quickly whereas a GPU(the truck) is slower but can fetch large amounts of memory (~20 passengers) in one turn.</blockquote><p>This video outlines the concept further:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-P28LKWTzrI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-P28LKWTzrI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-P28LKWTzrI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8c58ef177d27eb81996524f560952f6/href">https://medium.com/media/c8c58ef177d27eb81996524f560952f6/href</a></iframe><h3>Why choose GPUs for Deep Learning</h3><p>GPUs are optimized for training artificial intelligence and deep learning models as they can <em>process multiple computations</em> simultaneously.</p><p>They have a large number of cores, which allows for better computation of multiple parallel processes. Additionally, computations in deep learning need to handle huge amounts of data — this makes a GPU’s memory bandwidth most suitable.</p><p>There are a few <strong>deciding parameters </strong>to determine whether to use a CPU or a GPU to train a deep learning model:</p><h4>Memory Bandwidth:</h4><p>Bandwidth is one of the main reasons why GPUs are faster for computing than CPUs. With large datasets, the CPU takes up a lot of memory while training the model.</p><p>Computing huge and complex jobs take up a lot of clock cycles in the CPU — CPUs take up jobs <em>sequentially </em>and has a fewer number of cores than its counterpart, GPU.</p><p>A standalone GPU, on the other hand, comes with dedicated VRAM (Video RAM) memory. Thus, the CPU’s memory can be used for other tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ttCX7SD4cn1FqQoM.png" /><figcaption>Comparison of bandwidth for CPUs and GPUs over time</figcaption></figure><h4>Dataset Size</h4><p>Training a model in deep learning requires a large dataset, hence the large computational operations in terms of memory. To compute the data efficiently, a GPU is an optimum choice. The larger the computations, the more the advantage of a GPU over a CPU.</p><h4>Optimization</h4><p>Optimizing tasks are far easier in CPU. CPU cores, though fewer, are more powerful than thousands of GPU cores.</p><p>Each CPU core can perform on different instructions (MIMD architecture) whereas, GPU cores, who are usually organized within the blocks of 32 cores, execute the same instruction at a given time in parallel (SIMD architecture).</p><p>The parallelization in dense neural networks is highly difficult given the effort it requires. Hence, complex optimization techniques are difficult to implement in a GPU than in a CPU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ggebkv6aIvXON-cI" /><figcaption>Photo by <a href="https://unsplash.com/@agkdesign?utm_source=medium&amp;utm_medium=referral">Alex Knight</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Should I use a GPU?</h3><p>As with any data science project, it depends. There are tradeoffs to consider, between speed, reliability, and cost:</p><ol><li>If your neural network is relatively <strong>small-scale</strong>, you can make do without a GPU</li><li>If your neural network involves <strong>tons of calculations</strong> involving many hundreds of thousands of parameters, you might want to consider investing in a GPU</li></ol><blockquote>As a general rule, GPUs are a safer bet for fast machine learning because, at its heart, data science model training consists of simple matrix math calculations, the speed of which may be greatly enhanced if the computations are carried out in parallel.</blockquote><p>See this Reddit post on the <a href="https://www.reddit.com/r/MachineLearning/comments/b95182/d_which_gpus_to_get_for_deep_learning_my/">best GPUs to invest in for Deep Learning</a></p><h4>Cloud GPU Instances</h4><p>You should also give Cloud GPUs a thought. If you don’t want to buy a bunch of expensive GPUs, you can leverage GPUs on-demand with a cloud-hosting company. They’ll save you from configuring the hardware and best of all, they’re not that expensive — costs can be as little as US$0.25 per hour while you’re using it.</p><blockquote><strong>Once you’re done, remember to shut down your cloud instance.</strong></blockquote><p>You will be renting a foreign computer/server, not running something on your own. It’s not enough to close your browser or shut down your PC, those will merely sever the connection between your device and this distant server, not shut down the thing for which you’re paying. Otherwise, you’ll be charged for all the time it runs and gets surprised with a nasty bill!</p><p>CPUs are best at handling single, more complex calculations sequentially, while GPUs are better at handling multiple but simpler calculations in parallel.</p><p>GPU compute instances will typically cost 2–3x that of CPU compute instances, so unless you’re seeing 2–3x performance gains in your GPU-based training models, I would suggest going with CPUs.</p><p>As always, thanks so much for reading! Please tell me what you think or would like me to write about next in the comments. I’m open to criticism as well!</p><p>See you in the next post! 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=718b9597aa0d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/what-is-a-gpu-and-do-you-need-one-in-deep-learning-718b9597aa0d">What is a GPU and do you need one in Deep Learning?</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[Data Science with Python: Getting Started]]></title>
            <link>https://medium.com/data-science/data-science-with-python-getting-started-4d48e28ca696?source=rss-135dac1d8e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d48e28ca696</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Marcus]]></dc:creator>
            <pubDate>Thu, 23 Apr 2020 04:14:41 GMT</pubDate>
            <atom:updated>2020-05-04T11:56:37.359Z</atom:updated>
            <content:encoded><![CDATA[<h4>The bare essentials to get up and running + Helpful Resources</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GjpKgdXBFjuf_n9A" /><figcaption>Photo by <a href="https://unsplash.com/@m_b_m?utm_source=medium&amp;utm_medium=referral">M. B. M.</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Data Science has become a revolutionary technology that everyone seems to talk about. Hailed as the ‘sexiest job of the 21st century’, Data Science is a buzzword with very few people knowing about the technology in its true sense. While many people wish to become Data Scientists, it is essential to see the real picture.</p><p>“Data science is an interdisciplinary field that uses scientific methods, processes, algorithms and systems to extract knowledge and insights from many structural and unstructured data ” — Wikipedia</p><p>To put it simply, Data Science is a field of study and practice that’s focused on obtaining insights from data.</p><p>Data Scientists use math, statistics, and machine learning techniques to mine large data sets for patterns that can be used to analyze the past or even predict the future.</p><p>If you’re new to all this deep learning stuff, don’t worry — I’ll take you through it all step by step. If you’re an old hand, then you might want to skip ahead a few posts. I do however assume that you’ve been coding for at least a year, and also that (if you haven’t used Python before) you’ll be putting in the extra time to learn whatever Python you need as you go.</p><p>If you have a computer, an internet connection, and the will to put in the work, that’s about all you require. You don’t need much data, you don’t need university-level math, and you don’t need a giant data centre.</p><p>You’ll be surprised how easy it is to get started!</p><h3>Do you need a GPU?</h3><p>I’ve written a post on <a href="https://medium.com/@jasmcaus/what-is-a-gpu-and-do-you-need-one-in-deep-learning-8a323476e109?source=friends_link&amp;sk=61916bb71880ddb0c8ac4e9e25040fc0">What is a GPU and do you need one in Deep Learning</a> — it’s worth a read</p><p>GPUs (Graphics Processing Units) are specialized computer hardware created to render images at high frame rates. Since graphics texturing and shading require more matrix and vector operations executed in parallel than a CPU (Central Processing Unit) can reasonably handle, GPUs were made to perform these calculations more efficiently.</p><p>It so happens that Deep Learning also requires super-fast matrix computations. So researchers put two and two together and <a href="http://www.machinelearning.org/archive/icml2009/papers/218.pdf">started training models in GPU’s</a> and the rest is history. Deep Learning only cares about the number of Floating Point Operations (FLOPs) per second, and GPUs are highly optimized for that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1TJ6wZR_ojRGSE3GKw4UBg.png" /><figcaption>Source: <a href="https://www.karlrupp.net/2013/06/cpu-gpu-and-mic-hardware-characteristics-over-time/">Karlrupp</a></figcaption></figure><p>In the chart above, you can see that GPUs (red/green) can theoretically do 10–15x the operations of CPUs (in blue). This speedup very much applies in practice too.</p><p>If you would like to train anything meaningful in deep learning, a GPU is what you need — specifically an NVIDIA GPU (it’s the fastest one out there currently).</p><p>But despite how lucrative GPUs seem, you DON’T require one as you’re getting started. Unless your project is that advanced and requires a <em>ton</em> of calculations, your CPU can handle it pretty much. However, if you do want a GPU (if your computer doesn’t have one built-in), I would suggest you rent access to a computer that already has everything you need pre-installed and ready to go. Costs can be as little as US$0.25 per hour while you’re using it.</p><p><a href="https://towardsdatascience.com/what-is-a-gpu-and-do-you-need-one-in-deep-learning-718b9597aa0d">What is a GPU and do you need one in Deep Learning?</a></p><h3>Code Editors &amp; Environments</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*E8thXTypLwKJa2A-ygS1eg.png" /><figcaption>Visual Studio Code is my go-to code editor</figcaption></figure><p>In Data Science, the general advice (especially if you’re a beginner) is to use some sort of a beginner-friendly environment like <a href="http://jupyter.org/">Jupyter </a>or <a href="http://anaconda.com/">Anaconda</a>, but I use <a href="http://code.visualstudio.com/">VS Code</a> having configured it to support my Data Science projects.</p><p>Here’s an article to <a href="https://towardsdatascience.com/jupyter-lab-evolution-of-the-jupyter-notebook-5297cacde6b">get started with Jupyter Notebook</a></p><h3>Prior Knowledge on Python</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*PPIp7twJJUknfohZqtL8pQ.png" /><figcaption>Source: python.org</figcaption></figure><p>This mini-series on Data Science does assume you’ve been coding for at least a year. It doesn’t matter which language — as long as you’ve had good experience with programming, you should be fine. If you aren’t familiar at all with Python, don’t fret! I’ll link helpful resources along the way.</p><p>If you <em>haven’t </em>had any experience with code, I’d recommend learning Python. It’s (really very) easy and it’s the programming language we’ll be using in this Data Science Mini-Series.</p><h3>Helpful Resources</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jmJBj6OhclzDys7T" /><figcaption>Photo by <a href="https://unsplash.com/@eddrobertson?utm_source=medium&amp;utm_medium=referral">Ed Robertson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Quick Resources to get gain (or refresh) your Python knowledge</p><p><strong>Complete Beginners:</strong></p><ol><li><a href="https://github.com/jakevdp/WhirlwindTourOfPython">Whirlwind Tour of Python</a></li><li><a href="http://realpython.org/">Real Python</a></li><li><a href="https://learnpythonthehardway.org/">Learn Python the Hard Way</a></li></ol><p><strong>Intermediate programmers:</strong></p><ol><li><a href="https://docs.python-guide.org/">The Hitchhiker’s Guide to Python</a></li><li><a href="http://www.newthinktank.com/2014/11/python-programming/">Derek Banas — Python in one video</a></li><li><a href="https://www.udacity.com/course/design-of-computer-programs--cs212">Design of Computer Programs</a></li></ol><p><strong>Advanced Programmers (but maybe new to Python):</strong></p><ol><li><a href="https://learnxinyminutes.com/docs/python3/">Learn x in y minutes</a></li><li><a href="https://www.dabeaz.com/">David Beazley’s courses, tutorials, and books</a></li><li><a href="https://pyvideo.org/speaker/raymond-hettinger.html">Raymond Hettinger</a></li></ol><p><strong>Python Numeric Programming:</strong></p><p>This is worth a read whether you’re a beginner or advanced programmer. We’ll be using a lot of numeric programming throughout this series.</p><ol><li><a href="http://cs231n.github.io/python-numpy-tutorial/">Stanford NumPy tutorial</a></li><li><a href="https://scipy-lectures.org/">Scipy Lecture Notes</a></li><li><a href="https://jakevdp.github.io/PythonDataScienceHandbook/">Python Data Science Handbook</a></li></ol><p>That’s it for the introduction to this Data Science Mini-Series! In the next post, we’ll go over <a href="https://medium.com/@jasmcaus/data-science-with-python-image-classification-with-d87e1234e20b">Image Classification</a>.</p><p><a href="https://towardsdatascience.com/image-classification-in-data-science-422855878d2a">Image Classification in Data Science</a></p><p>As always, thanks so much for reading! Please tell me what you think or would like me to write about next in the comments. I’m open to criticism as well!</p><p>See you in the next post! 😄</p><p><a href="https://towardsdatascience.com/resources-i-wish-i-knew-when-i-started-out-with-data-science-9a8889654c36">Resources I wish I knew when I started out with Data Science</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d48e28ca696" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/data-science-with-python-getting-started-4d48e28ca696">Data Science with Python: Getting Started</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[How we may not be responsible for Climate Change (and the Coronavirus)]]></title>
            <link>https://medium.com/spacezero/how-we-may-not-be-responsible-for-climate-change-and-the-coronavirus-f8c6768be72d?source=rss-135dac1d8e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8c6768be72d</guid>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[coronavirus]]></category>
            <category><![CDATA[chemistry]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[earth]]></category>
            <dc:creator><![CDATA[Marcus]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 14:57:02 GMT</pubDate>
            <atom:updated>2020-04-21T15:01:26.733Z</atom:updated>
            <content:encoded><![CDATA[<h4>Covid-19 is probably the Earth trying to tell us something. It’s done so in the past — this might the other time.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KtiT3z2Oc24Chk8_" /><figcaption>Photo by <a href="https://unsplash.com/@noaa?utm_source=medium&amp;utm_medium=referral">NOAA</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Our Universe has been around for a little around 13.7 billion years. Perhaps the most widely accepted theory is that it formed after the “Big Bang”, a cosmological theory explaining the origin(s) of the Universe.</p><p>The Earth wasn’t formed too very long ago either. When the solar system settled into its current layout 4.5 billion years ago, gravity pulled swirling gas and dust, called “solar nebulae”, in to form a planet which we call “home” today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c-5_xWwimFAlD4eQ" /><figcaption>Photo by <a href="https://unsplash.com/@krackajak21?utm_source=medium&amp;utm_medium=referral">Jack Ebnet</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Early Earth was hot. Really hot. Temperatures soared at 2000 °F. The planet was essentially a ginormous ball of molten rock. There was no air — just carbon dioxide, nitrogen, and water vapour. Over hundreds of million years, the Earth cooled, the atmosphere thickened and life soon started to emerge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BmUFKcbAGPvf9MWZ" /><figcaption>Photo by <a href="https://unsplash.com/@claudelrheault?utm_source=medium&amp;utm_medium=referral">Claudel Rheault</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>And then just 20,000 years ago, the Earth was a large snowball covered in ice sheet several thousand metres thick. Although we call this the “Ice Age” period, geologists refer to it as the “Last Glacial Maximum” because it’s the most recent time when ice reached such a huge extent. Over the past million years or so, there have been 10 glacial maximums.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AeQgRhMHBFiTMdd4" /><figcaption>Photo by <a href="https://unsplash.com/@amaradestiempo?utm_source=medium&amp;utm_medium=referral">Amar Adestiempo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Scientists have determined that the variations in Earth’s orbit around the sun and shifting plate tectonics spurred this waxing and waning in Earth’s climates. Along with solar radiation levels, scientists believe that global warming and cooling are linked to tectonic activity. The shifting of the Earth’s plates creates large-scale changes to continental masses, triggering volcanic activity that releases carbon dioxide into the air.</p><p>And all this ties to a crucial concept in Chemistry: <strong>Entropy</strong></p><blockquote>Entropy means “disturbance” or “disorder”</blockquote><p>In Chemistry, the Second Law of Thermodynamics states that:</p><blockquote>The entropy of the entire universe will always increase.</blockquote><p>Why is it that we get older and never younger? Why does a room that’s been cleaned will always get messy in the future? Certain things happen in one direction and not the other — this is called the “arrow of time”. Denoted as ΔS, the change in entropy suggests that time itself is asymmetric with respect to the order of an isolated system (a system, here the universe, will become more disordered as time increases).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*insvuQ4oTlJ7Jel-" /><figcaption>Photo by <a href="https://unsplash.com/@darwiiiin?utm_source=medium&amp;utm_medium=referral">Darwin Vegher</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>To better understand this often-confused topic, we’ll use an analogy:</p><p>Consider an ice cube. In its solid form, the ice molecules are closely packed together with very little space to move around i.e <strong>there is less chaos</strong>. If we take this same ice cube and place it at room temperature, it is observed that the ice molecules absorb energy from its surroundings, get excited and start to move further apart from each other (basically, it begins to melt). Now if you look at the molecules, they have much more freedom to move around i.e <strong>the chaos has increased.</strong></p><p>Without humans, the Earth has suffered Global Warming (and cooling)</p><p>With humans, the Earth is suffering the same phenomenon</p><p>See the relation?</p><p>Nope?</p><p>You’re right — there isn’t any.</p><p>Global warming is a <strong>natural </strong>process that the Earth undergoes periodically, similar to an annual health checkup. Humans here are only speeding up the rate in which the Earth will suffer this phenomenon.</p><p>Consider a world <em>without </em>any humans on it — calm, peaceful; the world is greener and the sky is beautiful. But behind this veil, CO2 levels <strong>are increasing. </strong>Not so fast, but increasing nonetheless. At this rate, the Earth will show an increase of 0.5°C in probably half a millennium (the entropy of Earth is increasing slowly).</p><p>Come the Industrial Revolution, the exhaust from factories, the burning of fossil fuels are all added (and still are adding) CO2 into the air (the entropy is increasing at a much faster rate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ax53RstzDNUx4gOU" /><figcaption>Photo by <a href="https://unsplash.com/@dodancs?utm_source=medium&amp;utm_medium=referral">Dominik Dancs</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>If ΔSₕ represents the change in entropy of Earth without humans and ΔSₐ represents the change in entropy of Earth with humans, then ΔSₐ &gt;&gt; ΔSₕ</blockquote><p>I began by saying that we may not be responsible for climate change.</p><p>And yes, that’s true</p><p>But to a certain extent:</p><p>While we may not be <em>solely </em>responsible for climate change, we are definitely <em>hastening</em> the process by increasing Earth’s entropy at a faster rate. Eventually, the Earth won’t be able to withstand this and will employ its “cleansing methods” like it’s done so in the past (the Ice Age) and probably doing now with the recent Coronavirus pandemic.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8c6768be72d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/spacezero/how-we-may-not-be-responsible-for-climate-change-and-the-coronavirus-f8c6768be72d">How we may not be responsible for Climate Change (and the Coronavirus)</a> was originally published in <a href="https://medium.com/spacezero">Space Zero</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Image Classification in Data Science]]></title>
            <link>https://medium.com/data-science/image-classification-in-data-science-422855878d2a?source=rss-135dac1d8e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/422855878d2a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Marcus]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 06:20:00 GMT</pubDate>
            <atom:updated>2025-08-07T15:31:50.233Z</atom:updated>
            <content:encoded><![CDATA[<h4>What is image classification in Data Science and building our own image classifier in Python</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v-kR3tvgMSMapseT" /><figcaption>Photo by <a href="https://unsplash.com/@cosiman?utm_source=medium&amp;utm_medium=referral">René Peters</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Welcome to part 2 of the “Data Science with Python” mini-series! In this lesson, we’ll talk about what image classification is and train an image classifier which can recognize cats from dogs (and vice-versa) with sizable accuracy.</p><h3>What is Image Classification?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tsRNHrjOMaOGxduK" /><figcaption>Photo by <a href="https://unsplash.com/@joeyabanks?utm_source=medium&amp;utm_medium=referral">Joey Banks</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Consider the image above. I’m sure we’d all agree that this is a <em>car. </em>But take a step back and analyze how you came to this conclusion — you were shown an image and you <em>classified </em>the class to which it belonged (a car, in this instance). That, in a nutshell, is what image classification is all about.</p><p>There are potentially a countless number of categories in which a given image can be classified (for example, a car can be classified into a sedan, hatchback, SUV etc. and they, in turn, can be classified into an Audi, a Maserati or even a Toyota). Manually checking and classifying images is a very tedious process and it becomes nearly impossible when you’re faced with a massive number of images, say 10,000 or even 100,000.</p><blockquote><em>Image classification is the process of taking an input (like a picture) and outputting a class (like “cat”) or a probability that the input is a particular class (“there’s a 90% probability that this input is a cat”).</em></blockquote><p>You can look at a picture and know that you’re looking at a cat, but how can a computer learn to do that?</p><p>With a convolutional neural network!</p><p>I’ve already written a post on CNNs — it’s worth a read especially if you’re new to Data Science.</p><p>As it turns out,</p><blockquote><em>Computers don’t see images as humans do. They see a matrix of pixels, each of which has three components: red, green and blue (ever heard of RGB?)</em></blockquote><p>Therefore, a 1,000-pixel image for us will have 3,000 pixels for a computer. Each of those 3,000 pixels will have a value, or intensity, assigned to it. The result is a matrix of 3,000 precise pixel intensities, which the computer must somehow interpret as one or more objects.</p><p>For a black and white image, pixels are interpreted as a 2D array (for example, 2x2 pixels). Every pixel has a value between 0 and 255. (Zero is completely black and 255 is completely white. The greyscale exists between those numbers.) Based on that information, the computer can begin to work on the data.</p><p>For a colour image (a combination of red, green and blue), this is a 3D array. Each colour has its value between 0 and 255. The colour can be found by combining the values in each of the three layers.</p><h3>Setting up the Structure of our Image Data</h3><p>In data science, the image classifiers we build have to be <em>trained </em>to recognize objects/patterns — this shows our classifier what exactly (or approximately) what to recognize.</p><p>Imagine I show you the following image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z5GS25HsR5XrPW1m" /><figcaption>Photo by <a href="https://unsplash.com/@lucabravo?utm_source=medium&amp;utm_medium=referral">Luca Bravo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>There is a boathouse, a little boat, hills, a river and other objects. You’ll notice them, but you <em>won’t</em> know exactly what object I’m referring to. Now, if I show you another photo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FoU8Ssk8yqobzQCq" /><figcaption>Photo by <a href="https://unsplash.com/@vorosbenisop?utm_source=medium&amp;utm_medium=referral">Benjamin Voros</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>and another:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o86a-0tuX5Og-n_D" /><figcaption>Photo by <a href="https://unsplash.com/@kydroon?utm_source=medium&amp;utm_medium=referral">Kurt Cotoaga</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>You’ll recognize that I want you to recognize a “Mountain”. By showing you the first two images, I essentially <em>trained </em>your brain to recognize a mountain in the third image.</p><p>The process is (almost) the same for computers — our data needs to be in a specific format. We’ll see this in action later in the article, but just keep these pointers in mind.</p><p>Our model will be trained on the images present in a “training ”set and the label predictions will happen on the testing set images.</p><h3>Building our model</h3><p>For this article, I’ll be using Google Colab — a free cloud service based on Jupyter Notebooks that supports free GPU.</p><blockquote><em>Colab provides a GPU and it’s totally free. Seriously!</em></blockquote><p>The entire code in this article can be found <a href="https://github.com/jasmcaus/image-classifier-python">here</a>.</p><h4>Importing packages &amp; Loading Data</h4><p>In this article, we’ll utilize a filtered version of <a href="https://www.kaggle.com/c/dogs-vs-cats/data">Dogs vs Cats</a> dataset from Kaggle. You can download the archive version of the dataset from <a href="https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip">here</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2173ed05e2960948437e6b86a9ec80ce/href">https://medium.com/media/2173ed05e2960948437e6b86a9ec80ce/href</a></iframe><p>The dataset has the following directory structure:</p><pre><strong>cats_and_dogs_filtered</strong><br>|__ <strong>train</strong><br>    |______ <strong>cats</strong>: [cat.0.jpg, cat.1.jpg, cat.2.jpg ....]<br>    |______ <strong>dogs</strong>: [dog.0.jpg, dog.1.jpg, dog.2.jpg ...]<br>|__ <strong>validation</strong><br>    |______ <strong>cats</strong>: [cat.2000.jpg, cat.2001.jpg, cat.2002.jpg ....]<br>    |______ <strong>dogs</strong>: [dog.2000.jpg, dog.2001.jpg, dog.2002.jpg ...]</pre><p>Next, we’ll assign variables with the proper file path for the training and validation set.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ce9d75847268e8225cbe20a3de8db1f/href">https://medium.com/media/4ce9d75847268e8225cbe20a3de8db1f/href</a></iframe><p>If you’d like to know cat and dog images are in the training and validation directory, use the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb32873b018ecd9abd90e44ba7212e4f/href">https://medium.com/media/cb32873b018ecd9abd90e44ba7212e4f/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*E8CUvBmHwLmjfmWh.png" /><figcaption>If you’ve got different output, don’t fret — you’ve probably used a different dataset</figcaption></figure><h4>Prepping our data</h4><p>Our images have to be formatted into appropriately pre-processed floating-point tensors before we can feed it to the network.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ecf81c2b6e21ff3a9ab2dd90cfe002be/href">https://medium.com/media/ecf81c2b6e21ff3a9ab2dd90cfe002be/href</a></iframe><h4>Visualizing the training images</h4><p>We will now extract a batch of images from the training generator and then plot five of them with matplotlib.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/67248a804741822f8c2e3cc02bd3313a/href">https://medium.com/media/67248a804741822f8c2e3cc02bd3313a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q6G8z0oMs12xa_C0.png" /><figcaption>5 training images</figcaption></figure><h4>Creating the model</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c40a1c40bb7f6def6a8feb41f12d0d8b/href">https://medium.com/media/c40a1c40bb7f6def6a8feb41f12d0d8b/href</a></iframe><h4>Compiling the model</h4><p>In this article, we’ll use the <em>ADAM</em> optimizer and <em>binary cross-entropy</em> loss function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bc5185dba8fda2c38705f9e4a8780582/href">https://medium.com/media/bc5185dba8fda2c38705f9e4a8780582/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/0*0r8QhPZ1BQTXknWn.png" /></figure><h4>Training our model</h4><p>We’ll use the fit_generator method of the ImageDataGenerator class to train our network.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5dcb482c738bf4be533a5b8f9158f020/href">https://medium.com/media/5dcb482c738bf4be533a5b8f9158f020/href</a></iframe><p>Allow this to run — it will take some time. Have patience!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VPVe2jlotFs0zrZH.png" /></figure><h4>Visualizing the training results with a Plot</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8941ba03fff7e0e9ac004c8860ee35b8/href">https://medium.com/media/8941ba03fff7e0e9ac004c8860ee35b8/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/0*lgc4fwop5DApFaix.png" /><figcaption>Training and Validation Plot</figcaption></figure><p>As you can see from the graphs, the training accuracy and validation accuracy are off by a large margin and the model has achieved only around <strong>70%</strong> accuracy on the validation set.</p><h3>Overfitting</h3><p>In the plots above, the training accuracy increases linearly over time, whereas the validation accuracy stalls around 70% in the training process. Also, there is a difference between the training and validation accuracy is noticeable — a sign of <em>overfitting</em>.</p><blockquote><em>When there are a small number of training examples, the model sometimes learns from noises (unwanted details) from the training examples. This negatively impacts the performance of the model on new examples. This phenomenon is known as overfitting.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*JFH2IZaDrBzubo9X.png" /><figcaption>Overfitting Electoral Precedence (Source: <a href="https://xkcd.com/1122/">XKCD</a>)</figcaption></figure><p>This means that the model will have a difficult time generalizing on a new dataset.</p><p>There are multiple ways to fight overfitting in the training process. In this article, we’ll use <em>data augmentation</em> and add <em>dropout</em> to our model.</p><h4>Data augmentation</h4><p>Overfitting generally occurs when there are a <em>small </em>number of training examples. One way to fix this problem is to augment the dataset so that it has a sufficient number of training examples.</p><blockquote><em>The goal is that our model should never see the same picture twice during the training phase. This helps expose it to more aspects of the data which will ultimately increase its recognition accuracy.</em></blockquote><h4>Augmenting and visualizing the data</h4><p>In this article, we’ll apply random <strong><em>horizontal flip</em></strong><em>, </em><strong><em>rotate </em></strong><em>and </em><strong><em>zoom </em></strong>augmentation to the dataset and see how individual images look like after the transformation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1361373b5ba6c20a10cbe5e5fe16fd23/href">https://medium.com/media/1361373b5ba6c20a10cbe5e5fe16fd23/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pOMsYg4KsmHdxMg7.png" /></figure><h4>Creating a validation data generator</h4><p>In general, we only apply data augmentation to the training examples. In this case, we’ll rescale the validation images and convert them into batches.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/75788e908f466f32e12a0eb4894c222d/href">https://medium.com/media/75788e908f466f32e12a0eb4894c222d/href</a></iframe><h3>Dropout</h3><p>Another technique to reduce overfitting is to introduce <em>dropout</em> to the network.</p><blockquote><em>Dropout is a form of regularization that randomly knocks out units (i.e neurons) from your neural network so on every iteration you end up working with a smaller neural network.</em></blockquote><p>The intuition here is: <strong>You can’t rely on any one feature, so you have to spread out the weights.</strong></p><p>When you apply dropout to a layer, it randomly drops out (set to zero) the number of output units during the training process. It takes a fractional number as its input, in the form such as 0.1, 0.3, etc. (this means dropping out 10% or 30% of the output units randomly from the layer it&#39;s applied to).</p><h4>Creating a new network with Dropouts</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a73655601bf5c1de1334127d3e1fcbd/href">https://medium.com/media/7a73655601bf5c1de1334127d3e1fcbd/href</a></iframe><h4>Visualizing the new model</h4><p>You will notice that there is significantly less overfitting than before. The accuracy should go up after training the model for more epochs.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fed38eb3d6ec7aee1747d9fc17b5a207/href">https://medium.com/media/fed38eb3d6ec7aee1747d9fc17b5a207/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/0*AQb6WfpALnDCA45T.png" /><figcaption>A more accurate model</figcaption></figure><p>That’s it! We’ve successfully built an Image Classifier to recognize cats from dogs in an image. As with all neural networks, we couldn’t reach 100% accuracy, but we were able to improve the accuracy level of our model by a considerable bit by exposing it to the same number of images, but with <em>augmentations </em>like rotation, flip and zoom.</p><p>As always, thanks so much for reading! Please tell me what you think or would like me to write about next in the comments. I’m open to criticism as well!</p><p>See you in the next post! 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=422855878d2a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/image-classification-in-data-science-422855878d2a">Image Classification 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>