<?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 sai harini on Medium]]></title>
        <description><![CDATA[Stories by sai harini on Medium]]></description>
        <link>https://medium.com/@saiharinivoruganti?source=rss-76aa6113f684------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bHVIXux55EK349Sn.</url>
            <title>Stories by sai harini on Medium</title>
            <link>https://medium.com/@saiharinivoruganti?source=rss-76aa6113f684------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 19 May 2026 12:10:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saiharinivoruganti/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[Machine Learning — I]]></title>
            <link>https://medium.com/@saiharinivoruganti/machine-learning-i-c2fda75f8da7?source=rss-76aa6113f684------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2fda75f8da7</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[andrew-ng-course]]></category>
            <dc:creator><![CDATA[sai harini]]></dc:creator>
            <pubDate>Mon, 12 Feb 2018 16:59:49 GMT</pubDate>
            <atom:updated>2018-02-12T17:04:17.126Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>What is Machine Learning?</em></strong></p><p>A computer program learns from its experience E w.r.t task T and some performance measuer P, if its performance on T as measured by P, improves with experience E. — <em>Tom Mitchell</em></p><p>There are several types of learning algorithms. <em>Supervised Learning</em> and <em>Unsupervised Learning </em>are the 2 important types<em> </em><strong><em>. </em></strong>Others: Reinforcement learning, recommender systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9BqhG4nEQXFTp5CJyd7LSw.png" /></figure><p><strong><em>Supervised Learning :</em></strong></p><p>For example, if you want to sell a house, and have collected all the data about the size of the houses and their prices. Now you have a house with some S sqft and want to know what might be its cost in the market. So, in the available data you might either draw a straight line or a curve which passes through the maximum data points on the graph constructed by considering houses size on X axis and prices on Y axis. Now, you find out the price of your house of S sqft by extending it on to the line or the curve. So the term supervised learning refers to the fact that we gave the algorithm a dataset where the right answers are known. The above example is also a regression problem i.e. we are trying to predict a continuous value which is the price of the house. If we are trying to predict a discrete value, then it comes under classification problem.</p><p><strong><em>Unsupervised Learning :</em></strong></p><p>In unsupervised learning, given a dataset we are not told what class a particular data point belongs to. Instead we just tell the algorithm, here is the dataset, can you find some structure in the data. So the algorithm may cluster the data into some groups which are in some way similar. Ex: clustering is used is in google news. Google news looks at thousands of new stories on the web and groups them into cohesive stories. Another example is Cocktail party problem where 2 persons try to talk simultaneously and the algorithm separates their audio. The algorithm doesnt know which audio is what, but just finds out some similarities and separates them.</p><p><strong><em>Linear Regression :</em></strong></p><p>Generally, as already mentioned above, when we are trying to predict multiple class labels, it is called regression. We have a training dataset where the right answers are known and we try to fit the model with a straight line to identify the class label for a given set of attributes i.e. our job is to learn from the data on how to predict the value. let <strong>m </strong>be the number of training examples in the dataset. <strong>x </strong>be the input variables/features. <strong>y </strong>be the output variable/target variable. (<strong>x,y</strong>) to denote a single training example. (x^i,y^i) for ith training example. Generally we give our training data to the learning algorithm and its job is to come up with a function that is the hypothesis(h) which takes the input of the test example and gives the output of the predicted class. So h is a function tha maps from x’s to y’s. So how do we represent h? h(x)=theta0 + theta1*x. This predics y as a straight line function. This is linear regression with one variable which is x here. Also called as univariate Linear regression.</p><p><strong><em>Cost Function ( with Linear Regression example) :</em></strong></p><p>Cost function helps us to figure how to fit the best possible straight line to our data. theta0 , theta1 in the hypothesis function are the parameters. Lets see how to choose these parameters. We should comeup with the values such that the hypothesis fits the data. So we make sure that the h(x) is as close as possible to y for our training example (x,y). The equation in the below image is squared error cost function. We minimize the difference between the actual answer(y) to that of the calculated answer by h(x).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*UrqTZhqHfJ9X1Wu_DRhVUQ.jpeg" /></figure><p>An important point to remember is that the hypothesis is a function of x i.e with a constant theta, we calculate the expected output given an input value, where as a cost function is a function of theta where we have a different hypothesis for each theta. Our objective of linear regression is to minimize this cost function i.e finding a straight line that fits the data well. The output of the cost function is nothing but, if we choose this particular theta, how much are we far away from the actual answer. Now what we really want is an efficient algorithm that automatically calculates the thetas so that the cost function is minimum.</p><p><strong><em>Gradient descent :</em></strong></p><p>We have seen the cost function, now we will see gradient descent algorithm for minimizing the cost funtion J. This is not only used in linear regression, but is used for minimizing the cost function all over ML. Also, it not only minimizes cost function, it can minimize any function. The outline of this algorithm can be seen as 1. Start with some random thetas. 2. Start changing thetas to reduce J until we hopefully endup at a minimum. The algorithm is as follows: <strong>theta j = theta j - alpha * partial_derivative_of_J_wrt_theta_j</strong>. Do this for all the thetas and then update each one of them. This formula is repeated until convergence. Alpha is the learning rate which tells how big a step we take downhill with creating descent. So if alpha is v large, we take huge steps and if its v small then we take small baby steps down the hill. Gradient descent can converge even with constant learning rates because as we keep moving towards the local minima, the partial derivative value keep decreasing and so there is no need to decrease alpha over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HmvuG675QkrUxUn_VkiUSQ.png" /></figure><p>Also, for the cost function of linear regression, there is only one minima i.e. the local minima and the global minima are the same beacuse the cost function for linear regression is always bowl shaped. This algorithm we saw till now is called <strong>Batch </strong>Gradient descent. Here each step of gradient descent uses all training examples ( We do sigma till m. The above formula).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2fda75f8da7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>