<?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 Gaurav Parihar on Medium]]></title>
        <description><![CDATA[Stories by Gaurav Parihar on Medium]]></description>
        <link>https://medium.com/@gauravjiit4?source=rss-f67179758ac3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*CHNvuRcUSAQXrlSL</url>
            <title>Stories by Gaurav Parihar on Medium</title>
            <link>https://medium.com/@gauravjiit4?source=rss-f67179758ac3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:41:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gauravjiit4/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: Decision Tree Classification]]></title>
            <link>https://medium.com/analytics-vidhya/machine-learning-decision-tree-classification-1a248e95bc03?source=rss-f67179758ac3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a248e95bc03</guid>
            <category><![CDATA[decision-tree-classifier]]></category>
            <category><![CDATA[decision-tree]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Gaurav Parihar]]></dc:creator>
            <pubDate>Sat, 13 Jun 2020 20:47:47 GMT</pubDate>
            <atom:updated>2020-06-26T16:40:40.600Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*xmZis4W43nLXwDJLwOCRcA.png" /></figure><p><em>Most of us feel Decision Tree to be tough but, it’s one of the most powerful techniques in Machine Learning. It’s easy to implement and falls under Supervised Learning Techniques. As the name suggests it’s a tree but, not with actual root and green leaves. It is tree build by going through various conditions forming a root called the Head Node and the leaves called Terminal Leaves resulting to break down the data into small segments.</em></p><blockquote><strong>Decision Tree:</strong></blockquote><blockquote>Decision Tree builds classification or regression models in the form of a tree structure. It is Supervised Learning technique. Their are two types of Decision Tree:-</blockquote><blockquote>Classification Tree.</blockquote><blockquote>Regression Tree.</blockquote><blockquote>Decision Tree are build using Recursive Portioning. This approach is also called Divide and Conquer. It breakdown a dataset into smaller and smaller subsets while at the same time an associated decision tree is incrementally developed.</blockquote><p><em>Decision Tree is flowchart like structure:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*FRSjUmdSxyuJfPJxHXPdbQ.png" /></figure><blockquote>Description about Decision Tree Classification structure:</blockquote><blockquote>i) It is a flowchart like Tree structure.</blockquote><blockquote>ii) Internal Nodes represents features.</blockquote><blockquote>iii) Branch represents decision rule.</blockquote><blockquote>iv) The top most node is called Root Node.</blockquote><blockquote>v) Leaf Nodes represents the final decision or result in Binary(0, 1) describing 0 for not happening the event and 1 for happening the event.</blockquote><blockquote>This final structure helps in decision making.</blockquote><p><em>But, the first thing which comes in our mind is how the tree formation takes place and procedure actually does it follow?</em></p><p><em>So, Let’s talk about Decision Tree Algorithm-</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*cd5Png1_SedmQxX7OhEIPw.png" /><figcaption><strong>Decision Tree Model Preparation.</strong></figcaption></figure><p><em>Now, let’s discuss about each feature selection step in details:-</em></p><blockquote><strong><em>Information Gain:-</em></strong></blockquote><blockquote><em>Information gain is the decrease in entropy. Information gain computes the difference between entropy before split and average entropy after split of the dataset based on given attribute values.</em></blockquote><blockquote><em>Mathematical Implementation-</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*bB7C9Q9G-ZOPIO6Ed1XVqw.png" /></figure><blockquote><em>Where, Pi is the probability that an arbitrary tuple in D belongs to class Ci.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*aPG_DDys8gJIfmoXzOpKxA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*LOKmFZVlsIs6G4iB-6ARMw.png" /></figure><blockquote><em>The attribute A with the highest information gain, Gain(A), is chosen as the splitting attribute at node N().</em></blockquote><blockquote><strong><em>Gain Ratio-</em></strong></blockquote><blockquote><em>Information gain is biased for the attribute with many outcomes. It means it prefers the attribute with a large number of distinct values.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*uXnI3pgfiIrzl8OvfGh8IA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*_UqEo2mF5etFRuS6JG7mTQ.png" /></figure><blockquote><em>The attribute with the highest gain ratio is chosen as the splitting attribute.</em></blockquote><blockquote><strong><em>Gini Index-</em></strong></blockquote><blockquote><em>The Gini Index considers a binary split for each attribute. You can compute a weighted sum of the impurity of each partition. If a binary split on attribute A partitions data D into D1 and D2, the Gini index of D is:</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*IKfi5LhkxLX2rZxn3ap6cw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*qS-wKJxaLSFNm28xbkmtYQ.png" /></figure><blockquote><em>Where, pi is the probability that a tuple in D belongs to class Ci.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*wt57Jgw7iwAqGH910nht6w.png" /></figure><blockquote><em>The attribute with minimum Gini index is chosen as the splitting attribute.</em></blockquote><p><strong><em>Let’s look One Example-</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*2-mNxn0EDZwgssEMNM92gQ.png" /></figure><blockquote><strong>Conclusion-</strong></blockquote><blockquote>Decision trees are easy to interpret and visualize. It can easily capture Non-linear patterns. But, sensitive to noisy data. It can overfit noisy data. Decision trees are biased with imbalance dataset, so it is recommended that balance out the dataset before creating the decision tree. The small variation(or variance) in data can result in the different decision tree. This can be reduced by bagging and boosting algorithms.</blockquote><blockquote>Thank You for giving your valuable time to read this blog!!!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a248e95bc03" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/machine-learning-decision-tree-classification-1a248e95bc03">Machine Learning: Decision Tree Classification</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning: kNN Algorithm]]></title>
            <link>https://medium.com/analytics-vidhya/machine-learning-knn-algorithm-4130f799d697?source=rss-f67179758ac3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4130f799d697</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[knn-algorithm]]></category>
            <category><![CDATA[knn]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Gaurav Parihar]]></dc:creator>
            <pubDate>Wed, 10 Jun 2020 13:48:51 GMT</pubDate>
            <atom:updated>2020-06-11T16:05:56.326Z</atom:updated>
            <content:encoded><![CDATA[<h3>Machine Learning: k-NN Algorithm</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*0cB_5tDxKVULg86jJCD3hw.png" /><figcaption><strong>k-Nearest Neighbors. Sources: Google Images.</strong></figcaption></figure><p>The k-Nearest Neighbors(k-NN) algorithm is simple and easy to implement. It is Supervised Learning technique which can solve both Classification and Regression problems. So, the first question which arise is-</p><p><strong><em>What is Supervised Learning?</em></strong></p><p><em>Supervised Learning says — </em><strong><em>“Teach Me”</em></strong><em>. Which means the learning goes through labelled dataset.</em></p><blockquote>Imagine the model as a child in the family. The child is taught about the difference between cat, dog, etc. after which a child is able to distinguish between the animals which he/she sees. Similarly, the model is taught with the labelled data which helps to learn the difference between the features of the categories of data available and predict the outcome of new observations.</blockquote><p><strong><em>k-Nearest Neighbors (k-NN)</em></strong></p><blockquote>k-Nearest Neighbors Algorithm (k-NN) a non-parametric method used for Classification and Regression. In both cases, the input consists of k closest training data in feature space. The output depends on whether <em>k</em>-NN is used for classification or regression:</blockquote><blockquote><strong>Classification:</strong>In k-NN classification, the output is a class membership. An object is classified by a plurality vote of its neighbors, with the object being assigned to the class most common among its k nearest neighbors (k is a positive integer),If k= 1, then the object is simply assigned to the class of that single nearest neighbor.</blockquote><blockquote><strong>Regression:</strong> In <em>k-NN regression</em>, the output is the value for the object. This value is the average of the values of <em>k</em> nearest neighbors.</blockquote><blockquote>We all must have heard the word “<strong>CART” </strong>throughout our learning about Machine Learning techniques.The CART (Classification and Regression Trees) decision tree algorithm can be used to build both classification trees (to classify categorical response variables) and regression trees (to forecast continuous response variables). k-Nearest Neighbor method can create both classification and regression models as well.</blockquote><p><strong><em>k-Nearest Neighbor(k-NN) for Classification:</em></strong></p><blockquote>In pattern recognition, the k-NN algorithm is a method for classifying objects based on closest training examples in the feature space. k-NN is a type of instance-based learning, or lazy learning. The k-NN is the fundamental and simplest classification technique when there is little or no prior knowledge about the distribution of the data. This rule simply retains the entire training set during learning and assigns to each query a class represented by the majority label of its k-nearest neighbors in the training set. In this method each sample should be classified similarly to its surrounding samples. Therefore, if the classification of a sample is unknown, then it could be predicted by considering the classification of its nearest neighbor samples.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*n3BJiJFIvCOJpKfgsyUjMw.png" /><figcaption><strong>The 1-NN decision rule: the point ? is assigned to the class on the left.</strong></figcaption></figure><p><strong><em>Example:-</em></strong></p><p><em>“ It is k-NN decision rule for K=1 for a set of samples divided into 2 classes. The Nearest Neighbor rule (NN) is the simplest form of k-NN when K= 1. ”- An unknown sample is classified by using only one known sample. Which is clearly visible in the figure.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*L7oa21ngIiZ1y4Bl1KUECw.png" /><figcaption><strong>The k-NN rule decision rule, with K= 4: the point ? is assigned to the class on the left as well</strong></figcaption></figure><p><strong><em>Example:-</em></strong></p><p><em>“It is k-NN decision rule for K=4 for a set of samples divided into 2 classes.”- An unknown sample is classified by using more than one known sample in space. </em>K <em>is set to 4, so that the closest four samples are considered for classifying the unknown one. Three of them belong to the same class, whereas only one belongs to the other class. Which is clearly visible in the figure.</em></p><blockquote>The performance of a k-NN classifier is primarily determined by the choice of K as well as the distance metric applied. The estimate is affected by the sensitivity of the selection of the neighborhood size K, because the radius of the local region is determined by the distance of the Kth nearest neighbor to the query and different K yields different conditional class probabilities. If K is very small, the local estimate tends to be very poor owing to the data sparseness and the noisy, ambiguous or mislabeled points. In order to further smooth the estimate, we can increase K and take into account a large region around the query. Unfortunately, a large value of K easily makes the estimate over smoothing and the classification performance degrades with the introduction of the outliers from other classes.</blockquote><p><strong><em>k-Nearest Neighbor(k-NN) for Regresssion:</em></strong></p><blockquote>The above method can be used for regression, by simply assigning the value for the object to be the average of the values of its K nearest neighbors. It can be useful to weight the contributions of the neighbors, so that the nearer neighbors contribute more to the average than the more distant ones. Regression problems are concerned with predicting the outcome of a dependent variable given a set of independent variables.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*28Su7N4t7sfZWHsBLQnXpQ.png" /><figcaption><strong>The k-NN decision rule for regression. Source: Google Images.</strong></figcaption></figure><blockquote><strong>Example-</strong></blockquote><blockquote>Let’s consider the above figure and start with 1-Nearest Neighbor. In this case we search the example set (green squares) and locate the one closest to the new observation X. For this particular case, this happens to be x4. The outcome of x4 (i.e., y4) is thus then taken to be the answer for the outcome of X (i.e., Y). Thus for 1-nearest neighbor we can write: Y = y4.</blockquote><blockquote>Now consider, the 2-Nearest Neighbor method. In this case, we locate the first two closest points to X, which happen to be y3 and y4. Taking the average of their outcome, the solution for Y is then given by:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/173/1*4teMo_TzIW6Ss4ZELoFwoA.png" /></figure><blockquote>Similarly, if the value of K increases the predicted value is the average of all the nearest neighbor.</blockquote><blockquote><strong>Conclusion: </strong>After learning about the k-NN algorithm let’s discuss about it’s advantages and disadvantages.</blockquote><blockquote><strong>Advantages: </strong>k-NN has several main advantages: simplicity, effectiveness, intuitiveness and competitive classification performance in many domains. It is Robust to noisy training data and is effective if the training data is large.</blockquote><blockquote><strong>Disadvantages: </strong>Despite the advantages given above, k-N has a few limitations. KNN can have poor run-time performance when the training set is large. It is very sensitive to irrelevant or redundant features because all features contribute to the similarity and thus to the classification. By careful feature selection or feature weighting, this can be avoided. Two other disadvantages of the method are:</blockquote><blockquote>1. Distance based learning is not clear which type of distance to use and which attribute to use to produce the best results.</blockquote><blockquote>2. Computation cost is quite high because we need to compute distance of each query instance to all training samples.</blockquote><blockquote>“Thank You for giving your valuable time to read this blog on a Machine Learning Algorithm.”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4130f799d697" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/machine-learning-knn-algorithm-4130f799d697">Machine Learning: kNN Algorithm</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning: A Journey From Linear Regression to Logistic Regression]]></title>
            <link>https://medium.com/analytics-vidhya/machine-learning-a-journey-from-linear-regression-to-logistic-regression-741c4236e3cd?source=rss-f67179758ac3------2</link>
            <guid isPermaLink="false">https://medium.com/p/741c4236e3cd</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[logistic-regression]]></category>
            <dc:creator><![CDATA[Gaurav Parihar]]></dc:creator>
            <pubDate>Tue, 09 Jun 2020 14:11:23 GMT</pubDate>
            <atom:updated>2020-06-10T14:53:38.601Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XgAlWcV-GwhipVkDwATUoA.jpeg" /><figcaption><strong>Linear and Logistic Regression. Sources: Google Images.</strong></figcaption></figure><blockquote><strong>Logistic Regression</strong>, one of the important part of Machine Learning and it is really important to know about it in detail and how the model works? The first question which always arises when we read the topic related to regression that <strong>What is Regression?</strong></blockquote><blockquote><strong>Regression analysis</strong> is a set of statistical processes for estimating the relationships between a dependent variable (often called the ‘outcome variable’) and one or more independent variable (often called ‘predictors’, ‘covariates’, or ‘features’).</blockquote><p><strong><em>Linear Regression:</em></strong></p><blockquote>Now, let’s discuss about <strong>Linear Regression</strong> first because it is the base on which Logistic Regression is build.</blockquote><blockquote>Here, we deal with two techniques Simple Linear Regression and Multiple Linear Regression which basically tries to find out the best fitting line using the Least Square Method. To get the best fitting line the regression model finds various lines of regression and find the minimum sum of all the instances of data in dataset. The one with minimum sum value is considered as final Trend Line which best fits the data.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*Nl8uy92iY2fVRxlCh5aHwA.png" /><figcaption>Example of Simple Linear Regression. Source: Google Images.</figcaption></figure><p><em>I am taking an example of Simple Linear Regression to explain the topic in detail.</em></p><p><em>We know the equation on which </em><strong><em>Simple Linear Regression</em></strong><em> works is:</em><strong><em> y=bo+b1*x</em></strong><em>. This equation finds out the best fitting line to fit the dataset and predict the Sales Amount based on Advertise Budget.</em></p><p><em>Here, it predict the values exceeding 0 and 1. But, what if we have some changes in the dataset points and we want to predict the outcome in terms of Pass/Fail, Yes/No, etc. Then, the concept of Linear Regression fails and can not deal with such situations.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*lXAvG1zsff1gxnGnJU8Zzg.png" /><figcaption><strong>Example of Dataset Points.</strong></figcaption></figure><p><em>As you can observe the trend analysis in the graph that whether a student fails or get pass after studying for a particular number of hours.</em></p><p><em>Could you think of plotting a linear regression line on such graph?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*fcytwfAjGaWhdJbqcekGeg.png" /></figure><p><em>I think you would have thought of a line similar to it. But, have you observed the lower and upper part of trend line which is predicting the values less than 0 and values greater than 1 which is of no use and which result in decreasing the accuracy of the model. One the middle part of the trend line is of useful for prediction.</em></p><blockquote><strong>Now, here comes the role of Logistic Regression which overcome the disadvantage of the Linear Regression.</strong></blockquote><p><strong><em>Logistic Regression:</em></strong></p><blockquote>In statistics, the logistic model is used to predict the probability of certain class or event existing such as Pass/Fail, Win/Lose, etc.</blockquote><blockquote>Logistic Regression is a statistical model that in its’s basic form uses a logistic function to model a binary dependent variable. Mathematically, a binary logistic model has a dependent variable with two possible values such as Pass/Fail which is indicated by two values labelled as “0&quot; and “1” in Logistic Model.</blockquote><blockquote>The corresponding probability of the value labeled “1” can vary between 0 (certainly the value “0”) and 1 (certainly the value “1”), hence the labeling; the function that converts log-odds to probability is the logistic function, hence the name. The unit of measurement for the log-odds scale is called a <strong>logit</strong>, from <strong>log</strong>istic un<strong>it</strong>, hence the alternative names.</blockquote><p><strong><em>Mathematical Explanation of Logistic Regression:</em></strong></p><blockquote>Let us try to understand logistic regression by considering a logistic model with given parameters, then seeing how the coefficients can be estimated from data. Consider a model with two predictors, x1 and x2, and one binary outcome Y, which we denote p=P(Y=1).We assume a linear relationship between the predictor variables and the log-odds of the event that Y=1.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*jnsertOZ4IFA7l1QEaJrEw.png" /><figcaption><strong>Linear Relationship.</strong></figcaption></figure><blockquote>We can recover the odds by exponentiation of the log-odds:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*zRieaE9RXwFvi43Z0dlD7Q.png" /><figcaption><strong>Exponentiation</strong></figcaption></figure><blockquote>By simple algebraic manipulation, the probability that Y=1 is:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*_4qmC5_o0O0re6CeECbjQw.png" /><figcaption><strong>Probability</strong></figcaption></figure><blockquote>The above formula shows that once 𝝱<strong>1</strong> are fixed, we can easily compute either the log-odds that <strong>Y=1 </strong>for a given observation, or the probability that <strong>Y=0 </strong>for a given observation.</blockquote><p><strong><em>Example: Probability of passing an exam versus hours of study:</em></strong></p><blockquote>A group of 20 students spends between 0 and 6 hours studying for an exam. How does the number of hours spent studying affect the probability of the student passing the exam?</blockquote><blockquote>The reason for using logistic regression for this problem is that the values of the dependent variable, pass and fail, while represented by “1” and “0”.</blockquote><blockquote>The table shows the number of hours each student spent studying, and whether they passed (1) or failed (0).</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AOygLOTWrfcWk0XRiVVlkQ.png" /><figcaption><strong>The table shows the number of hours each student spent studying, and whether they passed (1) or failed (0).</strong></figcaption></figure><blockquote>The graph shows the probability of passing the exam versus the number of hours studying, with the logistic regression curve fitted to the data.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/0*_I9Tzkpqi_GZsNvs.jpeg" /><figcaption><strong>Graph of a logistic regression curve showing probability of passing an exam versus hours studying.</strong></figcaption></figure><blockquote><strong><em>Conclusion:</em></strong><em> </em><strong><em>Logistic Regression</em></strong><em> is a statistical technique used to predict probability of binary response based on one or more independent variables. It means that, given a certain factors,</em><strong><em> logistic regression</em></strong><em> is used to predict an outcome which has two values such as 0 or 1, pass or fail, yes or no etc.The logit function draws the best fitting line.</em></blockquote><h3>“Thank You for your valuable time to read this blog on one of the algorithm of Machine Learning.”</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=741c4236e3cd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/machine-learning-a-journey-from-linear-regression-to-logistic-regression-741c4236e3cd">Machine Learning: A Journey From Linear Regression to Logistic Regression</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning: Support Vector Regression]]></title>
            <link>https://medium.com/analytics-vidhya/machine-learning-support-vector-regression-181aea35bedf?source=rss-f67179758ac3------2</link>
            <guid isPermaLink="false">https://medium.com/p/181aea35bedf</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[support-vector-regression]]></category>
            <category><![CDATA[support-vector-machine]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Gaurav Parihar]]></dc:creator>
            <pubDate>Fri, 05 Jun 2020 11:05:20 GMT</pubDate>
            <atom:updated>2020-06-06T03:32:30.223Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*HE9W_o111Kmij-K8KJPzbQ.png" /></figure><p><em>We are about to discuss SVR(Support Vector Regression). So, let’s discuss what regression is actually? In statistical modelling, </em><strong><em>regression analysis</em></strong><em> is a set of statistical processes for estimating the relationships between a dependent variable (often called the ‘outcome variable’) and one or more independent variable (often called ‘predictors’, ‘covariates’, or ‘features’). The regression problem is a generalization of the classification problem, in which the model returns a continuous-valued output, as opposed to an output from a finite set. In other words, a regression model estimates a continuous-valued multivariate function.</em></p><blockquote><strong>Support Vector Machines:</strong></blockquote><blockquote>As discussed above Regression problem is a generalization of the Classification problem. So, let’s throw some light on SVMs(Support Vector Machines) which is a classification algorithm which solves <strong>Binary Classification</strong> problem by convex optimization problems. The optimization problem deals with finding the maximum margin separating the hyperplane, while correctly classifying as many training points as possible. SVMs represents the hyperplane and support vectors. The scattered solution and good generalization of the SVM lend themselves to adaptation to regression problems.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*GohMl86hnRYjR00sPt4mqw.png" /><figcaption><strong>Support Vector Machines. Source: Google Images.</strong></figcaption></figure><blockquote><strong>Support Vector Regression:</strong></blockquote><blockquote>SVR(Support Vector Regression) is less popular than SVM(Support Vector Machine). But, SVR has been proved to be an effective tool in real value function estimation. As a Supervised Learning approach SVR trains using a symmetrical loss function, which equally penalizes high and low misestimates.</blockquote><blockquote>As in classification, SVR is characterized by the use of Kernels, Sparse Solution, VC Control of the Margin and Number of Support Vectors.</blockquote><blockquote>SVM generalization to SVR is accomplished by introducing an Ɛ-insensitive region around the function, called the <strong>Ɛ-tube</strong>. This tube reformulates the optimization problem to find the tube that best approximates the continuous-valued function. The tube tries to balance model<strong> complexity</strong> and<strong> prediction error</strong>. To be more specific about creation of tube, SVR is formulated as an optimization problem by first defining a convex Ɛ-insensitive loss function to be minimized and finding the flattest tube that contains most of the training instances. The hyperplane is represented in terms of support vectors, which are training samples that lie outside the boundary of the tube. As in SVM, the support vectors in SVR are the most influential instances that affect the <strong>shape of the tube</strong>, and the <strong>training</strong> and<strong> test </strong>data are assumed to be <strong>independent and identically distributed</strong>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*2eqnnvoNU6xazK4J_jhi2w.png" /><figcaption><strong>Support Vector Regression. Source : Google Images.</strong></figcaption></figure><blockquote><strong><em>SVR: Mathematical and Graphical Representation:</em></strong></blockquote><blockquote>SVR problem formulation is often best derived from a geometrical perspective. Dealing with two types of Data:</blockquote><blockquote><strong>One Dimensional Data: </strong>Mathematical Implementation of continuous-valued function being approximated can be written as in Equation below-</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*ZpPUTOq8PWeWEIhwhW-7Ag.png" /><figcaption><strong>Equation representing One-dimensional formulation.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*aHQJYOwPPsRSouhb1t0Tmw.png" /><figcaption><strong>One- Dimensional Linear SVR. Source: Google Images.</strong></figcaption></figure><blockquote>SVR formulates this function approximation problem as an optimization problem that attempts to find the narrowest tube centered around the surface, while minimizing the prediction error that is, the distance between the predicted and the desired outputs. The former condition produces the objective function in Equation, where ||w|| is the magnitude of the normal vector to the surface that is being approximated:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/121/1*oSYvVTeYdlIS_i9WmQSQOg.png" /><figcaption><strong>Formula to minimize the distance.</strong></figcaption></figure><blockquote><strong>Multidimensional Data: </strong>We augment x by one and include b in the w vector to simply the mathematical notation, and obtain the multivariate regression in Equation below-</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*4kdPpJZG98X4EO7jnhM_dA.png" /><figcaption><strong>Equation representing Multidimensional formulation.</strong></figcaption></figure><blockquote>Here, M is the order of the polynomial used to approximate a function. As the magnitude of the vector w increases, a greater number of wi are nonzero, resulting in higher-order solutions. The horizontal line is a 0th-order polynomial solution and has a very large deviation from the desired outputs, and thus, a large error. The linear function, a 1st-order polynomial, produces better approximations for a portion of the data but still underfits the training data. The 6th-order solution produces the best tradeoff between function flatness and prediction error. The highest-order solution has zero error but a high complexity and will most likely overfit the solution on yet to be seen data. The magnitude of w acts as a regularizing term and provides optimization problem control over the flatness of the solution.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*4gQ0dbo83nucoBwGyyqlaw.png" /><figcaption><strong>Solution with Various Orders. Sources: Google Images.</strong></figcaption></figure><blockquote><strong>Loss Functions: </strong>If e is decreased, the boundary of the tube is shifted inward. Therefore, more data points are around the boundary, which indicates more support vectors. Similarly, increasing Ɛ will result in fewer points around the boundary. Because it is less sensitive to noisy inputs, the e-insensitive region makes the model more robust. Several loss functions can be adopted, including the linear, quadratic, and Huber Ɛ.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*DeGMp4FrGeuqPHbAjo9YkQ.png" /><figcaption><strong>Loss Functions: a) Linear b)quadratic and c) Huber. Sources: Google Images.</strong></figcaption></figure><blockquote><strong>Asymmetrical Loss Functions: </strong>Adopting a soft-margin approach similar to that employed in SVM, slack variables Ɛ, Ɛ* can be added to guard against outliers. These variables determine how many points can be tolerated outside the tube. C is a regularization — thus, a tuneable parameter that gives more weight to minimizing the flatness, or the error, for this multiobjective optimization problem.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*kQ1V0DiJdY8iaq_a6PrKbw.png" /><figcaption><strong>Optimization Formula.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*M5q7z--bdCbYWIGPYVIl9A.png" /><figcaption><strong>Support Vector Regression. Source: Google Images.</strong></figcaption></figure><p><strong><em>Conclusion: </em></strong><em>The main advantage of SVR is that it’s computational complexity does not depend on the dimension of the input space. Additionally, it has excellent generalization capability with high prediction accuracy. The modified SVR can be applied to circumstances in which it is critically necessary to estimate or strictly limit underestimating a function.</em></p><blockquote>“Thank You for your valuable time to read this blog on one of the algorithm of Machine Learning.”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=181aea35bedf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/machine-learning-support-vector-regression-181aea35bedf">Machine Learning: Support Vector Regression</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning: Decision Tree Regression]]></title>
            <link>https://medium.com/analytics-vidhya/machine-learning-decision-tree-regression-ff8563ffaf52?source=rss-f67179758ac3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff8563ffaf52</guid>
            <category><![CDATA[decision-tree]]></category>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Gaurav Parihar]]></dc:creator>
            <pubDate>Wed, 03 Jun 2020 04:25:39 GMT</pubDate>
            <atom:updated>2020-06-03T16:18:10.293Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bg0_UGT6xo89Ij-GX61yPg.png" /><figcaption><strong>Basic Decision Tree Structure. Source: Google Images.</strong></figcaption></figure><p>Most of us feel Decision Tree to be tough but, it’s one of the most powerful techniques in Machine Learning. It’s easy to implement and falls under Supervised Learning Techniques. As the name suggests it’s a tree but, not with actual root and green leaves. It is tree build by going through various conditions forming a root called the Head Node and the leaves called Terminal Leaves resulting to break down the data into small segments.</p><p><strong><em>How is data split into segments? </em></strong>We easily say the data is split into segments but, have we ever thought of how and why it happens? The answer to this question lies in two important concepts Information Entropy(E) and Information Gain(IG).</p><p><strong><em>Information Entropy(E): </em></strong>Entropy refers to disorder or uncertainty. Here Information Entropy helps in finding out how Decision Tree decides to split the data. It’s helps in maintaining boundaries of decision.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*AKUvTcw2wjo0lTHYl2SYiw.png" /><figcaption><strong>Equation of Entropy.</strong></figcaption></figure><p><strong><em>Information Gain(IG): </em></strong>It measures how much information a particular feature gives us about the class.</p><blockquote>Information Gain is the main key to build Decision Tree and an attribute with highest information gain will be split first.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*vb100g5d_zmKBDg-XYyjeQ.png" /><figcaption><strong>Equation of Information Gain.</strong></figcaption></figure><blockquote>After going through all the above steps the segments of the data points looks like:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*vGHM6H1QR_Eg9hh9pARoYw.png" /><figcaption><strong>Splitting of Segments.</strong></figcaption></figure><p>The Decision Tree of the above example looks like the flow chart with 5 Terminal Leaves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*gBar9Uegdy62_8Wsh9PfaA.png" /><figcaption><strong>Decision Tree.</strong></figcaption></figure><blockquote>The values in the Terminal Leaves is used to predict the value of any new observation lying in this segment. The above describe the Recursive Splitting of data to form Decision Tree.</blockquote><p><strong><em>Implementation:</em></strong></p><p>We are taking the example of one Independent variable and a Dependent variable in a Dataset . So, we can plot the Decision Tree graph easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*3z9qA9e9KDfhabloUnGkmw.png" /><figcaption><strong>Importing Libraries.</strong></figcaption></figure><blockquote>Basic libraries the imported such as Numpy, Matplotlib, and pandas.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*8cjUvKzoXkEP-MdhmXJJLg.png" /><figcaption><strong>Importing Dataset.</strong></figcaption></figure><blockquote>Importing the Dataset on which we have to work on and storing the Independent Variable column values in X and Dependent Variable column values in y.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*oZ-RbgUFwThrG9HSAixY7Q.png" /><figcaption><strong>Values in X and y.</strong></figcaption></figure><p>As we have only 10 different values we will not split the data into Training and Test set. We want our model to learn on complete range of values in data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*-SPcFk9kErBXC9AKfzxxHw.png" /><figcaption><strong>Training the Regression Model.</strong></figcaption></figure><blockquote>The Decision Tree Regression Model is trained on two features X and y.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*-0Ie6bAF7JBMswjn1n23Vg.png" /><figcaption><strong>Visualization of Regression Model Result.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*9Qq8Zx82PMlzYUfLj8HBRw.png" /><figcaption><strong>Prediction of Salary.</strong></figcaption></figure><blockquote>The above Regression predict correctly the value lying in the segment between 5 and 6 level of position. We can compare the the results with the about plotted graph. This completes our easy implementation of Decision Tree Regression.</blockquote><p><strong><em>Conclusion: </em></strong>At last we come to the conclusion that the Decision Tree Regression plays an important part in forecasting or prediction the output of new observation. It works well with more number of Independent Variables. But, we can’t plot the graph as it will make a graph of more than 3 Dimensions. Thus, the formation of Decision Tree follows Recursive Splitting of data.</p><blockquote>“Thank You So Much for giving your valuable time for reading this blog on Decision Tree Regression. “</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff8563ffaf52" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/machine-learning-decision-tree-regression-ff8563ffaf52">Machine Learning: Decision Tree Regression</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning : Regression]]></title>
            <link>https://medium.com/analytics-vidhya/machine-learning-regression-e636141e0553?source=rss-f67179758ac3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e636141e0553</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-intelligence]]></category>
            <dc:creator><![CDATA[Gaurav Parihar]]></dc:creator>
            <pubDate>Tue, 02 Jun 2020 18:06:02 GMT</pubDate>
            <atom:updated>2020-06-04T17:02:39.226Z</atom:updated>
            <content:encoded><![CDATA[<h3>Machine Learning : Regression</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q_n0DQBUrDayuDjEOh9OyA.jpeg" /></figure><p><strong><em>What is Regression?</em></strong> In statistical modelling, <strong>regression analysis</strong> is a set of statistical processes for estimating the relationships between a dependent variable (often called the ‘outcome variable’) and one or more independent variable (often called ‘predictors’, ‘covariates’, or ‘features’).</p><p><strong><em>What is Regression Model?</em></strong></p><p>Regression models are of two types:</p><p>i) Linear Regression Model.</p><p>ii) Non-Linear Regression Model.</p><p>If the independent variable is time, then we are forecasting future values. Otherwise, we predict present but unknown values. Regression techniques vary from Linear Regression to Random Forest Regression. Here, we are discussing about Linear Regression Model. We use this technique in case study like predicting Salary, Grades, etc.</p><p><strong><em>Types of Linear Regression Model?</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*qS4Wdmw8_x9a9YBLqjAYkA.png" /><figcaption><strong>Types of Linear Regression.</strong></figcaption></figure><p><strong><em>Simple Linear Regression: </em></strong>This technique of regression works under the condition when their is only one independent variable to predict dependent variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*G4R6EDHt1OtI8UaaywDI-g.png" /><figcaption><strong>Mathematical Implementation of Simple Linear Regression.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*1G6_Pxc4BVMEC36Uy6fsoQ.png" /><figcaption><strong>Linear Regression Line Graph.</strong></figcaption></figure><p>Here, the equation of Regression Line is:</p><p><strong>Salary = bo + b1*Experience.</strong></p><p>The regression model puts the line which best fit the data and the observation came out is more the slope, more the change in Salary.</p><p><strong><em>Finding The Best Fitting Line:</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*fKtbJ58MuvNgxhgp_flOpA.png" /><figcaption><strong>Best Fitting Line Technique.</strong></figcaption></figure><p>To get the best fitting line the regression model finds various lines of regression and find the minimum sum of all the instances of data in dataset. The one with minimum sum value is considered as final Trend Line which best fits the data.</p><p>The mothod used in this technique is called Least Square Method.</p><p><strong><em>Multiple Linear Regression: </em></strong>This technique of regression works under the condition when their are more than one independent variable to predict dependent variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*_51y3zVf7ZL0syEaegdazg.png" /><figcaption><strong>Mathematical Implementation of Multiple Linear Regression.</strong></figcaption></figure><p>Before going further we should know that their are some assumptions of linear regression:</p><ol><li>Linearity.</li><li>Homoscedasticity.</li><li>Multivariate Normality.</li><li>Independence of errors.</li><li>Lack of Multicollinearity.</li></ol><p><strong><em>Dummy Variables: </em></strong>When we are dealing with multiple regression we come across dataset columns containing various fields of data. When we deal with column contating string data we consider as a categorical data and we convert it into numerical data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*78q3flq03w47N4UJCztOLA.png" /><figcaption><strong>Categorical data into Numerical data.(Source: Google Images).</strong></figcaption></figure><p>We can see that a column named State contains string and considering as a categorical data we change into numerical values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*iv2t5CyfrSeIoFFZtnjLwA.png" /><figcaption><strong>Omit One Dummy Variable.(Source: Google Images).</strong></figcaption></figure><p>It is prescribed that not to use all the dummy variable. If we have 2 dummy variable use one and if we have 3 use only 2 and so on. This means use one less the number of dummy variables. It helps to remove <strong>Multicollinearity.</strong></p><p><strong><em>Conclusion:</em></strong> The above description about the linear regression very well describes about the main regression steps followed throughout the model building process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e636141e0553" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/machine-learning-regression-e636141e0553">Machine Learning : Regression</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning: Data Preprocessing]]></title>
            <link>https://medium.com/analytics-vidhya/machine-learning-data-preprocessing-5874289e922c?source=rss-f67179758ac3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5874289e922c</guid>
            <category><![CDATA[data-preprocessing]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Gaurav Parihar]]></dc:creator>
            <pubDate>Thu, 28 May 2020 16:44:20 GMT</pubDate>
            <atom:updated>2020-06-02T15:54:13.483Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*RKVPaiL8iWPIXhAGv6LrpQ.png" /><figcaption><strong>Data Preprocessing. <em>Source: Google Images</em></strong></figcaption></figure><p>It will be fun if we relate this with our real life. Remember the task of washing and then chopping raw vegetables before cooking a dish. It is somewhat similar to this task. Data Preprocessing is a way of converting raw form of data to a much more usable form. It looks similar right? The only difference between the two task is that one helps to cook tasty dish and other a Machine Learning model for prediction of classes of new observations. Indeed, the step of Data Preprocessing step would not sound interesting for most of the people but, it is the very first important step because every time you build a model you always have Data Preprocessing phase to work on. The step of Preprocessing should be done in such a way that the model can be trained in right way because the efficiency of the model is dependent on this step.</p><p><strong><em>Steps Involved in Data Preprocessing: </em></strong>This step is completely dependent on some preprocessing tools:</p><ol><li><strong>Importing Libraries: </strong>We need to import basically 3 libraries(NumPy, Matplotlib, pandas) in the beginning to start the phase of preprocessing. But, what a library is? A library is symbol of module which contains functions and classes through which you can perform actions and operations.</li></ol><p>i)<em>NumPy</em>- You need this library to work with array. As future model will require arrays for implementation.</p><p>ii)M<em>atplotlib</em>- You need this library to create some beautiful charts.</p><p>iii)<em>pandas- </em>This library is not only helpful to import the data set but, also create matrix of features and the dependent variable vectors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*RYX4STmjxpIxA3yqFmQlyA.png" /><figcaption><strong>Importing Libraries.</strong></figcaption></figure><p>2. <strong>Importing The Dataset: </strong>Here comes the steps of importing the data set, which is one of the important phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*ZeHg66DHG0yvIFWI4q84BQ.png" /><figcaption><strong>Importing Dataset.</strong></figcaption></figure><p>The dataset variable here acts as a data frame of rows and columns similar to the data set(Data.csv).</p><p>i) <em>Creating Matrix of Features and Dependent Variable Vector:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*CHl3VZytvGg0Wkm3JXw6iw.png" /><figcaption><strong>Features of Matrices.</strong></figcaption></figure><p>All we need to know is to play with the indexes of Matrix and we can easily create these two feature matrices. X here acts as independent variable matrix and Y as dependent variable vector. These two feature matrices will be the first need of the furthers steps of preprocessing.</p><p>3. <strong>Take Care of Missing Data: </strong>Do look out the above picture and the rows containing value NaN which signify that the values are missing and it can affect the learning of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*J7Vx-RQPwraZoKpDZkMi0A.png" /><figcaption><strong>Missing Values are Replaced With Mean Values.</strong></figcaption></figure><p>It could be done in many ways like Deleting/Ignoring the rows with missing values. But, it is beneficial when the number of rows with missing values are at most 1%.</p><p>The other ways are replacing the missing values with median or mean value of that column.</p><p>But, the most preferred is replacing with average sum value(<strong>Mean</strong>) of the column. It is done with the help of best data science library scikit-learn.</p><p>4.<strong> Encoding Categorical Data: </strong>The above feature matrices contains the column with string values which is tough to handle and work with. As the computers works well with binary values. So, we will convert string values into binary values.</p><p>i) <em>Encoding The Independent Variables:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*MrzXQW-F4LEwrjzGpAhkdQ.png" /><figcaption><strong><em>Encoding of Independent variables.</em></strong></figcaption></figure><p>We have three categories of data so, the encoded values are:</p><p>“India as 0, 0, 0&quot;, “China as 0, 0, 1”, and “America as 1, 0, 0”.</p><p>ii) <em>Encoding The Dependent Variables:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*BFbkFXEQdGLrzhBoVtDaSg.png" /><figcaption><strong><em>Encoding of Dependent variables.</em></strong></figcaption></figure><p>Here, we have two categories of values so, the encoded values are:</p><p>“No as 0” and “Yes as 1”</p><p>5. <strong>Splitting of Dataset into Training set and Test set: </strong>In this step we work on generalization. The purpose of splitting to avoid overfitting. <strong>Overfitting</strong> happens when a model learns the detail and noise in the training data to the extent that it negatively impacts the performance of the model on new data. It optimizes the training accuracy. We need our model to predict well the outcome of new observation(Test set), which is similar to training set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*eV_a3zWBVe5fYjhDhOnZjA.png" /><figcaption><strong>Splitting of Dataset into 80% Training set and 20% Test set.</strong></figcaption></figure><p>6. <strong>Feature Scaling:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*bAQGD4dpYzEX_BRLmZCFhQ.png" /></figure><p>Feature Scaling is important to bring the variety of data in the same scale. It involves the step of normalising the data in the particular range.</p><p>The two most commonly used scaling techniques are Normalization and Standardization. But, we prefer normalization technique.</p><p><strong><em>Conclusion: </em></strong><em>The above mentioned steps are really important to work with as the data preprocessing is one of the standing pillar of the Model building process. I hope the mentioned details will help many of the beginners to develop the understanding of data preprocessing.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5874289e922c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/machine-learning-data-preprocessing-5874289e922c">Machine Learning: Data Preprocessing</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning — AI(3 W’s Of ML)]]></title>
            <link>https://medium.com/analytics-vidhya/machine-learning-ai-3-ws-of-ml-ed488c8d036?source=rss-f67179758ac3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed488c8d036</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Gaurav Parihar]]></dc:creator>
            <pubDate>Tue, 26 May 2020 16:40:44 GMT</pubDate>
            <atom:updated>2020-05-26T16:40:44.677Z</atom:updated>
            <content:encoded><![CDATA[<h3>Machine Learning — AI(3 W’s Of ML)</h3><p><strong><em>I. What is Machine Learning?</em></strong>We all must have heard about Artificial Intelligence(AI). AI is field concerned with computers to do tasks which require Human Intelligence. Machine Learning is an application of AI that provide systems the ability to automatically learn and improve from experiences without being explicitly programmed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/263/1*ERBXEXLqdDssIMmeMV4FgA.png" /><figcaption><strong>ML is sub part of AI.</strong></figcaption></figure><p><strong><em>Are Machines and Humans are related?</em></strong>In the current era of technology machines are acting and standing parallel of humans. Humans have been learning from their past experiences and acts accordingly to the future situations. But, if machines can think, feel, act and start learning by themselves? This looks fascinating, but always remember we are living in the era of machines. In no less time humans would be replaced through these machines. Well, though it has started to happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*Uqb_8wgn9Ak_mVDFdhE9XQ.png" /><figcaption><strong>Robot Hugging a Girl.</strong> Source: Google Images</figcaption></figure><p><strong><em>How does Machine learn and work?</em></strong>The term coined after this is Machine Learning. The Machine Learning algorithm is trained using training data set to create a model. When a new input data is introduced to the ML algorithm, it makes a prediction on the basis of the model.</p><p>The Machine Learning algorithm is deployed after considering the prediction accuracy and if it fails the accuracy it can’t be deployed for human use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*XXebFA2CYjQIdXXOvkgteA.png" /><figcaption><strong>Machine Learning Algorithm.</strong></figcaption></figure><p><strong><em>Types of Machine Learning-</em></strong>The learning is divided into four categories.</p><ol><li>Supervised Machine Learning-”Teach me”.</li><li>Unsupervised Machine Learning-”I am able to learn”.</li><li>Semi-supervised Machine Learning-”Between supervised and unsupervised learning”.</li><li>Reinforcement Machine Learning-”Hit and Trial”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*5xcMOmGJFLv35Tq8DdxN_Q.gif" /><figcaption><strong>Process of ML Algorithm. </strong>Source: edureka.</figcaption></figure><p><strong><em>What is Supervised Machine Learning?</em></strong></p><p>This algorithm learning is made through the help of teacher. The data set here acts like a teacher and it’s role is to train the model or the machine.The works on labelled training data set.This learning works on input-output pairs. After the training, model becomes capable of making prediction on the input.</p><p><strong>Various Techniques of Supervised Machine Learning-</strong></p><ol><li>Regression-”Linear Regression and Polynomial Regression”.</li><li>Decision Tree.</li><li>Random Forest.</li><li>Classification-”KNN,Tree,Logistic Regression,Naive-Bayes, and SVM”.</li></ol><p><strong><em>What is Unsupervised Machine Learning?</em></strong></p><p>This algorithm is self sufficient to learn by itself. Once the model is given the data set it automatically make groups(clusters) of various categories of data available in the data set. But, it can’t label the clusters formed.</p><p><strong>Various Techniques of Unsupervised Machine Learning-</strong></p><ol><li>Clustering-”PCA, SVD and K-means”.</li><li>Association Analysis-” Apriori and FP-Growth”.</li><li>Hidden Markov Model.</li></ol><p><strong><em>What is Semi-Supervised Machine Learning?</em></strong></p><p>Such learning lies between supervised and unsupervised learning. It uses small amount of labelled data and a large amount of unlabelled data. This models always tends to improve accuracy.</p><p><strong><em>What is Reinforcement Machine Learning?</em></strong></p><p>This algorithm learning is completely based on environment learning. It answers are not predictable as it is completely hit and trail. The model trains itself whenever it hits a right answer and get ready to predict other answer.</p><p><strong><em>II. Where Can You Find Machine Learning?</em></strong>Machine Learning is found every where in the today’s era. It lies within our mobile phones and the applications we use. Whenever we shop online through e-commerce websites we get some or the other predictions about items it’s completely based on the Machine Learning as it is able to make recommendation on the basis of our past shopping details or the items we have viewed earlier. The Music application recommend the songs on the basis of on the songs we have enjoyed listening in the past. The face recognition in our mobile phones and that of Facebook and many others. Machine Learning is spreading at a very fast pace in the Medical Science too. It is helping the doctors to diagnose the patients and the online pharmacy to sell medicines. I could list as many I can this is why Machine Learning is one of the most interesting field to explore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*SoYZ5D7EEhD1IdPXvadmoA.png" /><figcaption><strong>Most Commonly used ML based Technologies.</strong> <em>Source: Google Images.</em></figcaption></figure><p><strong><em>III. When Can We Use Machine Learning?</em></strong>Well, Machine Learning is used when we are limited to the structured data. This algorithm learning technique fits best is such cases. And works unimaginable when their is a large amount of data. It can be used when we want to make judgements based on images, videos and text recognition predictions. It can be used where ever their is a human need.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed488c8d036" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/machine-learning-ai-3-ws-of-ml-ed488c8d036">Machine Learning — AI(3 W’s Of ML)</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>