<?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"><channel><title><![CDATA[Pratham's Blog]]></title><description><![CDATA[Pratham's Blog]]></description><link>https://hashnode.prathamprasoon.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1619799240272/v8_xQP56_.png</url><title>Pratham&apos;s Blog</title><link>https://hashnode.prathamprasoon.com</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 06:31:26 GMT</lastBuildDate><atom:link href="https://hashnode.prathamprasoon.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Why 0! = 1]]></title><description><![CDATA[A primer on factorials
The '!' behind the 0, is notation for something called a 'factorial'.
A factorial basically tells you to take the product of all integers and itself before it until you reach 1.
If that didn't make any sense, take a look at thi...]]></description><link>https://hashnode.prathamprasoon.com/why-0-1</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/why-0-1</guid><category><![CDATA[Math]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Thu, 29 Jul 2021 02:41:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1627526287325/ovlbLzQPY.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h5 id="heading-a-primer-on-factorials">A primer on factorials</h5>
<p>The '!' behind the 0, is notation for something called a 'factorial'.</p>
<p>A factorial basically tells you to take the product of all integers and itself before it until you reach 1.</p>
<p>If that didn't make any sense, take a look at this example.</p>
<p>1! = 1
2! = 1 x 2
3! = 1 x 2 x 3
4! = 1 x 2 x 3 x 4</p>
<p>See what I am talking about?</p>
<p>Now before we go to why 0! = 1, let's take a look at something called exponents and some patterns in them which will help us later on.</p>
<p>𝑥ⁿ (read as "𝑥 to the power of n") basically tells you that 𝑥 is multiplied by itself 'n' times, like:</p>
<p>2² = 2 x 2 = 4
2³ = 2 x 2 x 2 = 8</p>
<p>Now what do you think 2⁰ will be? </p>
<p>You might think that 2 multiplied by itself 0 times should be 0, but as it turns out any number to the power of 0 = 1.</p>
<p>2⁰ = 1, but how?</p>
<p>That might not make sense on first glance, but let me show you why it is correct.</p>
<p>Here's a list of some of the powers of 2, you'll notice a pattern over here.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627526365129/iYtk8KcQV.png" alt="image.png" /></p>
<p>Each time you go up one level, you're essentially dividing by 2, what happens when you get to 2⁰?</p>
<p>You get 1, and now it all makes sense.</p>
<p>This is why every number to the power of 0 is 1.</p>
<p>(This also works for powers in negative numbers)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627526385422/8R51n2Kox.png" alt="image.png" /></p>
<p>Factorials follow a similar pattern as you can see below, and as you can guess, 0! turns out to be 1 by this pattern!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627526400710/LBcpqFBt8.png" alt="image.png" /></p>
<p>Factorials aren't just about showing a neat pattern, they have real world use cases in combinatorics, a topic in math that deals with counting.</p>
<p>Let me explain.</p>
<p>You have 2 balls, one yellow and the other is blue.</p>
<p>In how many different ways can you arrange them?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627526420687/gx7BgXquV.png" alt="image.png" /></p>
<p>There are 2 possible cases, now similarly can you guess how many ways can you arrange 3 balls?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627526431763/9uJtJD18H.png" alt="image.png" /></p>
<p>There are 6 possible cases to arrange 3 balls.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627526450181/pC6nwVmMN.png" alt="image.png" /></p>
<p>As it turns out, the number of ways you can arrange n balls is n! </p>
<p>2 balls = 2! = 2 
3 balls = 3! = 6</p>
<p>2! basically means "in how many ways can arrange 2 balls" which is 2.</p>
<p>Now what 0! tells you is how many ways can you arrange 0 balls, or basically nothing.</p>
<p>There is exactly one way to show nothing! </p>
<p>Which again proves why 0! is 1.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1627526464723/0RF1Kr9Q_.png" alt="image.png" /></p>
]]></content:encoded></item><item><title><![CDATA[Recall, Precision, and F1 score explained.]]></title><description><![CDATA[Introduction
A store owner recently noticed an alarmingly high rate of shoplifting.
He develops a machine learning model that predicts if a customer has shoplifted or not and it is 95% accurate! 
He deploys the model but a month later catches no shop...]]></description><link>https://hashnode.prathamprasoon.com/recall-precision-and-f1-score-explained</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/recall-precision-and-f1-score-explained</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[Python]]></category><category><![CDATA[100DaysOfCode]]></category><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[Deep Learning]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Sun, 16 May 2021 11:58:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1621161338156/axLklmSIQ.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="introduction">Introduction</h3>
<p>A store owner recently noticed an alarmingly high rate of shoplifting.</p>
<p>He develops a machine learning model that predicts if a customer has shoplifted or not and it is 95% accurate! </p>
<p>He deploys the model but a month later catches no shoplifters...</p>
<p>Why?</p>
<h3 id="lets-dive-deeper">Let's dive deeper</h3>
<p>Before we get into this problem it is important to understand what accuracy is.</p>
<blockquote>
<p>Accuracy is the number of times you predicted something correctly divided by how many times you actually predicted it.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621161359381/w3Jfv5SRQ.png" alt="2.png" /></p>
</blockquote>
<p>If you closely look at the dataset, you will notice that out of the 10,000 customers that entered the store, only 500 were shoplifters in that month.</p>
<p>Some quick math will tell you that 95% of customers are not shoplifters and the other 5% are.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621161368425/7tMKy8DGt.png" alt="1.png" /></p>
<p>If you basically said that everyone was not a shoplifter, you'd be correct in 95 out of 100 cases, which is what the model did.</p>
<p>You would be wrong in the other 5 cases, but who cares? </p>
<p>We're still 95% accurate, but this is clearly not what we are looking for.</p>
<blockquote>
<p>This problem happens in 'imbalanced' datasets where the data is heavily skewed.</p>
</blockquote>
<p>You're either a shoplifter, or you're not, and the former is significantly more present in the dataset.</p>
<p>Our model finds a shortcut to increase accuracy.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621161381645/aGBXs4bat.png" alt="3.png" /></p>
<h3 id="moral-of-the-story-accuracy-is-not-a-suitable-metric-to-use-in-situations-where-the-data-is-skewed">Moral of the story: Accuracy is not a suitable metric to use in situations where the data is skewed.</h3>
<p>Then, how do we solve this problem?</p>
<p>Evaluate your model using a different metric, let us take a look at recall and precision, but first, it is important to understand some terminology.</p>
<p>This is a confusion matrix, it shows you all the possible scenarios of the predictions of a model Vs the ground truth.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621166108004/JY7AhuDMu.png" alt="image.png" />
Pretty confusing right? 
(No pun intended)</p>
<p>Let me simplify it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621161406919/qQrWH1Wd0.png" alt="image.png" /></p>
<p>This meme explains is better, the confusion matrix shows us the predictions of a model Vs the ground truth. </p>
<p>Consider the doctor to be the model and the patient to be the ground truth.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621161421951/GnhZThbH0.png" alt="image.png" /></p>
<h3 id="lets-co-relate-this-to-our-case-of-shoplifting">Let's co-relate this to our case of shoplifting.</h3>
<ul>
<li><p>Case 1: Our model predicts someone shoplifted when they actually did (TP - True Positive)</p>
</li>
<li><p>Case 2: Our model predicts someone shoplifted when they didn't (FP - False Positive)</p>
</li>
<li><p>Case 3: Our model predicts someone did not shoplift when they did (FN - False Negative)</p>
</li>
<li><p>Case 4: Our model predicts someone did not shoplift when they didn't (TN - True Negative) </p>
</li>
</ul>
<p>Whenever you're confused, just refer to the above meme ;)</p>
<p>In formal terms, 'recall' is defined using this formula.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621161457572/JWq7TSA3x.png" alt="5.png" /></p>
<ul>
<li>What this metric basically does is tells us how good our model is at identifying relevant samples.</li>
</ul>
<p>Or</p>
<ul>
<li>How good is our model at catching actual shoplifters?</li>
</ul>
<blockquote>
<p>TP: Shoplifters correctly identified
FN: Shoplifters missed</p>
</blockquote>
<p>Now if the model classifies no one as a shoplifter, it is going to have 0 recall.</p>
<p>This means it is "not good at all" if we are optimizing to have as high of recall as possible. </p>
<p>On the flip side, what if we label everyone as a shoplifter?</p>
<p>We'll have a recall of 100%, after all, recall just cares about not missing shoplifters, not about false accusations on customers (False Positive).</p>
<h3 id="but-there-is-a-metric-that-does-care-about-false-accusations-on-customers-precision">But there is a metric that does care about false accusations on customers, precision.</h3>
<p>We basically replace False Negatives with False Positives in the denominator.</p>
<ul>
<li>Out of all the positive classes we have predicted correctly, how many are actually positive.</li>
</ul>
<p>Or</p>
<ul>
<li>How good is our model at not making false accusations?</li>
</ul>
<p>By this point, you might've guessed what problem we will encounter if we only optimize for high precision in our model.</p>
<p>The model can just call everyone not a shoplifter and have high precision.</p>
<p>Recall and precision are related such that high precision leads to low recall, and low precision leads to high recall.</p>
<p>We obviously want both to as high as possible, is there any metric that combines both precision and recall?</p>
<h3 id="say-hello-to-the-f-score">Say hello to the F₁ score.👋</h3>
<p>The F₁ score is the harmonic mean of precision and recall. </p>
<p>The harmonic mean is a special type of mean(average) which is explained by this formula.</p>
<p>We use this mean instead of the normal mean because the normal punishes extreme values.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621169288000/S7JLM7M3a.png" alt="image.png" /></p>
<h3 id="now-if-we-optimize-our-model-to-have-an-f-score-we-can-have-high-precision-and-recall">Now if we optimize our model to have an F₁ score, we can have high precision and recall.</h3>
<p>This translates to our model being able to catch shoplifters and at the same time not falsely accuse innocent customers.</p>
<p>The model will be sure when it catches a shoplifter that it is actually a shoplifter and that brings this story to an end.</p>
<p>Over the next few months, I will be explaining even more evaluation metrics like the F₁ score. </p>
<p>If you enjoy such content, make sure to subscribe to my  <a target="_blank" href="https://www.getrevue.co/profile/prasoonpratham">newsletter</a> .</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621169309073/JSoop7Pnq.png" alt="image.png" /></p>
]]></content:encoded></item><item><title><![CDATA[Logarithms explained.]]></title><description><![CDATA[Before we understand how logarithms work, it is important to know how exponents work.
aᶜ=b (read as "a to the power of c equals b") is an exponent where a,b and c are numbers.
aᶜ=b just means that a multiplied by itself c amount of times is equal to ...]]></description><link>https://hashnode.prathamprasoon.com/logarithms-explained</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/logarithms-explained</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[Mathematics]]></category><category><![CDATA[Computer Science]]></category><category><![CDATA[100DaysOfCode]]></category><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Thu, 13 May 2021 11:36:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1620905575074/a4xLusr4p.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before we understand how logarithms work, it is important to know how <strong>exponents</strong> work.</p>
<p>aᶜ=b (read as "a to the power of c equals b") is an exponent where a,b and c are numbers.</p>
<p>aᶜ=b just means that a multiplied by itself c amount of times is equal to b.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620905270045/U_NTMp4Z6.png" alt="2.png" /></p>
<p>Here are some examples: </p>
<ul>
<li>2² basically means 2 multiplied by itself 2 times which is 4</li>
<li>2³ basically means 2 multiplied by itself 3 times which is 8</li>
</ul>
<p>So on and so forth.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620905357838/0shShpFYL.png" alt="3.png" /></p>
<blockquote>
<p>Logarithms are basically a way of representing exponents in a different format. </p>
</blockquote>
<p>Let me show you what I mean, both the formulas that you see below are equal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620905407910/CYfZUJifV.png" alt="6.png" /></p>
<p>logₐb = c is basically saying that "a to the power of c = b".</p>
<p>Dare I say, logarithms are exponents in disguise.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620905444580/NYhrZTzmv.png" alt="4.png" /></p>
<p>Here's a small exercise for you, what is the value of c in the below equations?</p>
<p>I've put them in logarithmic and exponential notation to make it easy for you.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620905460632/FgoLfNoU6.png" alt="5.png" /></p>
<p>Logarithms are used in all sorts of places, machine learning, computer science (time complexities)... you name it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620905489841/Qnr8Zc364.png" alt="image.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620905498375/1cwVXexqp.png" alt="image.png" /></p>
<p>They are also a bunch of logarithmic properties that we can use to our advantage, but that is something I'll discuss in another blog post.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620905504318/GJ5-Iqxuc.png" alt="image.png" /></p>
<p>I really hope you enjoyed this blog post, you can also subscribe to my  <a target="_blank" href="https://www.getrevue.co/profile/prasoonpratham">newsletter </a> where I post bite-sized content like this.</p>
<p>Peace out!</p>
]]></content:encoded></item><item><title><![CDATA[Make beautiful pencil sketches using OpenCV in 9 lines of code]]></title><description><![CDATA[For this simple project we will use  OpenCV  in Python.
It is a library using which we can develop real-time computer vision applications. It mainly focuses on image processing, video capture and analysis including features like face detection and ob...]]></description><link>https://hashnode.prathamprasoon.com/make-beautiful-pencil-sketches-using-opencv-in-9-lines-of-code</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/make-beautiful-pencil-sketches-using-opencv-in-9-lines-of-code</guid><category><![CDATA[opencv]]></category><category><![CDATA[Python]]></category><category><![CDATA[100DaysOfCode]]></category><category><![CDATA[#codenewbies]]></category><category><![CDATA[python projects]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Tue, 04 May 2021 12:08:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1619986032744/YEiUtr1b2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>For this simple project we will use  <a target="_blank" href="https://opencv.org/">OpenCV</a>  in Python.</p>
<p>It is a library using which we can develop real-time computer vision applications. It mainly focuses on image processing, video capture and analysis including features like face detection and object detection.</p>
<p>But before that....</p>
<h3 id="a-bit-of-backstory">A bit of backstory</h3>
<p>When I was in 7th grade (3 years ago), I used to play with this photo editing software called " <a target="_blank" href="https://www.gimp.org/">GIMP</a> ". (short for GNU Image Manipulation Software)</p>
<p>Using a couple of clever techniques, I would make sketches out of images like what you saw in the thumbnail.</p>
<h3 id="lets-see-how-this-process-works">Let's see how this process works.</h3>
<ul>
<li>You take an image</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619984592141/rAqt04cPZ.png" alt="image.png" /></p>
<ul>
<li>Convert it to grayscale</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619984602580/_O9gwlCYo.png" alt="image.png" /></p>
<ul>
<li>Invert the grayscaled image</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619984610480/ypuOmpcpH.png" alt="image.png" /></p>
<ul>
<li>Blur the inverted image</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619984622303/vjNHIGXXW.png" alt="image.png" /></p>
<ul>
<li>Subtract the grayscaled image from the blurred inverted image</li>
</ul>
<p>et voilà !</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619984634641/uJkUA3dGN.png" alt="image.png" /></p>
<p>I figured that I could automate this process using OpenCV, let see the code and how it works.</p>
<pre><code class="lang-py"><span class="hljs-keyword">import</span> cv2
<span class="hljs-comment"># Importing the OpenCV libarary</span>

img = cv2.imread(<span class="hljs-string">'image.jpg'</span>)
<span class="hljs-comment">#Reading the image</span>

img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
<span class="hljs-comment">#Converting the image to grayscale</span>


img_invert = cv2.bitwise_not(img_gray)
<span class="hljs-comment">#Inverting the grayscaled image</span>

img_smoothing = cv2.GaussianBlur(img_invert, (<span class="hljs-number">21</span>, <span class="hljs-number">21</span>),sigmaX=<span class="hljs-number">0</span>, sigmaY=<span class="hljs-number">0</span>)
<span class="hljs-comment">#Blurring the inverted image</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">dodge</span>(<span class="hljs-params">x, y</span>):</span>
    <span class="hljs-keyword">return</span> cv2.divide(x, <span class="hljs-number">255</span> - y, scale=<span class="hljs-number">256</span>)
final_img = dodge(img_gray, img_smoothing)
<span class="hljs-comment">#Subtracting the blurred iamge from the orignal image</span>

cv2.imwrite(<span class="hljs-string">'img.jpg'</span>, final_img)
<span class="hljs-comment">#Writing the final output to a a file</span>
</code></pre>
<p>Just like that in 9 lines of code, you can easily create skteches using OpenCV and Python!</p>
<p>Here's the Github repository with this  <a target="_blank" href="https://github.com/PrasoonPratham/Sketches-with-Python">code</a> .</p>
]]></content:encoded></item><item><title><![CDATA[This is what your first 30 days of machine learning should look like.]]></title><description><![CDATA[What you are going to read below is a roadmap for the first 30 days of getting started with machine learning as a complete beginner.
If you don't know how to code or anything about what machine learning is, then this blog post is for you.
Step 1: Lea...]]></description><link>https://hashnode.prathamprasoon.com/this-is-what-your-first-30-days-of-machine-learning-should-look-like</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/this-is-what-your-first-30-days-of-machine-learning-should-look-like</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[Python]]></category><category><![CDATA[100DaysOfCode]]></category><category><![CDATA[#codenewbies]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Mon, 08 Feb 2021 08:40:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1620130429590/mGfFhe3QM.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>What you are going to read below is a roadmap for the first 30 days of getting started with machine learning as a complete beginner.</p>
<p>If you don't know how to code or anything about what machine learning is, then this blog post is for you.</p>
<h3 id="step-1-learn-the-basics-of-python-12-days">Step 1: Learn the basics of Python (~12 days)</h3>
<p>Python is a programming language that you can use for machine learning.</p>
<p>Now, why do I recommend Python over any other language?</p>
<ul>
<li>It is easy to learn</li>
<li>Has the largest community for machine learning</li>
<li>Lots of learning resources</li>
</ul>
<h4 id="this-4-hour-tutorial-on-freecodecamp-will-help-you-get-started-with-python">This 4 hour tutorial on FreeCodeCamp will help you get started with Python.</h4>
<p>Some of the important topics covered in this tutorial are:</p>
<ul>
<li>Lists</li>
<li>List Functions</li>
<li>Tuples</li>
<li>Functions</li>
<li>Return Statement</li>
<li>If Statements</li>
<li>If Statements &amp; Comparisons</li>
<li>Dictionaries
... and lots more</li>
</ul>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="youtu.be/rfscVS0vtbw">youtu.be/rfscVS0vtbw</a></div>
<p>Getting through this course will take you about 12 days if you spend an hour and a half on it each day. 
Take your time to understand every concept and ask for help online if needed.</p>
<blockquote>
<p>Make sure you're consistent.</p>
</blockquote>
<h3 id="step-2-understand-how-machine-learning-works-3-days">Step 2: Understand how machine learning works. (~3 days)</h3>
<p>This video series by 3blue1brown will help you understand how neural networks work. </p>
<p>It will take you roughly 3 days to complete this series.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=aircAruvnKk">https://www.youtube.com/watch?v=aircAruvnKk</a></div>
<blockquote>
<p>Neural networks are just one part of machine learning, there are many other "classical" machine learning algorithms as well.</p>
</blockquote>
<p>However, to keep things simple, we'll only be focusing on neural networks.</p>
<h3 id="step-3-get-started-with-machine-learning-15-days">Step 3: Get started with Machine Learning (~15 days)</h3>
<p>Now it is time for you to dive into machine learning, this 10 part course will teach you the fundamentals of machine learning in TensorFlow.</p>
<p>You'll learn about:</p>
<ul>
<li>Neural Networks</li>
<li>Computer Vision</li>
<li>Overfitting</li>
<li>Convolutions and pooling</li>
<li>Image Augmentation</li>
<li>Natural Language Processing</li>
</ul>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=_Z9TRANg4c0&amp;feature=youtu.be">https://www.youtube.com/watch?v=_Z9TRANg4c0&amp;feature=youtu.be</a></div>
<p>This roadmap will provide a solid foundation to your machine learning journey, cheers!</p>
<p>Before you leave, make sure to follow me on Twitter👇</p>
<p><a target="_blank" href="https://twitter.com/PrasoonPratham">@PrasoonPratham</a> </p>
]]></content:encoded></item><item><title><![CDATA[A list of the tools you will need for machine learning in Python.]]></title><description><![CDATA[Anaconda
When you work in python, you'll be working with several frameworks and many of them work only on specific versions of python.
Now imagine downloading a new version of python and then installing it for every framework you want to work with. �...]]></description><link>https://hashnode.prathamprasoon.com/a-list-of-the-tools-you-will-need-for-machine-learning-in-python</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/a-list-of-the-tools-you-will-need-for-machine-learning-in-python</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[Python]]></category><category><![CDATA[100DaysOfCode]]></category><category><![CDATA[#codenewbies]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Sat, 06 Feb 2021 14:48:21 GMT</pubDate><content:encoded><![CDATA[<h3 id="anaconda">Anaconda</h3>
<p>When you work in python, you'll be working with several frameworks and many of them work only on specific versions of python.</p>
<p>Now imagine downloading a new version of python and then installing it for every framework you want to work with. 😬</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612622596041/3hkDVB9hG.png" alt="image.png" />
Meet Anaconda which allows you to run several versions of python. It comes pre-installed with several data sciences and machine learning frameworks. </p>
<p>Pip-env is also a way of maintaining several versions of Python and comes pre-installed with Python.</p>
<blockquote>
<p>You can use pip env or Anaconda, whichever works best for you. </p>
</blockquote>
<h3 id="jupyter-notebooks">Jupyter Notebooks</h3>
<p>Jupyter notebooks is an IDE just like VS Code or Sublime. The special thing about Jupiter is that you can parts of code in mini code editors called cells. This is great for prototyping and testing code.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612622656555/4kret5Bri.png" alt="image.png" /></p>
<h3 id="google-collab">Google Collab</h3>
<p>Collab is a jupyter notebook running on google's servers which gives you access to GPUs and TPUs for training machine learning models faster for free, yes free. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612622686804/wRr2HWJF5.png" alt="image.png" /></p>
<h3 id="kaggle">Kaggle</h3>
<p>I like to call Kaggle the codepen for machine learning and data science. This is the place where you show off your machine learning skills. You have access to datasets for which you can make machine learning models and compete with other people around the world.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612622721857/k2U1ry50h.png" alt="image.png" /></p>
<h3 id="tensorflow">TensorFlow</h3>
<p>TensorFlow is a framework for machine learning,it has variants like TensorFlow.js for machine learning in the browser, TensorFlow lite for machine learning on mobile phones, and the standard TensorFlow library. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612622742375/Q5gPyWMoU.png" alt="image.png" /></p>
<h3 id="pytorch">PyTorch</h3>
<p>PyTorch is an open-source machine learning library based on the Torch library, used for applications such as computer vision and natural language processing. It is very similar to TensorFlow in the things you can do in it with differences in the syntax.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612622766093/px_h9CtEX.png" alt="image.png" /></p>
<h3 id="matplotlib">Matplotlib</h3>
<p>Matplotlib is a library for plotting data into pie charts, bar charts, and whatever kinds of graphs you can imagine. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612622795148/ovJES-e7D.png" alt="image.png" /></p>
<h3 id="numpy">NumPy</h3>
<p>Numpy replaces the lists in Python with its lists, but why? Aren't the default lists good enough? The thing is that NumPy lists are much faster than Python lists, hence the wide usage of NumPy. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612622820652/WIpMe24y5.png" alt="image.png" /></p>
<h3 id="scikit-learn">SciKit Learn</h3>
<p>SciKit learn is a machine learning library that features various classification, regression, and clustering algorithms including support vector machines. These are complex computations you may need in training your machine learning model. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612622845750/h9GeP3zYM.png" alt="image.png" /></p>
<h3 id="pandas">Pandas</h3>
<p>Pandas basically allows you to interact with Data in CSV files, databases etc. using something called a "dataframe".</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612622869471/J6JQhJWIF.png" alt="image.png" /></p>
]]></content:encoded></item><item><title><![CDATA[MindsDB - The Superpowers of Machine learning in your regular DataBase.]]></title><description><![CDATA[A little while ago, I was experimenting with different tools to implement machine learning models in real-world apps, and I came across ‘AI Tables’ by MindsDB. It is a predictive AI layer for existing databases. In this article, I will talk about my ...]]></description><link>https://hashnode.prathamprasoon.com/mindsdb-the-superpowers-of-machine-learning-in-your-regular-database</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/mindsdb-the-superpowers-of-machine-learning-in-your-regular-database</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[ML]]></category><category><![CDATA[Python]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Wed, 27 Jan 2021 07:02:16 GMT</pubDate><content:encoded><![CDATA[<p>A little while ago, I was experimenting with different tools to implement machine learning models in real-world apps, and I came across ‘AI Tables’ by MindsDB. It is a predictive AI layer for existing databases. In this article, I will talk about my experience with it.</p>
<blockquote>
<p>Quick disclaimer: This blog post was sponsored by MindsDB. However, what you read below is my honest opinion about their product.  </p>
</blockquote>
<p>Recently, the field of productionizing machine learning models using pipelines and several application layers, popularly known as 'MLops', has become a rapidly growing field, and for a valid reason. The number of companies that are using machine learning models in real-world applications grows larger day-by-day.</p>
<p>Such systems are usually very complex; this complexity is due, for the most part, to the application layer between the database and the frontend. MindsDB's AI Tables aims to provide an innovative solution to this problem.</p>
<h3 id="lets-take-a-closer-look">Let's take a closer look.</h3>
<p>Today, most machine learning applications in the real world are structured like this. 👇</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611730506710/pMWoxHk09.png" alt="image.png" /></p>
<p>You have the front end, the presentation layer, the backend, the application layer, and then the data layer, connecting the backend to the database(s).</p>
<p>All these layers work together to make the application functional.</p>
<p>Today, most companies have their data stored in traditional relational databases like MySQL, PostgreSQL, MariaDB, etc. Using data stored in these databases to train and deploy our models can be a very tedious task.</p>
<p>Wouldn’t it be great if there was a way to train and deploy machine learning models in the database and not worry about the application layer?</p>
<h3 id="say-hello-to-ai-tables-by-mindsdb">Say hello to AI Tables by Mindsdb. 👋</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611730600112/QRs2xfoOw.png" alt="image.png" /></p>
<blockquote>
<p>"Anyone that has dealt with Machine Learning understands that data is a fundamental ingredient to it. Given that a great deal of the world's organized data already exists inside databases, doesn't it make sense to bring machine learning capabilities straight to the database itself?"</p>
</blockquote>
<p>~ MindsDB Documentation</p>
<p>Typically, we query data that exists in a database. Data that is not present in the database obviously cannot be accessed.</p>
<blockquote>
<p>An AI Table differs from a typical DB Table in that it can generate data upon being requested. </p>
</blockquote>
<p>This is based on both, a model and the data in other tables, basically giving regular databases the superpowers of machine learning without the hassle of writing tons of code.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611244295214/nrVbEZ-xP.png" alt="image.png" /></p>
<p>Notice how Dave's debt was not present in the database?</p>
<p>AI Tables filled it with a predicted value based on a machine learning model.</p>
<p>It looks like a normal database query!</p>
<p>This is how AI Tables are supposed to work.</p>
<h3 id="my-experience-with-mindsdbs-ai-tables">My experience with MindsDB's AI Tables.</h3>
<p>I followed MindsDB’s documentation and YouTube tutorials. The docs were well written, though I wish they had more instructions on setting up the database itself. The youtube videos were not the easiest to follow and had room for improvement. I felt that it was more like a general overview than an in-depth guide going over each step, which I would prefer.</p>
<p>Nonetheless, I started out with their <a target="_blank" href="https://colab.research.google.com/drive/1qnH4bhTKvm6mEyV8nAoK9uMZm8HV_gwE?usp=sharing">colab</a> starter example, which is a great way to get a feel for how mindsDB works.</p>
<p>I got started with Ai tables in Postgres using the <a target="_blank" href="https://docs.mindsdb.com/databases">docs</a>
And the YouTube tutorial 👇</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=fkHNln3GFnc">https://www.youtube.com/watch?v=fkHNln3GFnc</a></div>
<p>The YouTube tutorial wasn’t really that great, I felt that it was more like a general overview than an in-depth guide going over each step, which I would prefer.</p>
<p>After getting in touch with one of the engineers at MindsDB I was able to get a Postgres database with the housing dataset setup.</p>
<p>Using mindsDb’s GUI I was able to:</p>
<ul>
<li>Check the quality of the data</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611241536433/qyUf2rUYx.png" alt="image.png" /></p>
<ul>
<li>Train Models in a few clicks</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611241612339/5unJZnvyx.png" alt="image.png" /></p>
<ul>
<li>Make predicted queries </li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611241789160/ZMThIZXPv.png" alt="image.png" /></p>
<h3 id="concluding-thoughts">Concluding thoughts</h3>
<p>All-in-all, I feel that MindsDB has a very innovative product that works just as advertised. It can be helpful to a wide range of people and companies who are looking for simple yet effective solutions for deploying machine learning models.</p>
<p>Did I mention it’s open-source?</p>
<p>Check out MindsDB AI Tables here👇</p>
<ul>
<li><a target="_blank" href="https://github.com/mindsdb/mindsdb">Github 📂</a></li>
<li><a target="_blank" href="https://mindsdb.com/">Website 🌐</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[A beginner-friendly introduction to Generative Adversarial Networks (GANs) in machine learning.]]></title><description><![CDATA["Generative Adversarial Networks" (or GANs for short) is a fascinating approach for training neural networks.
It sounds really complicated but it isn't. 
Let's talk about it.

Pre-requisites to follow along: None.

A GAN has 2 parts: A generator and ...]]></description><link>https://hashnode.prathamprasoon.com/a-beginner-friendly-introduction-to-generative-adversarial-networks-gans-in-machine-learning</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/a-beginner-friendly-introduction-to-generative-adversarial-networks-gans-in-machine-learning</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[TensorFlow]]></category><category><![CDATA[Python]]></category><category><![CDATA[learning]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Mon, 25 Jan 2021 17:26:50 GMT</pubDate><content:encoded><![CDATA[<p><strong> "Generative Adversarial Networks" (or GANs for short)</strong> is a fascinating approach for training neural networks.</p>
<p>It sounds really complicated but it isn't. </p>
<p>Let's talk about it.</p>
<blockquote>
<p>Pre-requisites to follow along: None.</p>
</blockquote>
<h3 id="a-gan-has-2-parts-a-generator-and-a-discriminator">A GAN has 2 parts: A generator and a discriminator.</h3>
<ul>
<li><p>The generator generates images(in this case) and the discriminator tries to identify if the images made by the generator are real or fake. </p>
</li>
<li><p>Essentially putting 2 neural networks in a fight against each other. </p>
</li>
</ul>
<h3 id="lets-understand-it-better-through-this-example">Let's understand it better through this example:</h3>
<ul>
<li>We have a generator that generates images of a 10 dollar bill.</li>
</ul>
<p>Here are some of the rules:</p>
<ul>
<li><p>The discriminator tries to determine if it is fake or not.</p>
</li>
<li><p>For every image that it recognizes correctly whether it's fake or real, it receives a point.</p>
</li>
<li><p>A point is deducted for every mistake it makes.</p>
</li>
</ul>
<h4 id="the-first-few-images-which-are-generated-by-the-generator-are-very-obviously-fake">The first few images which are generated by the generator are very obviously fake</h4>
<p>The discriminator easily detects the fake photos generated by the generator.</p>
<p>Discriminator's Score: 1</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611595351873/UusTDka4h.png" alt="image.png" /></p>
<h4 id="now-the-generator-makes-an-image-that-is-slightly-less-fake-than-the-previous-ones">Now the generator makes an image that is slightly "less fake" than the previous ones.</h4>
<p>The discriminator still correctly detects that it is a fake but it's getting tougher every time.</p>
<p>Discriminator's Score: 2</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611595399375/3tHqD3FSB.png" alt="image.png" /></p>
<h4 id="now-the-generator-has-started-making-images-that-are-really-really-close-to-real-images">Now, the generator has started making images that are really <em> really </em> close to real images.</h4>
<p>(Notice that there is a small brown box on the left corner in the generated image as a defect)</p>
<p>The discriminator is fooled and it loses a point. 😢</p>
<p>Discriminator's Score: 1</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611595428794/hNReFqbfl.png" alt="image.png" /></p>
<p>The discriminator realizes that it has made a mistake and learns from it. This process continues and the discriminator learns and improves after every iteration.</p>
<p>GANs can also be applied in NLP (Natural Language Processing).</p>
<blockquote>
<p>In fact, that is how GPT-3, one of the world's largest neural networks, was trained on text data.</p>
</blockquote>
<h3 id="conclusion">Conclusion</h3>
<p>If you liked this blog post then share it with your friends who might find this useful.</p>
<p>I'm planning on exploring more topics in machine learning like image augmentation, CNNs using through these blog posts.</p>
<p>Keep Learning!</p>
]]></content:encoded></item><item><title><![CDATA[A beginner-friendly Introduction to Linear Algebra for Machine Learning.]]></title><description><![CDATA[One of the topics in math that you'll find in machine learning courses as a pre-requisite is Linear Algebra. 
What is 'Linear Algebra' and how is it used in machine learning?
We'll answer just that in this blog post.
Prerequisites to follow along: No...]]></description><link>https://hashnode.prathamprasoon.com/a-beginner-friendly-introduction-to-linear-algebra-for-machine-learning</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/a-beginner-friendly-introduction-to-linear-algebra-for-machine-learning</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[Python]]></category><category><![CDATA[Data Science]]></category><category><![CDATA[Mathematics]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Sun, 24 Jan 2021 07:34:34 GMT</pubDate><content:encoded><![CDATA[<p>One of the topics in math that you'll find in machine learning courses as a pre-requisite is <strong>Linear Algebra</strong>. </p>
<p>What is 'Linear Algebra' and how is it used in machine learning?
We'll answer just that in this blog post.</p>
<p>Prerequisites to follow along: None.</p>
<h3 id="the-matrix">The Matrix</h3>
<p>This is the heart of Linear Algebra. </p>
<p>A matrix is essentially a bunch of numbers stored between 2 brackets in a tabular manner.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611472884113/vA7tC2UwW.png" alt="image.png" /></p>
<h3 id="what-could-these-numbers-in-the-matrix-be">What could these numbers in the matrix be?</h3>
<p>Here are a couple of examples👇</p>
<ul>
<li>Pixels in an image</li>
</ul>
<p>Left is an image of '8' and on the right is a matrix showing the numerical values of each pixel (black-0, white-255).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611472933323/lBQ14ADv5.png" alt="image.png" /></p>
<ul>
<li>Tabular Data from an excel sheet.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611472959029/UA2M_yM_G.png" alt="image.png" /></li>
</ul>
<h3 id="we-represent-matricesplural-for-a-matrix-in-python-using-a-lol-list-of-lists">We represent matrices(plural for a matrix) in Python using a LoL (List of Lists).</h3>
<pre><code class="lang-py">matrix = [[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>],
          [<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>],
          [<span class="hljs-number">7</span>,<span class="hljs-number">8</span>,<span class="hljs-number">9</span>]]
</code></pre>
<h3 id="the-below-picture-shows-the-mathematical-notation-for-writing-matrices">The below picture shows the mathematical notation for writing matrices.</h3>
<blockquote>
<p>'i' denotes the number of terms on the Y-axis and 'j' denotes the number of terms on the X-Axis in the Matrix.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611473057602/-fKqM4dV9.png" alt="image.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611473060199/F77jxsZvo.png" alt="image.png" /></p>
<h3 id="transpose-of-a-matrix">Transpose of a Matrix</h3>
<p>'Transpose' is one way to transform a matrix
Imagine you have an imaginary line going from the top-left corner of the matrix to the bottom right, and then you interchange the opposite values.</p>
<p>The matrix you get after switching the values is the transpose of the matrix.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611473107001/byRzMKWd_.png" alt="image.png" /></p>
<p>Think of a transpose as flipping the matrix along the red line. </p>
<blockquote>
<p>In mathematical notation, a transpose is denoted by a small 'T' at the top of the letter that was originally assigned to the matrix.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611473186388/hVpfWjtLW.png" alt="image.png" /></p>
<h3 id="identity-matrix">Identity Matrix</h3>
<p>There is a special type of matrix called the 'identity' matrix.</p>
<p>They look like this (basically the top-left to bottom-right diagonal consists of 1s and the other values are 0s.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611473308653/NvpH-NmLn.png" alt="image.png" /></p>
<h3 id="adding-subtracting-and-multiplying-matrices">Adding, Subtracting and Multiplying matrices</h3>
<p>We can also add, subtract or multiply matrices.</p>
<p>Adding and subtracting matrices is as simple as adding/subtracting the corresponding values of the matrices.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611473378806/MXRTdlcnO.png" alt="image.png" /></p>
<p>On the other hand, multiplying matrices is a bit tricky.</p>
<p>It looks somewhat like this👇</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611473416267/IWDwwW265.png" alt="image.png" /></p>
<p>It probably doesn't make sense, which is why you should look at this <a target="_blank" href="http://mathsisfun.com/algebra/matrix-multiplying.html">site.</a> </p>
<h3 id="but-why-is-linear-algebra-important-in-machine-learning">But, why is Linear Algebra important in Machine Learning?</h3>
<p>Let's say we want to make a machine learning model that can recognize numbers in a given image.</p>
<p>We can't just give this image to a computer and ask "Hey, what number is in this image?"</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611480262046/-cGZIXYfz.png" alt="image.png" /></p>
<p>We need to convert that image into something that a computer can understand, like a LoL (List of Lists 😉) which is a representation of a matrix in Python.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611480290339/-NPkLxCuA.png" alt="image.png" /></p>
<blockquote>
<p>Many times we need to transform this matrix in a way that our machine learning model wants it to be.</p>
</blockquote>
<p>It could be a transpose, addition, or multiplication but I won't get into the specifics of it.</p>
<h3 id="another-thing-that-you-must-know-about-is-the-difference-between-a-scalar-vector-and-matrix">Another thing that you must know about is the difference between a Scalar, Vector, and Matrix.</h3>
<ul>
<li><p>Scalar: Just a number</p>
</li>
<li><p>Vector: A row or column of numbers between brackets</p>
</li>
<li><p>Matrix: Numbers in a tabular form between brackets with multiple rows and columns.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1611562534952/IVqaa8SBm.png" alt="image.png" /></p>
<h3 id="concluding-thoughts">Concluding thoughts</h3>
<p>Of course, this isn't everything and there are many, <em>many more </em> concepts in linear algebra used for machine learning.</p>
<p>However, this blog post covers a lot of the basics of Linear Algebra that you'll need for machine learning.</p>
<p>If you liked this blog post then share it with others so that they can benefit from it.
I am planning to make a similar blog post for calculus and I'd love to hear your thoughts in the replies.</p>
<p>Keep Learning! 💪</p>
]]></content:encoded></item><item><title><![CDATA[A step-by-step guide on getting started with Python as a total beginner.]]></title><description><![CDATA[Before we begin, I want to congratulate you on your decision to learn how to code using Python.
I still remember how I wrote my first piece of code 6 years and all the amazing and cool things I've been able to do with it ever since.
Make sure to keep...]]></description><link>https://hashnode.prathamprasoon.com/a-step-by-step-guide-on-getting-started-with-python-as-a-total-beginner</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/a-step-by-step-guide-on-getting-started-with-python-as-a-total-beginner</guid><category><![CDATA[Python]]></category><category><![CDATA[Machine Learning]]></category><category><![CDATA[100DaysOfCode]]></category><category><![CDATA[#codenewbies]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Mon, 18 Jan 2021 19:19:17 GMT</pubDate><content:encoded><![CDATA[<p>Before we begin, I want to congratulate you on your decision to learn how to code using Python.</p>
<p>I still remember how I wrote my first piece of code 6 years and all the amazing and cool things I've been able to do with it ever since.</p>
<p>Make sure to keep in mind that it is probably best for you to keep your expectations in check. </p>
<p>Don't expect to make AAA games or state of the art machine learning models in a week.</p>
<p>Programming is not something that you can learn in a single week, it takes consistent effort and dedication over time to get good at it.</p>
<p>With all that being said, let's dive straight in.</p>
<p>In order to write Python code, you'll need to install <a target="_blank" href="http://python.org/downloads/">Python</a> on your system.</p>
<p>Linux and macOS users can skip this step because they come pre-installed with Python.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1610889808355/NveNVlgPH.png" alt="image.png" /></p>
<p>Click on the .exe file and follow the instructions. </p>
<p>Make sure to Add python to path by checking this option 👇
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1610889839300/n4V9WgBW6d.png" alt="image.png" /></p>
<p>Now you need to install a place where you can write your Python code, just like how you write your essays in Word or Google docs.</p>
<p>We'll be installing VS-Code, one of the best code editors out there and it's free!</p>
<p>Fortunately, Microsoft has this wonderful <a target="_blank" href="http://code.visualstudio.com/docs/python/python-tutorial">guide</a> that'll help you out.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1610889875324/e4qY0b1n_.png" alt="image.png" /></p>
<p>In case you are unable to set up Python on your own system then I recommend using <a target="_blank" href="http://repl.it/languages/python3">repl</a>, a great way to write and run Python code without any hassle.</p>
<p>Here are the topics you should be focusing</p>
<ul>
<li>Printing statements</li>
<li>Variables</li>
<li>Operators</li>
<li>Conditions</li>
<li>Functions</li>
<li>Loops </li>
</ul>
<p>Let's take a closer look.</p>
<h3 id="printing-statements">Printing statements</h3>
<p>You can 'print' or output in Python using the print() function.</p>
<p>print('Hello World') will give you an output of <code>Hello World</code></p>
<h3 id="variables">Variables</h3>
<p>These store certain values that can change.</p>
<p>For example, You can declare a variable 'x' with a certain value.</p>
<pre><code class="lang-py">x = <span class="hljs-number">9</span>  <span class="hljs-comment">#Here 9 is assigned to variable x</span>
y = <span class="hljs-string">'Hello World'</span> <span class="hljs-comment">#'Hello World' is assigned to y</span>

x = <span class="hljs-number">8</span> <span class="hljs-comment">#x has been updated to a new value which is 8</span>
</code></pre>
<h3 id="operators">Operators</h3>
<p>These carry out arithmetic operations in Python</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1610890100748/Crjp6enXY.png" alt="image.png" /></p>
<h3 id="conditions">Conditions</h3>
<p>They look like this 👇</p>
<pre><code>a = <span class="hljs-number">33</span>
b = <span class="hljs-number">200</span>
<span class="hljs-keyword">if</span> b &gt; a:
  print(<span class="hljs-string">"b is greater than a"</span>)
<span class="hljs-keyword">else</span>:
  <span class="hljs-keyword">pass</span>
</code></pre><p>Think of it as telling Python to do something based on conditions: if this is true, do this; else do something different.</p>
<h3 id="functions">Functions</h3>
<p>These are basically blocks of code that can be run when you call them. This helps us write code more efficiently.</p>
<p>In Python, you can make functions using the def keyword.</p>
<pre><code><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">myFunction</span>():</span>
  print(<span class="hljs-string">"Hello"</span>)
myFunction()
</code></pre><h3 id="loops">Loops</h3>
<p>These essentially run a piece of code over and over again until a certain condition is met.</p>
<p>There are 2 types of loops in Python: </p>
<ul>
<li>While loops</li>
<li>For loops</li>
</ul>
<p>Let's take a look at them.</p>
<h3 id="heres-what-while-loops-look-like">Here's what While Loops look like.</h3>
<pre><code>i = <span class="hljs-number">1</span>
<span class="hljs-keyword">while</span> i &lt; <span class="hljs-number">6</span>: <span class="hljs-comment">//While i is less than 6</span>
  <span class="hljs-keyword">print</span>(i) <span class="hljs-comment">// do </span>
  i += <span class="hljs-number">1</span> <span class="hljs-comment">//this</span>
</code></pre><p>The output is :</p>
<pre><code><span class="hljs-number">1</span>
<span class="hljs-number">2</span>
<span class="hljs-number">3</span>
<span class="hljs-number">4</span>
<span class="hljs-number">5</span>
</code></pre><p>Here's a For loop</p>
<pre><code>fruits = [<span class="hljs-string">"apple"</span>, <span class="hljs-string">"banana"</span>, <span class="hljs-string">"cherry"</span>]
<span class="hljs-keyword">for</span> fruit <span class="hljs-keyword">in</span> fruits:
  print(x)
</code></pre><p>The output:</p>
<pre><code><span class="hljs-attribute">apple</span>
banana
cherry
</code></pre><p>The for loops can be a bit tricky to understand, let me try to break it down for you.</p>
<p>'fruit' is the above loop is a temporary variable. It gets a value from the list called 'fruits' starting from "apple" then to "banana" and then "cherry".</p>
<p>All that I explained before was to give you a taste of the basics of Python, having strong fundamentals at this stage is very important.</p>
<p>These are some of the resources I would recommend to you for further learning👇</p>
<p>Programmiz Text-based Python Tutorials</p>
<p>Objected Oriented Programming (advanced) : 
%[http://youtube.com/watch?v=MikphENIrOo]</p>
<p>This course on Traversy Media's channel is a great next step for taking your python skills to the next level! </p>
<p>Python Documentation: http://docs.python.org/3/</p>
<p>This is probably the most underrated resource for learning python.</p>
]]></content:encoded></item><item><title><![CDATA[You don't need to know complex math to get started with machine learning!]]></title><description><![CDATA[There is a common misconception about machine learning that one needs to know a lot of math to get started with it.
However this is completely false!
You can pick the up the math as you go deeper into machine learning and one can comfortably start ma...]]></description><link>https://hashnode.prathamprasoon.com/you-dont-need-to-know-complex-math-to-get-started-with-machine-learning</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/you-dont-need-to-know-complex-math-to-get-started-with-machine-learning</guid><category><![CDATA[100DaysOfCode]]></category><category><![CDATA[Machine Learning]]></category><category><![CDATA[Data Science]]></category><category><![CDATA[Python]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Fri, 20 Nov 2020 10:12:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1605866724423/QUooZsd2Vi.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There is a common misconception about machine learning that one needs to know a lot of math to get started with it.</p>
<h2 id="however-this-is-completely-false">However this is completely false!</h2>
<p>You can pick the up the math as you go deeper into machine learning and one can comfortably start machine learning without it.</p>
<hr />

<blockquote>
<p>The point of this blog post is to help you get started with machine learning, not to proclaim that math is not important. </p>
</blockquote>
<hr />

<p>For this exercise you'll have to know basic programming knowledge in Python, that's it!</p>
<h3 id="heres-what-we-are-going-to-solve">Here's what we are going to solve.</h3>
<p>We are given data in which we are given the number of flats in a house and its corresponding price. Like a house with one flat is worth 10000, and 20000 for a house with two flats.</p>
<p>We can clearly tell that the price of the house increases by 10000 per extra flat however our computer does not know this and we won't it tell it about this, it'll have to figure things out on its own 🤫</p>
<p>Here's the <a target="_blank" href="https://colab.research.google.com/drive/1FxSrY6hwdgszzNydyobTLsMyO0bfpiPs?usp=sharing">code</a></p>
<p>( The link opens in Google colab, an online editor wherein your code runs on google's servers, no setup for Python or Tensorflow required on your PC! )</p>
<p>Let's try to understand what is going on here.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1605866055867/dkMgYcbHf.png" alt="image.png" /></p>
<ul>
<li><p>We import TensorFlow and Keras which are frameworks for making neural nets</p>
</li>
<li><p>Our Neural Net: This is where all the magic happens, for this exercise we need only one neuron.</p>
</li>
</ul>
<h3 id="wait-what-is-a-neural-net">Wait! What is a neural net?</h3>
<p>Neural Networks are a digital imitation of the neurons you see in the human brain. </p>
<p>In these neural networks, data flows through them and each neuron (the circle) has a numerical value which will change.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1605866115256/FJtUSqD0q.png" alt="image.png" /></p>
<p>The value of a neuron gets changes to something which is close to what we want each time the data passes through the neural network. </p>
<p>Think of the neurons as dials on a lock, you have to tune every dial to open the lock.</p>
<p>It is almost impossible for a human to tune thousands of dials like these, but a computer certainly can.</p>
<p>Once the dials are well tuned, you have a well trained neural network!</p>
<p>In this case we'll be able to predict the prices of houses based on how many flats they have.</p>
<p>Let's move on.</p>
<ul>
<li><p>Now we pass the data (flats and prices) through our neural network 500 times. (these loops are called epochs)</p>
</li>
<li><p>Finally,we predict what the price of a house with 10 flats. (we should get something around 100,000)</p>
</li>
</ul>
<p>And that's it! 
It was that easy.</p>
<p>Did we use any complex math? 
No!</p>
<p>This proves that you can get started with machine learning without any math.</p>
<p>What excuses do you have now?</p>
]]></content:encoded></item><item><title><![CDATA[The beginner's guide to the math for machine learning]]></title><description><![CDATA[The math for machine learning always scared me.
Until...
This year when I across these free resources which helped me in a massive way!
Here's everything you need to know about math for machine learning and resources that you can learn from.
Before d...]]></description><link>https://hashnode.prathamprasoon.com/the-beginners-guide-to-the-math-for-machine-learning</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/the-beginners-guide-to-the-math-for-machine-learning</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[100DaysOfCode]]></category><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[Python]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Sun, 15 Nov 2020 13:12:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1605445072823/WDbupLlln.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="the-math-for-machine-learning-always-scared-me">The math for machine learning always scared me.</h3>
<p>Until...</p>
<p>This year when I across these free resources which helped me in a massive way!</p>
<p>Here's everything you need to know about math for machine learning and resources that you can learn from.</p>
<h3 id="before-diving-into-the-math-i-suggest-first-having-solid-programming-skills">Before diving into the math, I suggest first having solid programming skills.</h3>
<p>In Python, these are the concepts which you must know:</p>
<ul>
<li>Object oriented programming in Python : Classes, Objects, Methods</li>
<li>List slicing</li>
<li>String formatting</li>
<li>Dictionaries &amp; Tuples</li>
<li>Basic terminal commands</li>
<li>Exception handling </li>
</ul>
<p>If you want to learn these concepts for python, these courses are freecodecamp could be of help to you.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=rfscVS0vtbw">https://www.youtube.com/watch?v=rfscVS0vtbw</a></div>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=HGOBQPFzWKo">https://www.youtube.com/watch?v=HGOBQPFzWKo</a></div>
<p>You need to have really strong fundamentals in programming, because machine learning involves a lot of it.</p>
<h3 id="it-is-100-compulsory">It is 100% compulsory.</h3>
<h3 id="another-question-that-i-get-asked-quite-often-is-when-do-should-you-even-start-learning-the-math-for-machine-learning">Another question that I get asked quite often is when do should you even start learning the math for machine learning?</h3>
<p>Math for machine learning should come after you have worked on some projects, doesn't have to a complex one at all, but one that gives you a taste of how machine learning works in the real world. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1605445315586/_0GKCNj1_.png" alt="image.png" />
Here's how I do it, I look at the math when I have a need for it.</p>
<p>For instance I was recently competing in a kaggle challenge. </p>
<p>I was brainstorming about which activation function to use in a part of my neural net, I looked up the math behind each activation function and this helped me to choose the right one.</p>
<h3 id="one-more-thing-before-we-look-into-the-resources-i-highly-recommend-that-you-take-this-course">One more thing before we look into the resources, I highly recommend that you take this course.</h3>
<p>It goes over machine learning without any of the math, this will get you more comfortable with machine learning.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=_Z9TRANg4c0">https://www.youtube.com/watch?v=_Z9TRANg4c0</a></div>
<p>The topics of math you'll have to focus on</p>
<ul>
<li>Linear Algebra</li>
<li>Calculus</li>
<li>Trigonometry</li>
<li>Algebra</li>
<li>Statistics</li>
<li>Probability</li>
</ul>
<h3 id="now-here-are-the-math-resources-and-a-brief-description-about-them">Now here are the math resources and a brief description about them.</h3>
<h2 id="neural-networks">Neural Networks</h2>
<blockquote>
<p>A series of videos that go over how neural networks work with approach visual, must watch.</p>
</blockquote>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=aircAruvnKk&amp;list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi">https://www.youtube.com/watch?v=aircAruvnKk&amp;list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi</a></div>
<h2 id="seeing-theory">Seeing Theory</h2>
<blockquote>
<p>This website gives you an interactive to learn statistics and probability</p>
</blockquote>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://seeing-theory.brown.edu/basic-probability/index.html">https://seeing-theory.brown.edu/basic-probability/index.html</a></div>
<h2 id="gilbert-strang-lectures-on-linear-algebra-mit">Gilbert Strang lectures on Linear Algebra (MIT)</h2>
<blockquote>
<p>They're 15 years old but still 100% relevant today!
Despite the fact these lectures are for freshman college students ,I found it very easy to follow👌</p>
</blockquote>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/playlist?list=PL49CF3715CB9EF31D">https://www.youtube.com/playlist?list=PL49CF3715CB9EF31D</a></div>
<h2 id="essence-of-linear-algebra">Essence of Linear Algebra</h2>
<blockquote>
<p>A beautifully crafted set of videos which teach you linear algebra through visualisations in an easy to digest manner
watch?</p>
</blockquote>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=fNk_zzaMoSs&amp;list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab">https://www.youtube.com/watch?v=fNk_zzaMoSs&amp;list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</a></div>
<p>Essence of calculus</p>
<blockquote>
<p>A beautiful series on calculus, makes everything seem super simple</p>
</blockquote>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=WUvTyaaNkzM&amp;list=PL0-GT3co4r2wlh6UHTUeQsrf3mlS2lk6x">https://www.youtube.com/watch?v=WUvTyaaNkzM&amp;list=PL0-GT3co4r2wlh6UHTUeQsrf3mlS2lk6x</a></div>
<p>The math for Machine learning e-book</p>
<blockquote>
<p>This is a book aimed for someone who knows quite a decent amount of high school math like trignometry, calculus, I suggest reading this after having the fundamentals down on khan academy.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1605445835537/XHQZ9O92b.png" alt="image.png" /></p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://mml-book.github.io/">https://mml-book.github.io/</a></div>
]]></content:encoded></item><item><title><![CDATA[How to get into Machine learning and Data Science as a JavaScript Developer?]]></title><description><![CDATA[Machine learning and Data Science are the most of the most exciting fields of computer science today. It has been around for quite a while but its relevance is still as high as ever. Here's how you can get into this field as a JavaScript developer wi...]]></description><link>https://hashnode.prathamprasoon.com/how-to-get-into-machine-learning-and-data-science-as-a-javascript-developer</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/how-to-get-into-machine-learning-and-data-science-as-a-javascript-developer</guid><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Sat, 03 Oct 2020 09:21:21 GMT</pubDate><content:encoded><![CDATA[<p>Machine learning and Data Science are the most of the most exciting fields of computer science today. It has been around for quite a while but its relevance is still as high as ever. Here's how you can get into this field as a JavaScript developer with not previous experience.</p>
<h2 id="contents">Contents</h2>
<ul>
<li>How does Ai work? </li>
<li>Tensorflow.js: What is it?</li>
<li>Deploying your Ai enabled App</li>
<li>Now what?</li>
</ul>
<h2 id="how-does-ai-work">How does Ai work?</h2>
<ul>
<li><p>In very simple terms, Ai learns through trial and error. It is given loads of data, which could be images, texts or even voice data.</p>
</li>
<li><p>The Neural Net recognises patterns in the data and learns from it. </p>
</li>
</ul>
<p>Let's understand with the help of an example.</p>
<p>Tom is a 3 year-old boy, he does not know the difference between a dog and a cat.
So we try to teach him what a dog looks like and what a cat looks like.
We have to stacks of images, one with cats and one with dogs.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1600537933398/gRhnoey1Z.png" alt="image.png" /></p>
<p>We show Tom pictures of dogs and cats and after he has learnt what they look like, we try to test how much he has learnt. </p>
<p>In order to learn the differences between the dogs and the cats he must have looked at the characteristics of them, for eg: Dogs are taller than Cats.</p>
<p>Let's say we asked him to identify 10 random images which have both cats and dogs(mixed), and he answers 8 correctly, he has a 80% accuracy.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1600537965170/EIAmKZUzP.png" alt="image.png" /></p>
<p>Now simply replace Tom with a computer and you have Machine Learning, incredibly easy to understand, isn't it?
This kind of Machine learning is called "Supervised learning".</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1600537990329/Gc9UEhIlt.png" alt="image.png" /></p>
<h2 id="what-is-tensorflowjs">What is TensorFlow.js</h2>
<p>Tensorflow.js is a Js library by Google which allows us to make Machine learning models(the thing we did above) for the the browser.All computations happen in the clients' browser this means your web app is 100% privacy friendly as no data is sent back.</p>
<p>The cool thing about TensorFlow.js is that you don't even need to train your own models to use Ai!
You can use pre-trained models which you can simply import in your project.
This is fine when you're starting out but it is recommended that you train you own models.</p>
<p>Now take a look at this tutorial: 
<a target="_blank" href="https://codelabs.developers.google.com/codelabs/tfjs-training-classfication/index.html#0">Google CodeLabs tutorial</a></p>
<h1 id="deploying-your-ai-enabled-app">Deploying your Ai enabled App</h1>
<p>Deploying a Tensorflow.js web app to the web is super simple. </p>
<ul>
<li><p>Push to a Github Repo and then import it in Vercel/Netlify, just like a normal website deployment.</p>
</li>
<li><p>Here's an Web App I made using Tfjs:
<a target="_blank" href="https://tfjsmnist.vercel.app">Digit Recognizer Using MNIST Dataset</a></p>
</li>
</ul>
<h1 id="conclusion">Conclusion</h1>
<p>In a future thread we'll a more in depth look on how a neural network works and some other concepts.</p>
<h3 id="finally-here-are-some-resources-you-can-take-a-look">Finally, here are some resources you can take a look:</h3>
<p><a target="_blank" href="https://www.coursera.org/learn/machine-learning">Machine Learning course by Andrew Ng</a></p>
<p><a target="_blank" href="https://www.youtube.com/watch?v=_Z9TRANg4c0&amp;t=1s">Google Tensorflow tutorial</a></p>
]]></content:encoded></item><item><title><![CDATA[7 Python Tricks And Tips You Must Know]]></title><description><![CDATA[Python is an incredibly versatile programming language, it has easy to understand syntax and mastering it takes significantly lesser effort than many other languages out there. Despite this ,even very experienced python developers do not know simple ...]]></description><link>https://hashnode.prathamprasoon.com/7-python-tricks-and-tips-you-must-know</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/7-python-tricks-and-tips-you-must-know</guid><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Thu, 10 Sep 2020 03:20:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1599541086138/nF6V8XH2t.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Python is an incredibly versatile programming language, it has easy to understand syntax and mastering it takes significantly lesser effort than many other languages out there. Despite this ,even very experienced python developers do not know simple tips and tricks which can be really useful at times. Here's a list of neat tips and tricks which you must know.</p>
<h2 id="1measure-time-taken-for-a-part-of-code-to-get-executed">1.Measure time taken for a part of code to get executed</h2>
<p>Sometimes, your application may be running slow and it can be really difficult to know what part of the code is causing the issue, to solve this you can look at the time taken by certain parts of the code by using this code snippet 👇</p>
<pre><code class="lang-py"><span class="hljs-keyword">import</span> time
startTime = time.time()

<span class="hljs-comment"># write your code or functions calls</span>

endTime = time.time()
totalTime = endTime - startTime

print(<span class="hljs-string">"Time taken to execute code= "</span>, totalTime)
</code></pre>
<h2 id="2view-the-memory-taken-by-an-object">2.View the memory taken by an Object</h2>
<p>In Python you can use the <code>sys.getsizeof</code> function to check the memory consumed by an object in python, like Lists, Tuples, Dictionaries etc.
Sometimes, it is good practice to check how much memory your data structure uses.</p>
<pre><code class="lang-py"><span class="hljs-keyword">import</span> sys

list1 = [<span class="hljs-string">'Value1'</span>, <span class="hljs-string">'Value2'</span>, <span class="hljs-string">'Value3'</span>]
print(<span class="hljs-string">"size of list = "</span>,sys.getsizeof(list1))
</code></pre>
<h2 id="3switch-the-values-of-2-variables-the-efficient-way">3.Switch the values of 2 variables: The efficient way</h2>
<p>🚫 Don't do this 👇</p>
<pre><code class="lang-py">a = <span class="hljs-number">10</span>
b = <span class="hljs-number">20</span>
a = b
b = c
c = a
print(a,b)
</code></pre>
<p>✅ Do this 👇</p>
<pre><code class="lang-py">a = <span class="hljs-number">10</span>
b = <span class="hljs-number">20</span>
a,b=b,a
print(a,b)
</code></pre>
<h2 id="4remove-duplicates-from-a-list">4.Remove duplicates from a list</h2>
<p>This is a neat trick, here we convert the list to a set.
Sets are unordered data-structures of unique values and don’t allow copies.</p>
<pre><code class="lang-py">listNumbers = [<span class="hljs-number">20</span>, <span class="hljs-number">22</span>, <span class="hljs-number">24</span>, <span class="hljs-number">26</span>, <span class="hljs-number">28</span>, <span class="hljs-number">28</span>, <span class="hljs-number">20</span>, <span class="hljs-number">30</span>, <span class="hljs-number">24</span>]
print(<span class="hljs-string">"Original List= "</span>, listNumbers)

listNumbers = list(set(listNumbers))
print(<span class="hljs-string">"After removing duplicate= "</span>, listNumbers)
</code></pre>
<h2 id="5combine-2-lists-to-form-a-dictionary">5.Combine 2 lists to form a dictionary</h2>
<p>Here we use the <code>zip</code> function to combine the 2 lists into a dictionary</p>
<pre><code class="lang-py">price = [<span class="hljs-number">54</span>, <span class="hljs-number">65</span>, <span class="hljs-number">76</span>]
names = [<span class="hljs-string">"Pizza"</span>, <span class="hljs-string">"Pasta"</span>, <span class="hljs-string">"Burger"</span>]

convertedDictionary = dict(zip(price, names))

print(convertedDictionary)
</code></pre>
<h2 id="6find-the-largest-and-smallest-values-from-a-list-of-numbers">6.Find the largest and smallest values from a list of numbers</h2>
<p>For extracting the largest and smallest values from a list, we can use the <code>min</code> and <code>max</code> functions.</p>
<pre><code class="lang-py">list = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>] 

smallest = min(list)
print(smallest)

largest = max(list)
print(largest)
</code></pre>
<h2 id="7list-comprehension">7.List comprehension</h2>
<p>Let's say you want to make a list with even numbers from 0-20.</p>
<p>The typical approach would be:</p>
<pre><code class="lang-py">A = [i <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(<span class="hljs-number">20</span>)]

B = [x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> A <span class="hljs-keyword">if</span> x%<span class="hljs-number">2</span> == <span class="hljs-number">0</span>]

<span class="hljs-keyword">print</span> (B)
</code></pre>
<p>The more efficient approach would be:</p>
<pre><code class="lang-py">A = [x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> range(<span class="hljs-number">20</span>) <span class="hljs-keyword">if</span> x%<span class="hljs-number">2</span> == <span class="hljs-number">0</span>]
print(A)
</code></pre>
<p>I hope you found these tips and tricks useful.</p>
<p>You can find me on Twitter <a target="_blank" href="https://twitter.com/PrasoonPratham">Here</a></p>
]]></content:encoded></item><item><title><![CDATA[5 Problems you may encounter as a code newbie and how to fix them.]]></title><description><![CDATA[Coding can be really tough when are just getting started, fortunately if you follow a few guidelines, it can turn into a pleasant experience.
In this blog I'll explain how to crush these problems which I faced too, like a pro! 
Without further ado, l...]]></description><link>https://hashnode.prathamprasoon.com/5-problems-you-may-encounter-as-a-code-newbie-and-how-to-fix-them</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/5-problems-you-may-encounter-as-a-code-newbie-and-how-to-fix-them</guid><category><![CDATA[freeCodeCamp.org]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[backend]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Fri, 04 Sep 2020 02:42:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1599190155663/JwtDl9Uhh.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="coding-can-be-really-tough-when-are-just-getting-started-fortunately-if-you-follow-a-few-guidelines-it-can-turn-into-a-pleasant-experience">Coding can be really tough when are just getting started, fortunately if you follow a few guidelines, it can turn into a pleasant experience.</h3>
<p>In this blog I'll explain how to crush these problems which I faced too, like a pro! 
Without further ado, let's begin:</p>
<h2 id="1-i-dont-know-where-to-start">1. I don't know where to start.</h2>
<h2 id="solution">Solution:</h2>
<p>Start from <a target="_blank" href="https://www.freecodecamp.org">FreeCodeCamp</a> 
Nothing else to say here</p>
<h2 id="2-problem-setting-up-the-environment-is-extremely-difficult">2. Problem: Setting up the environment is extremely difficult</h2>
<h2 id="solution-learn-about">Solution: Learn about</h2>
<ol>
<li>Using the command line interface : <ul>
<li><a target="_blank" href="https://youtu.be/yz7nYlnXLfE">Command Line Basics by FreeCodeCamp</a> </li>
</ul>
</li>
<li><p>System File structure : </p>
<ul>
<li><p><a target="_blank" href="https://www.youtube.com/watch?v=4xS5IOg_nDw">Windows File structure</a> </p>
</li>
<li><p><a target="_blank" href="https://youtu.be/roES8iAaJEM">Linux File structure</a> </p>
</li>
<li><p><a target="_blank" href="https://www.youtube.com/watch?v=2wcMyMml4jg">MacOS File structure</a> </p>
</li>
</ul>
</li>
<li><p>Json,Yaml files :</p>
<ul>
<li><p><a target="_blank" href="https://www.youtube.com/watch?v=cdLNKUoMc6c">Yaml explained</a> </p>
</li>
<li><p><a target="_blank" href="https://www.youtube.com/watch?v=wI1CWzNtE-M">Json explained</a> </p>
</li>
</ul>
</li>
<li><p>Add variables to PATH:</p>
<ul>
<li><p><a target="_blank" href="https://www.youtube.com/watch?v=JLjF75b-vMI">Linux &amp; MacOS</a> </p>
</li>
<li><p><a target="_blank" href="https://www.youtube.com/watch?v=4V14G5_CNGg">Windows</a> </p>
</li>
</ul>
</li>
<li><p>Learn to use package managers, like Pypi for Python, Npm for JavaScript, Flutter packages for you guessed it Flutter</p>
</li>
</ol>
<h2 id="3-problemyoure-unable-to-work-on-projects">3. Problem:You're unable to work on projects</h2>
<h2 id="solution">Solution:</h2>
<p>Your first project should be a simple one, if you still feel its overwhelming break your project into several smaller parts, then work on them, in case you still feel stuck, feel free to approach your friend google or the Twitter Dev community. Moreover you have hundreds of blog posts like these, put them to good use.</p>
<p>In addition to this, you may also get bugs
As a Dev you will encounter bugs, the best way to deal with them is to <strong>READ THE ERROR MESSAGE</strong>, usually it will point to a line in the file which will help you fix the bug pretty efficiently, if not search it up on google.</p>
<p>Here are a few tricks on searching things on google by <a target="_blank" href="https://twitter.com/frontenddude">@frontenddude</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1599188852031/zuDiizZ1q.jpeg" alt="1.jpeg" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1599188864799/EaSsWbVYG.jpeg" alt="2.jpeg" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1599189029814/TKnfUctXF.jpeg" alt="3.jpeg" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1599189058449/ZYMiwyv12.jpeg" alt="4.jpeg" /></p>
<h2 id="4-imposter-syndrome-lack-of-confidence">4. Imposter syndrome (Lack of confidence)</h2>
<h2 id="solution">Solution:</h2>
<p>Firstly, you should know that this is normal. Fix it by don't comparing yourself to others, everyone has different learning speed. </p>
<h2 id="5-i-feel-lazy">5. I feel lazy</h2>
<h2 id="solution">Solution:</h2>
<p>Take some time off, think about new ideas and how to execute, this often helps rejuvenate the mind and generally makes you more productive. Being in a good mental state for coding is important. </p>
<h2 id="conclusion">Conclusion</h2>
<p>Lastly, the bitter truth is that coding is tough, REALLY TOUGH. There are no 2 ways around it but if you have the passion and dedication then it is certainly possible to become a developer and you got this! </p>
<p>Wish you all the very best in your coding journey.</p>
]]></content:encoded></item><item><title><![CDATA[What teaching coding to 300 middle schoolers taught me.]]></title><description><![CDATA[For the past 3 months, I've worked with a team of 4 people to design a curriculum to help 300 middle schoolers start their coding journey. Most of them had little to no experience with programming.
We knew this was going to be a challenging task, but...]]></description><link>https://hashnode.prathamprasoon.com/what-teaching-coding-to-300-middle-schoolers-taught-me</link><guid isPermaLink="true">https://hashnode.prathamprasoon.com/what-teaching-coding-to-300-middle-schoolers-taught-me</guid><category><![CDATA[learn coding]]></category><category><![CDATA[python beginner]]></category><dc:creator><![CDATA[Pratham Prasoon]]></dc:creator><pubDate>Wed, 02 Sep 2020 03:51:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1599018800430/t5WB9APqY.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>For the past 3 months, I've worked with a team of 4 people to design a curriculum to help 300 middle schoolers start their coding journey. Most of them had little to no experience with programming.</p>
<h2 id="we-knew-this-was-going-to-be-a-challenging-task-but-we-were-certain-we-could-do-it">We knew this was going to be a challenging task, but we were certain we could do it.</h2>
<p>That is why we decided to teach them in a way which most programmers learn:</p>
<ol>
<li>The students would daily watch a video tutorial and follow instructions in it</li>
<li>They would then solve challenges curated by our team</li>
<li>Every weekend a doubt solving session was held wherein the concepts were quickly brushed upon and you guessed it, doubts were cleared</li>
</ol>
<p>Now here are my main takeaways:</p>
<h2 id="1-teaching-takes-patience-a-lot-of-patience">1. Teaching takes patience, A LOT OF PATIENCE!</h2>
<p>Especially younger students require spoon-feeding at times.
Resources which were given to them had to be boiled down enough for them to grasp it. </p>
<h2 id="2-having-clear-fundamentals-is-very-important">2. Having clear fundamentals is very important.</h2>
<p>Basic things like knowing what is an integer, string, variable etc. are very important, otherwise programming at a later stage becomes very difficult. </p>
<h2 id="3-you-must-keep-your-expectations-low-dont-expect-to-make-aaa-games-after-just-a-month-of-programming">3. You must keep your expectations low: Don't expect to make AAA games after just a month of programming.</h2>
<p>To put it bluntly, programming is very very tough.
Takes months of learning to get good at it and there is always something new to learn. </p>
<h2 id="4-having-smaller-more-achievable-goals-helps-in-learning-things-faster">4. Having smaller more achievable goals helps in learning things faster.</h2>
<p>This also makes you more confident. </p>
<h2 id="5-teach-your-students-how-to-ask-doubts-and-google-things">5. Teach your students how to ask doubts and google things</h2>
<p>Before asking doubts one must give a detailed explanation as to what they have tried and have they tried searching it up on the web?Bugs are inevitable and a coder must learn to google stuff when things don't work out </p>
<h2 id="conclusion">Conclusion</h2>
<p>All went well and in the end we were able to help all the students to get a feel for what programming feels, our goal was not make full-stack 12-year-old prodigies who work at Facebook but to get them excited about programming and I feel we achieved our goal very well.</p>
<p>Hope you found this post insightful.
Have an awesome day, Cheers.</p>
<p>Pictures from: <a target="_blank" href="https://www.unsplash.com">Unsplash</a></p>
]]></content:encoded></item></channel></rss>