<?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 alwaysLearning on Medium]]></title>
        <description><![CDATA[Stories by alwaysLearning on Medium]]></description>
        <link>https://medium.com/@rnmehta5?source=rss-1ce26bee35cc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by alwaysLearning on Medium</title>
            <link>https://medium.com/@rnmehta5?source=rss-1ce26bee35cc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 18 May 2026 11:40:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rnmehta5/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[Linear Regression]]></title>
            <link>https://medium.com/machine-learning-hands-on/eli5-f7bfa35d016a?source=rss-1ce26bee35cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7bfa35d016a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[beginner]]></category>
            <dc:creator><![CDATA[alwaysLearning]]></dc:creator>
            <pubDate>Fri, 23 Feb 2018 05:28:47 GMT</pubDate>
            <atom:updated>2018-02-23T18:13:45.816Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0oCUTSRaNopLwjb94VOSyg.png" /></figure><h4>ELI5</h4><p>In statistical terms, regression analysis is an experiment to see if the occurrence of one thing could be related to another (<a href="https://www.reddit.com/r/explainlikeimfive/comments/kgc0l/eli5_regression_analysis/">ELI5 reference</a>)</p><p>What is Linear regression then (ordinary least squares), in terms of what we use for ML: Linear regression is a method whereby calculating the distance of a lot of points from the mean, you can see how closely it fits a straight line (<a href="https://www.reddit.com/r/explainlikeimfive/comments/5gz20w/eli5_linear_regression/">ELI5 reference</a>)</p><h4>Detailed Learning Reference</h4><p>Regression is such an important topic to start building an intuition for ML that one should really spend time to get depth in this topic. I personally learned from 2 sources the first is the UW Applied ML course on Coursera, Prof. Emily Fox is simply excellent in explaining the intuition behind regression and dives deeper into individual aspects of linear regression including forming the cost function, trying to minimize it using the closed form solution, how this is not always feasible and how it can be approximated by gradient descent. Here is the <a href="https://www.coursera.org/learn/ml-regression/home/week/1">link</a>.</p><h4>My two cents</h4><p>Like we discussed in a previous post, an ML model is an assumption we make about how the world works or rather how the underlying system in the problem we are trying to solve works. Now assuming we have an input value x and the the output value y which we are trying to predict, y = f(x) + ϵ where f(x) is the model and, ϵ is the irreducible error. In the case of regression, specifically linear regression f(x) = mx + b + ϵ where m is the slope of the line and b is the bias term. Irreducible error is exactly what it sounds like, it cannot be completely eliminated by building better and better models. As a matter of fact if you fit a model which has 0 error it means you have overfit to the training data in hand and therefore the model will not be able to generalize well to new, unseen data. ϵ has some important properties, E[all ϵ across data] = 0 i.e. the error is equally likely to be +ve or negative (it has a zero mean) and therefore f(x) is equally likely to be above or below the actual y. The values for m and b which are also called coefficients are inferred over time by optimizing the cost function. here as we can see there is just one input feature i.e. x if we use multiple input features like f(x) = m1x1+m2x2+…+mnxn + b + ϵ it is called multiple linear regression. We can also apply functions to the input feature to modify to make the regression non-linear.</p><h4>So why not always use linear regression?</h4><p>well because it is wrong a lot of the time but it is still useful. As you can imagine not all relationships can be explained by fitting a straight line through the data. Well in that case we can apply a transformation to the input so that it can be a polynomial curve. However there is an issue with that too. the higher the degree of the polynomial, higher are the chances for overfitting. This also applies with higher number of features, especially in the case where the number of samples we have to train the model ‘n’ is not much larger than the number of feature or dimensions ‘d’. When this happens,the model can possibly learn each and every combination of the input and the corresponding output to provide a highly overfit model. This is a big problem! especially in the data age we live in, it’s very possible to have extremely high dimensional data. There is fortunately a way to handle this, this method is called regularization. It is one of the most powerful tools of machine learning which we will go over in the next post.</p><h4>Code Snippet</h4><p>SKlearn is an absolutely essential resource for ML problem solving be sure to learn and leverage it well. Below is a snippet which implements simple linear regression using SKLearn.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e145e0c97976d7ca43506960103b8f7/href">https://medium.com/media/1e145e0c97976d7ca43506960103b8f7/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7bfa35d016a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-hands-on/eli5-f7bfa35d016a">Linear Regression</a> was originally published in <a href="https://medium.com/machine-learning-hands-on">Machine Learning - hands On</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Format of Upcoming posts]]></title>
            <link>https://medium.com/machine-learning-hands-on/format-of-upcoming-posts-463644bfe55e?source=rss-1ce26bee35cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/463644bfe55e</guid>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[portfolio]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[alwaysLearning]]></dc:creator>
            <pubDate>Thu, 01 Feb 2018 18:57:47 GMT</pubDate>
            <atom:updated>2018-02-01T19:43:14.076Z</atom:updated>
            <content:encoded><![CDATA[<p>This is quick post to get your acquainted with the flow of problem solving I am going to be following in upcoming posts.</p><h4>Algorithm study format</h4><p>For this part, a big shout out to Siraj Raval and his video on <a href="https://www.youtube.com/watch?v=nxWfZP6eslM&amp;t=13s">learning advanced concepts</a> which helped me frame this story format.</p><p><strong>ELI 5</strong></p><p>With every post I will start with the best ELI5 comment to explain the concept discussed. What is ELI5? it’s basically “Explain to me like I am 5” its a <a href="https://www.reddit.com/r/explainlikeimfive/">subreddit</a> where you can find simple explanations for various concepts.</p><p><strong>A well explained tutorial</strong></p><p>Links to tutorials or videos I found helpful to understand this concept.</p><p><strong>Scientific Paper</strong></p><p>I will include this section for more algorithm related posts. Would recommend looking at this video about <a href="https://www.youtube.com/watch?v=SHTOI0KtZnU">how to read scientific papers</a> if you are new to this. Key takeaway: you’ll need a lot of coffee.</p><p><strong>Code Gist</strong></p><p>I’ll include a code snippet of how to use various ML libraries like SKlearn to use the algorithm to produce the desired output. what’s a gist? <a href="https://help.github.com/articles/about-gists/">check this out</a>.</p><p><strong>Link to solved problem</strong></p><p>This will be a link to Kaggle or Github kernel/repo where I have solved a relevant ML task using a publicly available dataset.</p><h4>Problem solving Format</h4><p>I have used a number of sources that I have leveraged for this, taking the best practices from each in order to come up with my own custom flow. Each problem is different in it’s own way so the steps may vary but the steps below are a good general guideline. I would highly recommend you go check the links below, they are very useful in coming up with your own flow:</p><ol><li>The ML Mastery post for working through data science problems — <a href="https://machinelearningmastery.com/process-for-working-through-machine-learning-problems/">https://machinelearningmastery.com/process-for-working-through-machine-learning-problems/</a> <strong>OR </strong><a href="https://machinelearningmastery.com/how-to-work-through-a-problem-like-a-data-scientist/">https://machinelearningmastery.com/how-to-work-through-a-problem-like-a-data-scientist/</a></li><li>Elite data science’s 7 day crash course to solving DS problems — <a href="https://elitedatascience.com/">https://elitedatascience.com/</a></li><li>KDnugget’s article — <a href="https://www.kdnuggets.com/2016/03/data-science-process-rediscovered.html">https://www.kdnuggets.com/2016/03/data-science-process-rediscovered.html</a></li><li>This is an excellent source with an actual solved example, highly recommend going through this code once you have read the theoretical example above — <a href="https://github.com/rhiever/Data-Analysis-and-Machine-Learning-Projects/blob/master/example-data-science-notebook/Example%20Machine%20Learning%20Notebook.ipynb">https://github.com/rhiever/Data-Analysis-and-Machine-Learning-Projects/blob/master/example-data-science-notebook/Example%20Machine%20Learning%20Notebook.ipynb</a></li></ol><p>To put my own concise version, this is what I generally do:</p><p>EDA =&gt;Data Cleaning=&gt;Feature Engineering=&gt;Model Selection=&gt;Model Training=&gt;Model Validation(&amp; hyper-parameter tuning)=&gt;Model Testing=&gt;REPEAT!</p><p>As I mentioned before, I am using this publication as a way to showcase what I have learnt so far and get feedback. I would highly recommend you start doing this as well, build your own portfolio start doing rather than just reading. Your portfolio doesn’t need to be public, although I personally found making posts public keeps me inspired to keep doing this week over week &amp; set deadlines.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=463644bfe55e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-hands-on/format-of-upcoming-posts-463644bfe55e">Format of Upcoming posts</a> was originally published in <a href="https://medium.com/machine-learning-hands-on">Machine Learning - hands On</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What a lot of ML models look like]]></title>
            <link>https://medium.com/machine-learning-hands-on/what-a-lot-of-ml-models-look-like-d3c3296ba567?source=rss-1ce26bee35cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3c3296ba567</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[alwaysLearning]]></dc:creator>
            <pubDate>Mon, 29 Jan 2018 01:14:16 GMT</pubDate>
            <atom:updated>2018-01-29T19:59:49.917Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lELlxK7QF6lKkvYeKezEhw.png" /></figure><p>The basic idea behind an ML algorithm is something that looks like this:</p><blockquote>answers = <em>f </em>( inputs ) + noise</blockquote><p>Where <em>f()</em> is the function which takes the input values and computes the output. Of course there are a number of things that need to happen in order for <em>f() </em>to function like a ML algorithm. for instance we need to make sure that the inputs are in a form that <em>f()</em> can interpret correctly. For instance, if you have a dataset to predict the mpg for a car and one of the inputs available is the make the car which is a string like “ford”, by itself it cannot be understood by the model. The required behavior of <em>f()</em> to transform the inputs to answers needs to be identified. We need to identify how to evaluate how well <em>f()</em> is doing in its function of predicting the answers. The answering of all these questions is what building of an ML model entails.</p><p>Let’s start with a brief intro into what a lot of “supervised” learning models look like (more on what supervised means in a bit).</p><h4><strong>Notation &amp; Terminology</strong></h4><p>A few notations to keep in mind before you get to the figure below. <strong>X is the inputs</strong> we have from the data we are working with, it is also <strong>called the independent variable(s) or features</strong>. So for instance we want to predict house prices, X can be the square footage of the house or the number of bedrooms it has, etc. the answer in this example is the house prices we are trying to predict, the <strong>answer is denoted by y </strong>it is also called the <strong>target variable or the dependent variable</strong>. So, why is X capitalized and y is not? good question, because X would be a matrix in this example whereas y is a single columned vector, more on this soon, promise. <strong>y-hat are the answers produced by running our ML model</strong> in the dotted block below. Now that we have some basic notation out of the way let’s get into what the diagram below does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7vpCW-gzOxdY1874ckXSiA.png" /></figure><p>As we can see above, the ML model takes processed data it gives it to some function <em>f()</em> which is basically the ML model block in the figure above and that block produces outputs for this iteration. The really cool thing here is that the behavior of this model is learnt using the y-hat produced evaluated against the y which was observed, in case of supervised learning. The evaluation produces the error i.e. the difference between the observed value of y i.e. the calculated values y-hat.</p><h3><strong>Kind of ML Models</strong></h3><p>I have used the word supervised learning a bunch of times up above so let me give you a quick tour of kind of ML models or kinds of learning tasks. Most ML models can classified into the following type of problems</p><ol><li><strong>Supervised learning</strong></li></ol><p>This is a kind of model or learning task where you have input data and the corresponding observed answers for that data. This model takes the data inputs and its outputs and learns to make generalizations. These generalizations can then produce answers for any new data. So for instance you can have a bunch of emails and a label for each indicating if the email is spam or not. A supervised learning model can be fit to this and can after training predict if any new email it comes across is spam or not. Regression and classification fall into this kind of learning tasks</p><p><strong>2. Unsupervised learning</strong></p><p>This is the kind of modeling task where the input data is not labeled. It does not have answers for observed values. In a lot of cases in this kind of a learning task you may not even know what answer you want, it may just be to get a the data’s underlying structure i.e perform automatic analysis. Clustering is this kind of a task. An example is you have a bunch of research papers and you want to find which ones are similar but these “types” which define similarity of documents may not be predefined. In this kind of a model, the line for y which goes into the evaluation box in the figure above would not exist. the evaluation is done using just the input data and the current version of the output.</p><p><strong>3. Semi Supervised learning</strong></p><p>This task is quite similar to supervised learning except all the answers or observed values for the target variable are not available, some are some aren’t. Some of these target variables are basically inferred from the observed data.</p><p>Hope this has been helpful so far. Starting next week I will be going into supervised learning, specifically regression. I will also be publishing one extra post in the middle of this week going over ML problem solving methodology I use and the format of the posts to follow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3c3296ba567" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-hands-on/what-a-lot-of-ml-models-look-like-d3c3296ba567">What a lot of ML models look like</a> was originally published in <a href="https://medium.com/machine-learning-hands-on">Machine Learning - hands On</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Welcome]]></title>
            <link>https://medium.com/machine-learning-hands-on/welcome-2a68a0e965ab?source=rss-1ce26bee35cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a68a0e965ab</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[alwaysLearning]]></dc:creator>
            <pubDate>Mon, 22 Jan 2018 00:36:39 GMT</pubDate>
            <atom:updated>2018-03-05T05:34:36.781Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jCg8zKtaS8n13W1MAZqBGg.png" /></figure><p>Hello and welcome to Machine Learning — hands on. This is a place where I will be sharing my journey of learning and developing skills in the field by sharing the inner working &amp; logic of ML algorithms in a less opaque and a more applicable manner, as well as applying them to actual datasets. I am by no means and expert, so <em>feedback is always welcome &amp; appreciated</em>. This is a part portfolio part tutorial kind of a publication and I hope I can get some feedback from folks already in the field as well as help other learners in their path to ML.</p><p>I will be starting with explaining ML algorithms in a particular problem type e.g. Classification, Regression, Clustering etc. perhaps 3–4 algorithms per post. This will be followed by an application post where I will apply the algorithm to a data set. I will also be providing references from which I learned these techniques. The code shared in subsequent posts will be available on <a href="https://github.com/riddhinm5">github</a>.</p><p>To start with let me list the key learning resources I have leveraged so far. I have taken the 4 part University of Washington ML MooC<a href="https://www.coursera.org/specializations/machine-learning">[1]</a> which covers ML application as a black box, followed by a course on Regression, Classification and Clustering. I worked through every programming assignment which actually implements the various ML algorithms. I highly recommend it! I also follow the ML Mastery blog<a href="https://machinelearningmastery.com/">[2]</a>, again highly recommended, it has nudged me in this direction by providing a very well defined path to self learning and constant practice. I also leverage kaggle<a href="https://www.kaggle.com/rnmehta5">[3]</a> which is a really good resource for datasets and provides access a huge community of data scientists, ML engineers and fellow learners.</p><p>With this, let’s get started. I expect to publish a post every other Sunday, so look out for new posts then!</p><h3>Warm-up</h3><p>What is machine learning. There are a number of definitions out there, the most famous one being:</p><blockquote>“A computer program is said to learn from experience <em>E</em> with respect to some class of tasks <em>T</em> and performance measure <em>P</em> if its performance at tasks in <em>T</em>, as measured by <em>P</em>, improves with experience <em>E</em>.”</blockquote><blockquote>— Tom E. Mitchell</blockquote><p>To put it in a context which is less textbook definition-y, and more related to modern applications in say an app: machine learning is a method by which you don’t need to hard code the program or code out each and every instance to return certain answers based on certain situations. Because there can be infinitely large possible actions from an infinitely large number trigger situations which cannot be programmed.</p><p>Say for instance you wanted to make an Amazon Alexa clone, a smart assistant who can answer questions based on your verbal inquiries. Everyone has a slightly different way of phrasing what they want, for instance asking for the news. I can say “Alexa what’s in the news?” where as my brother can say “Alexa what’s the latest news for today?” both there are completely different strings but they’re asking the same question. For the underlying program of the Amazon Alexa to take this pattern of strings and to generalize that the user is asking for the news is what Machine learning does. It takes some data and generalizes for the future. This kind of a way to “learn” is also called <strong>induction learning</strong><a href="https://machinelearningmastery.com/data-learning-and-modeling/">[4]</a><strong>. </strong>What induction learning does is it takes some instances of the data (getting all the possible data for a particular problem is not possible, but we are getting ahead of ourselves here) and to generalize that like, given this kind of data x I will make a decision y. It’s not unlink a child learning something. For instance say you have a teapot, the child touches is once is quickly struck by how hot it is. The next time the child will not touch the teapot simply because from it’s last experience it knows the teapot could be hot. This may not be the case, the teapot can be at room temperature but the child has made a generalization that the teapot would be hot. This error in judgement because of prior experience is the child’s “bias”. The same phenomenon occurs for a ML algorithm, the generalizations made the ML algorithm based on the data it learnt from is errored, it has to be, it’s a generalization. If it answers every trigger situation x with the exact answer y, it is “over-fitting” it will not be able to answer correctly is a slightly different x shows up in new data for which solution is not y. There is another aspect to the ML algorithm and that is its “variance”. This is the measure of how much the answers vary depending on different values of x. In other words how much the behaviour of the baby is different based on different teapots it sees. One of the key challenges in “fitting” a ML model is this whole aspect of “bias-variance tradeoff”. It is really well explained by Scott Fortmann-Roe in his post regarding this subject<a href="http://scott.fortmann-roe.com/docs/BiasVariance.html">[5]</a> and the bullseye illustration from his post is very useful to get a feel for this concept.</p><p>Hope this is good enough intuition to get started in understanding what ML is. Why we want to use it and what are some of the things to keep in mind. See you next week, I will be going into the topic of the “blueprint of ML algorithms”.</p><p>References:</p><ol><li>University of Washington, ML Specialization: <a href="https://www.coursera.org/specializations/machine-learning">https://www.coursera.org/specializations/machine-learning</a></li><li>Machine Learning Mastery blog: <a href="https://machinelearningmastery.com/">https://machinelearningmastery.com</a>/</li><li>Kaggle profile: <a href="https://www.kaggle.com/rnmehta5">https://www.kaggle.com/rnmehta5</a></li><li>data, learning and modeling, Jason Brownlee <a href="https://machinelearningmastery.com/data-learning-and-modeling/">https://machinelearningmastery.com/data-learning-and-modeling/</a></li><li>Understanding the bias-variance tradeoff, Scott Fortmann-Roe <a href="http://scott.fortmann-roe.com/docs/BiasVariance.html">http://scott.fortmann-roe.com/docs/BiasVariance.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a68a0e965ab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-hands-on/welcome-2a68a0e965ab">Welcome</a> was originally published in <a href="https://medium.com/machine-learning-hands-on">Machine Learning - hands On</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>