<?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 Rucha Wete on Medium]]></title>
        <description><![CDATA[Stories by Rucha Wete on Medium]]></description>
        <link>https://medium.com/@rucha-wete?source=rss-21311bb50c5d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*h9LttIT-9lIHwEDTmRqlig.jpeg</url>
            <title>Stories by Rucha Wete on Medium</title>
            <link>https://medium.com/@rucha-wete?source=rss-21311bb50c5d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:15:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rucha-wete/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[Support Vector Machine]]></title>
            <link>https://rucha-wete.medium.com/support-vector-machine-828050dda6bb?source=rss-21311bb50c5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/828050dda6bb</guid>
            <category><![CDATA[support-vector-machine]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[svm]]></category>
            <category><![CDATA[machinelearningalgorithms]]></category>
            <dc:creator><![CDATA[Rucha Wete]]></dc:creator>
            <pubDate>Fri, 25 Jun 2021 10:24:01 GMT</pubDate>
            <atom:updated>2021-06-25T10:25:35.601Z</atom:updated>
            <content:encoded><![CDATA[<p>In machine learning, choosing the right classifier can be a challenging task. And it is hard to ignore Support Vector Machine when it comes to popular machine learning algorithms. It’s the ultimate weapon for complex problems with small data sets.</p><p>Basically, it is a supervised machine learning algorithm that can be used for classification as well as regression problems. Sounds cliche? Well, but what makes it better than other machine learning algorithms is its better accuracy with less computation power.</p><p>Now let us consider an example of binary classification. Let&#39;s say the red and blue circles represent examples of two different classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/0*yHUYK1MAtMzLXuBj.png" /></figure><p>A simple straight boundary would be enough to separate them, won’t it? But there are multiple such boundaries possible which can do this. But we need to find the one which does this most efficiently, that is the one which has the maximum distance from all the data points. This is basically what an SVM finds. It defines the best decision boundary or optimal hyperplane with maximum margin.</p><p>The dimension of the hyperplane depends on the number of features that we are dealing with. A dataset with two features will need a straight line as a hyperplane while a 3 feature dataset will require a plane as a hyperplane and so on. The data points are called the support vectors. These support vectors determine the position of the hyperplane.</p><p>Now let&#39;s see how an SVM actually accomplishes this.</p><p>Let&#39;s say we want our input to be classified into two classes, y = 0 and y = 1. After passing the data through all the functions, the output values can be ([-1,1]). which means if the output value is 1 then that example is classified into one class and if it&#39;s -1 then into another class.</p><p>The hyperplane needs to be farthest from all the support vectors for maximizing the margin. Now there is a function that measures how well the model does this for a given training data. This function is called a cost function. It can have various forms and constraints. For example, let&#39;s start with the following optimization function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*tRSTqj0LLjxTWqYb5eJyTw.png" /></figure><p>Seems complicated right? Let&#39;s look into it part by part.</p><ul><li>x⁽ᶦ⁾ represents the features of a particular dataset</li><li>C is a regularization parameter</li><li>θᵀ is simply the parameter whose value we are trying to calculate for maximizing our margin.</li></ul><p>Let&#39;s say when the output class y is zero. Then we will need θᵀx ≤ -1. The reverse will be true when the class of an example is 1 (y =1 will need θᵀx <strong>≥</strong>1). These will be our constraints.</p><p>The objective here is to simply minimize the cost function to zero. Once we have done that we can move on to the second optimization function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/144/1*kJq4vkVQuA4er3kPIxF_gw.png" /></figure><p>We will apply the same constraints here as we did in the first optimization function. Now when we minimize this as a function of parameter θ, we get the equation of the required hyperplane (decision boundary).</p><p>But is there something we missed?</p><p>Yes, the regularization parameter C. Now, what is its role? Let&#39;s consider an example where there might be some outlying support vectors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*7LkH27hcH6e66QpqHNkK1g.png" /></figure><p>Now if we set a very large value for C, then the SVM will end up having a decision boundary like the one in magenta instead of the one in black. But adjusting our classifier due to some outlying examples in data might not always be the right decision as it might end up reducing the margin and the accuracy that the model will give on the test data.</p><p>Well, this mishap can be avoided by setting a small value for C. But unfortunately, that doesn&#39;t entirely solve our problem. A too-small value of C would give a free pass to many violations in the classifier. Now even this would make our model less accurate, won’t it? So C is more like a tuning factor in SVM whose value decides how flexible or rigid our model will be and should be adjusted accordingly.</p><p>Now so far we have only discussed classification problems using linear hyperplanes. But what if our data set looks something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/0*AArZzvyYCZO45KOa.png" /></figure><p>Now a linear boundary surely cannot separate them. But adding additional features like x² can do the trick here. But it&#39;s not always practically feasible to manually select the features for complex nonlinear classifiers. But fortunately, the SVM algorithm provides us with techniques such as kernels that can do this job for us. Kernels do some complex data transformations which help to convert the linearly inseparable problems to separable problems for classifying the data into classes given by us.</p><p>There are different types of kernels like polynomial, Gaussian RBF, Laplace, etc. The type of kernel which we need to implement depends on the problem data set and the model which we aim to design.</p><p>Now SVM can seem more complex than simple ML classifiers like logistic regression. But there are many SVM software packages like liblinear, libsvm, etc which make this job easier for us. By just specifying the choice of kernel and regularization parameter C, we can get the optimized parameters and build an accurate classifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/0*wBxtYIkgb_hG3Ar9.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=828050dda6bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Neural Networks]]></title>
            <link>https://rucha-wete.medium.com/neural-networks-d538f3cfe50c?source=rss-21311bb50c5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d538f3cfe50c</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neural-network-algorithm]]></category>
            <dc:creator><![CDATA[Rucha Wete]]></dc:creator>
            <pubDate>Wed, 23 Jun 2021 08:30:19 GMT</pubDate>
            <atom:updated>2021-06-23T08:30:19.646Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*T8bjqQnUM4_7T7PT.png" /></figure><p>A neural network is simply an imitation of the human brain consisting of neurons which enable the learning of complex non-linear hypothesis in ML DL problems.</p><p>Other machine learning algorithms like linear regression or logistic regression become inefficient when we have to deal with huge data sets having thousands of features like those in computer vision. Also, the neural network being a relatively complex algorithm has an upper hand when it comes to non-linear fitting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xG-j2vn-CvcASW-m.JPG" /></figure><p>The human brain is like an unparalleled machine when it comes to learning and intelligence. In the human brain, the neurons take information from the axon terminal, process it, and then pass it onto the next neurons through the dendrites. A dense network of such neurons and their processing of information enables constitutes the working of the brain. Imitating this, the neural network consists of multiple layers having multiple nodes. These nodes take an input value, apply a non-linear function on it and then pass the value to the next layer.<br>There are three kinds of layers in a neural network :</p><ul><li>Input layer</li><li>Hidden layers</li><li>Output layer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/0*xqCPGu9nlkN1Y6px.png" /><figcaption>a neural network</figcaption></figure><p>The input layer consists of multiple units, one for each feature of the dataset, and an additional bias unit having value 1. Each logistic unit in a layer can be considered as a node. Now each node in an input layer is connected to every node in the next layer through a channel. Every channel has a weight (let’s say theta) assigned to it. The values of these weights are randomly initialized before training them on the input dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*vwXGevR83RNPDTHumwLorQ.png" /></figure><p>The input of the activation function of the next channel is the product of the input matrix and the weight matrix. In simple words, the higher the value of the weight, the more significant will be the impact of that particular feature on the output value.</p><p>Then any nonlinear activation function like sigmoid, rectified linear unit, tanh etc is applied to this product, which gives us the value of the activation nodes (say a).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*h7p2JJhnM0xi_WfL.png" /></figure><p>Let us take the example of a sigmoid function. Mathematically we can represent it as follows where g() represents the sigmoid function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*rtImN8Uctdw4WX9HxbqdaA.png" /></figure><p>And then these activation nodes again get multiplied by weights and act as an input for the next layer. This is how we propagate forward through the network until in the final output layer, we get the value of the hypothesis.</p><p>Consider a classification problem where if the value of the final output is above a certain threshold value then we can assign it y=1 or else otherwise. For eg. consider the case where you have to identify whether or not any person is wearing a mask then is the value of output can be 1(yes) or 0(no).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*7TZo6Ww_6aW1RSXYBEeWOg.png" /></figure><p>But if it&#39;s a multi-class classification problem then the output layer as many nodes as the number of classes. For eg . You want to categorize the vehicles parked in parking in 4 types then your output will look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/134/1*TF8IJgiI4UWuaF__TgnecA.png" /></figure><p>There will 4 possible values of the output layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*dwsXfci4FH5hGZT3G1qxXw.png" /></figure><h3>Cost function</h3><p>The cost function is a mathematical equation that is used to find the optimum values of the randomly initialized weights that we use in the algorithm. There are multiple forms of cost functions that can be implemented in an algorithm for optimization. For example, logistic regression</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*dPKqRMJ-MYrG8_DsdqeNlw.png" /></figure><p>The first summation is for the number of output classes we are considering. The second summation is for the number of data inputs that we provide.<br>The regularization term is to avoid the overfitting of the data. The dimensions of the weight matrix depend on the layer on which it is applied. The number of columns and rows depends on the matrix applied on the Kth layer and the number of nodes that are present in the next K +1 matrix.</p><h3>Backpropagation algorithm</h3><p>The backpropagation algorithm is used to minimize the cost function which we have computed. This gives us the optimum value of the weights which should be used in the network on the test data set to get the most accurate output. We minimize the cost function by taking its derivative with respect to a weight and then updating the values of all the weights simultaneously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/164/1*BZ6_rIZZ4n2oGdVj8zxLPg.png" /></figure><p>After all the examples in a training dataset undergo forward and background propagation, optimum values of weights of all the channels are obtained. Here the training of a neural network model is completed and it is ready to be implemented.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d538f3cfe50c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>