{"id":1397,"date":"2019-02-15T10:32:07","date_gmt":"2019-02-15T10:32:07","guid":{"rendered":"http:\/\/kusuaks7\/?p=1002"},"modified":"2023-08-09T12:37:02","modified_gmt":"2023-08-09T12:37:02","slug":"how-the-good-old-sorting-algorithm-helps-a-great-machine-learning-technique","status":"publish","type":"post","link":"https:\/\/www.experfy.com\/blog\/ai-ml\/how-the-good-old-sorting-algorithm-helps-a-great-machine-learning-technique\/","title":{"rendered":"How the good old sorting algorithm helps a great machine learning technique"},"content":{"rendered":"<p><strong><em>Ready to learn Machine Learning? <a href=\"https:\/\/www.experfy.com\/training\/courses\">Browse courses<\/a>\u00a0like\u00a0<a href=\"https:\/\/www.experfy.com\/training\/courses\/machine-learning-foundations-supervised-learning\">Machine Learning Foundations: Supervised Learning<\/a> developed by industry thought leaders and Experfy in Harvard Innovation Lab.<\/em><\/strong><\/p>\n<h4 id=\"e22c\">In this article, we showed that how the simple sorting algorithm is at the heart of solving an important problem in computational geometry and how that relates to a widely used machine learning technique.<\/h4>\n<figure id=\"8e35\"><canvas width=\"75\" height=\"45\"><\/canvas><img decoding=\"async\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*opwN0BhtH4zvPF697fPlow.gif\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*opwN0BhtH4zvPF697fPlow.gif\" \/><\/figure>\n<p id=\"4568\">Machine learning (ML) is fast becoming one of most important computational techniques in the modern society. A branch of Artificial Intelligence (AI), it is being applied to everything from\u00a0<a href=\"https:\/\/www.nytimes.com\/2016\/12\/14\/magazine\/the-great-ai-awakening.html\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/www.nytimes.com\/2016\/12\/14\/magazine\/the-great-ai-awakening.html\" data->natural language translation and processing<\/a>(think Siri or Alexa) to\u00a0<a href=\"https:\/\/www.techemergence.com\/machine-learning-in-pharma-medicine\/\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/www.techemergence.com\/machine-learning-in-pharma-medicine\/\" data->medicine<\/a>,\u00a0<a href=\"https:\/\/www.nytimes.com\/2014\/11\/20\/technology\/personaltech\/picking-your-cars-computerized-brain.html\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/www.nytimes.com\/2014\/11\/20\/technology\/personaltech\/picking-your-cars-computerized-brain.html\" data->autonomous driving<\/a>, or business strategy development. A dizzying array of clever algorithms are being developed continuously for solving ML problems to learn patterns from streams of data and build AI infrastructure.<\/p>\n<blockquote id=\"0f51\"><p>However, sometimes it feels good to step back and analyze how some of the elementary algorithms are also doing their part in this revolution and appreciate their impact. In this article, I am going to illustrate one such non-trivial case.<\/p><\/blockquote>\n<h4 id=\"e221\"><strong>Support Vector\u00a0Machine<\/strong><\/h4>\n<p id=\"5f09\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Support_vector_machine\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Support_vector_machine\" data->Support vector machine or SVM<\/a>\u00a0in short, is one of the most important machine learning techniques, developed in past few decades. Given a set of training examples, each marked as belonging to one or the other of two categories, an SVM training algorithm builds a model that assigns new examples to one category or the other, making it a non-<a title=\"Probabilistic classification\" href=\"https:\/\/en.wikipedia.org\/wiki\/Probabilistic_classification\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Probabilistic_classification\" data->probabilistic<\/a>\u00a0<a title=\"Binary classifier\" href=\"https:\/\/en.wikipedia.org\/wiki\/Binary_classifier\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Binary_classifier\" data->binary<\/a><a title=\"Linear classifier\" href=\"https:\/\/en.wikipedia.org\/wiki\/Linear_classifier\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Linear_classifier\" data->linear classifier<\/a>. It is widely used in industrial systems, text classifications, pattern recognition, biological ML applications, etc.<\/p>\n<p id=\"d18f\">The idea is illustrated in the following picture. Main goal is to classify the points in the 2-dimensional plane into one of two categories \u2014 red or blue. It can be done by creating a classifier boundary (by running a\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Statistical_classification\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Statistical_classification\" data->classification algorithm<\/a>\u00a0and learning from the labeled data) between the two sets of points. Some of the possible classifiers are shown in the figure. All of them will classify the data points correctly but not all of them have the same \u2018<em>margin<\/em>\u2019 (i.e. distance) from the sets of data points which are closest to the boundary. It can be shown that only one of them maximizes this \u2018<em>margin<\/em>\u2019 between the set of blue and red points. That unique classifier is shown by the solid line whereas the other classifiers are shown as dotted lines. The utility of this margin maximization is that\u00a0<strong><em>larger the distance between two classes, lower the generalization error will be for the classification of a new point.<\/em><\/strong><\/p>\n<figure id=\"622f\"><canvas width=\"75\" height=\"50\"><\/canvas><img decoding=\"async\" style=\"width: 750px; height: 504px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*tZmAOZWgnAzYxWGUodbVgA.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*tZmAOZWgnAzYxWGUodbVgA.png\" \/><figcaption><strong>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/strong><\/figcaption><\/figure>\n<p style=\"text-align: center;\"><strong>\u00a0FIG 1<\/strong>: SVM and Maximum-margin classifier<\/p>\n<p id=\"584f\">The main differentiating feature of SVM algorithm is that the\u00a0<strong><em>classifier does not depend on all the data points\u00a0<\/em><\/strong>(unlike say logistic regression where each data point\u2019s features will be used in the construction of the classifier boundary function). In fact,\u00a0<strong><em>SVM classifier depend on a very small subset of data points, those which lie closest to the boundary<\/em><\/strong>\u00a0and whose position in the hyperplane can impact the classifier boundary line. The vectors formed by these points uniquely define the classifier function and they \u2018<em>support<\/em>\u2019 the classifier, hence the name \u2018support vector machine\u2019. This concept is shown in the following figure.<\/p>\n<figure id=\"331b\"><canvas width=\"75\" height=\"45\"><\/canvas><img decoding=\"async\" style=\"width: 750px; height: 453px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*cxO8_UNsAdOQpanLFJLoRw.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*cxO8_UNsAdOQpanLFJLoRw.png\" \/><\/figure>\n<p id=\"a0ee\">Read more on this \u201c<a href=\"http:\/\/web.mit.edu\/6.034\/wwwbob\/svm.pdf\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"http:\/\/web.mit.edu\/6.034\/wwwbob\/svm.pdf\" data->Idiot\u2019s guide to support vector machines<\/a>\u201d. A nice video tutorial on SVM can be found here.<\/p>\n<p style=\"text-align: center;\">\n<p style=\"text-align: center;\"><a href=\"https:\/\/youtu.be\/N1vOgolbjSc\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"Share link https:\/\/youtu.be\/N1vOgolbjSc\">https:\/\/youtu.be\/N1vOgolbjSc<\/a><\/p>\n<h4 id=\"52a7\"><strong>A geometric explanation of how the SVM works:\u00a0<em>Convex\u00a0Hull<\/em><\/strong><\/h4>\n<p id=\"e1c5\">The formal mathematics behind the SVM algorithm is fairly complex but intuitively it can be understood by considering a special geometric construct called\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Convex_hull\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Convex_hull\" data->convex hull<\/a>.<\/p>\n<p id=\"16ab\"><strong><em>What is Convex Hull<\/em><\/strong>? Formally a\u00a0<strong>convex hull<\/strong>\u00a0or\u00a0<strong>convex envelope<\/strong>\u00a0or\u00a0<strong>convex closure<\/strong>\u00a0of a set\u00a0<em>X<\/em>\u00a0of points in the\u00a0<a title=\"Euclidean plane\" href=\"https:\/\/en.wikipedia.org\/wiki\/Euclidean_plane\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Euclidean_plane\" data->Euclidean plane<\/a>\u00a0or in a\u00a0<a title=\"Euclidean space\" href=\"https:\/\/en.wikipedia.org\/wiki\/Euclidean_space\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Euclidean_space\" data->Euclidean space<\/a>\u00a0is the smallest\u00a0<a title=\"Convex set\" href=\"https:\/\/en.wikipedia.org\/wiki\/Convex_set\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Convex_set\" data->convex set<\/a>\u00a0that contains\u00a0<strong><em>X<\/em><\/strong>. However it is easiest to visualize using the\u00a0<em>rubber band analogy<\/em>. Imagine that a rubber band is stretched about the circumference of a set of pegs (our points of interest). If the rubber band is released, it becomes wrapped around the pegs resulting in a tight border defining the original set. The resulting shape is the\u00a0<em>convex hull<\/em>, and can be described by the subset of pegs that touch the border created by the rubber band. The idea is shown below.<\/p>\n<figure id=\"68d5\"><canvas width=\"75\" height=\"50\"><\/canvas><img decoding=\"async\" style=\"width: 750px; height: 507px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*ApY7IFePSaUbQnzayQ-dQA.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*ApY7IFePSaUbQnzayQ-dQA.png\" \/><\/figure>\n<p id=\"df83\">Now, it is easy to imagine that the SVM classifier is nothing but the linear separator that bisects the line joining these convex hulls exactly mid-point.<\/p>\n<blockquote id=\"f53d\"><p>Therefore, determining the SVM classifier reduces to the problem of finding the convex hull of a set of points.<\/p><\/blockquote>\n<figure id=\"219a\"><canvas width=\"75\" height=\"50\"><\/canvas><img decoding=\"async\" style=\"width: 750px; height: 515px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*m7QAwwbKK9lIF6FHOrpyEQ.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*m7QAwwbKK9lIF6FHOrpyEQ.png\" \/><\/figure>\n<h4 id=\"4af3\"><strong>How to determine the convex\u00a0hull?<\/strong><\/h4>\n<p id=\"1f3b\">Picture (an animated one) says a thousand words! Therefore, let me show the algorithm used to determine the convex hull of a set of points, in action. It is called\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Graham_scan\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Graham_scan\" data->Graham\u2019s scan<\/a>. The algorithm finds all vertices of the convex hull ordered along its boundary. It uses a\u00a0<a title=\"Stack (abstract data type)\" href=\"https:\/\/en.wikipedia.org\/wiki\/Stack_%28abstract_data_type%29\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Stack_(abstract_data_type)\">stack<\/a>\u00a0to detect and remove concavities in the boundary efficiently.<\/p>\n<figure id=\"cff1\"><canvas width=\"75\" height=\"75\"><\/canvas><img decoding=\"async\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*ov0GlArRF4gTrOavfjC1UA.gif\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*ov0GlArRF4gTrOavfjC1UA.gif\" \/><figcaption><strong>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 FIG<\/strong>: Graham\u2019s scan to find convex\u00a0hull .<\/p>\n<\/figcaption><\/figure>\n<blockquote id=\"8e67\"><p>Now, the question is how efficient this algorithm is i.e. what is the time complexity of Graham\u2019s scan method?<\/p><\/blockquote>\n<p id=\"4e3c\">It turns out that the time complexity of Graham\u2019s scan\u00a0<strong><em>depends on the underlying sort algorithm<\/em><\/strong>\u00a0that it needs to employ for finding the right set of points which constitute the convex hull.\u00a0<strong><em>But what is it sorting to begin with?<\/em><\/strong><\/p>\n<p id=\"163b\">The fundamental idea of this scanning techniques comes from two properties of a convex hull,<\/p>\n<ul>\n<li id=\"5757\">Can traverse the convex hull by making only counterclockwise turns<\/li>\n<li id=\"5638\">The vertices of convex hull appear in\u00a0<strong>increasing order of polar angle<\/strong><br \/>\nwith respect to point p with lowest y-coordinate.<\/li>\n<\/ul>\n<p id=\"6a1f\">First the points are stored in an array\u00a0<code>points<\/code>. Therefore, the algorithm starts by locating a reference point. This is the point with the lowest\u00a0<em>y<\/em>\u00a0coordinate (in case of ties, we break the tie by selecting the point with the lowest\u00a0<em>y\u00a0<\/em>coordinate and the lowest\u00a0<em>x<\/em>\u00a0coordinate). Once we locate the reference point, we move that point to beginning of\u00a0<code>points<\/code>by making it trade places with the first point in the array.<\/p>\n<figure id=\"07d0\" data-scroll=\"native\"><canvas width=\"75\" height=\"50\"><\/canvas><img decoding=\"async\" src=\"https:\/\/cdn-images-1.medium.com\/max\/600\/1*k1lPem8ubXVyCdEERAvDsw.jpeg\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/600\/1*k1lPem8ubXVyCdEERAvDsw.jpeg\" \/><figcaption><strong>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<\/strong><\/figcaption><\/figure>\n<p style=\"text-align: center;\"><strong>FIG<\/strong>: A stack data structure<\/p>\n<p id=\"10dc\">Next,\u00a0<strong><em>we sort the remaining points by their polar angle relative to the reference point<\/em><\/strong>. After sorting, the points with the lowest polar angle relative to the reference point will be at the beginning of the array, and the points with the largest polar angle will be at the end.<\/p>\n<p id=\"445d\">With the points properly sorted, we can now run the main loop in the algorithm. The loop makes use of a second list that will grow and shrink as we process the points in the main array. Basically,\u00a0<strong>we push points, which appear in counterclockwise rotation, on to the stack and reject points (pop from the stack) if the rotation becomes clockwise<\/strong>. The second list starts out empty. At the end of the algorithm, the points that make up the convex boundary will appear in the list. A\u00a0<a href=\"https:\/\/www.tutorialspoint.com\/data_structures_algorithms\/stack_algorithm.htm\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/www.tutorialspoint.com\/data_structures_algorithms\/stack_algorithm.htm\" data->stack data structure<\/a>\u00a0is used for this purpose.<\/p>\n<h4 id=\"1eea\"><strong>Pseudocode<\/strong><\/h4>\n<p id=\"b6d8\"><span style=\"font-family: courier new,courier,monospace;\"><span style=\"background-color: #e6e6fa;\"># <\/span><em><span style=\"background-color: #e6e6fa;\">Three points are a counter-clockwise turn if ccw &gt; 0, clockwise if<\/span><\/em><br \/>\n<span style=\"background-color: #e6e6fa;\"># <\/span><em><span style=\"background-color: #e6e6fa;\">ccw &lt; 0, and colinear if ccw = 0 because ccw is a determinant that #gives twice the signed\u00a0 area of the triangle formed by p1, p2, and #p3.<\/span><\/em><\/span><\/p>\n<p><span style=\"font-family: courier new,courier,monospace;\"><strong><span style=\"background-color: #e6e6fa;\">function<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> ccw(p1, p2, p3):<\/span><br \/>\n<span style=\"background-color: #e6e6fa;\">\u00a0\u00a0\u00a0 <\/span><strong><span style=\"background-color: #e6e6fa;\">return<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> (p2.x &#8211; p1.x)*(p3.y &#8211; p1.y) &#8211; (p2.y &#8211; p1.y)*(p3.x &#8211; p1.x)<\/span><\/span><\/p>\n<p><span style=\"font-family: courier new,courier,monospace;\"><strong><span style=\"background-color: #e6e6fa;\">let<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> N <\/span><strong><span style=\"background-color: #e6e6fa;\">be<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> number of points<\/span><br \/>\n<strong><span style=\"background-color: #e6e6fa;\">let<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> points[N] <\/span><strong><span style=\"background-color: #e6e6fa;\">be<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> the array of points<\/span><br \/>\n<strong><span style=\"background-color: #e6e6fa;\">swap<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> points[0] with the point with the lowest y-coordinate<\/span><\/span><\/p>\n<p><span style=\"font-family: courier new,courier,monospace;\"><strong><em><span style=\"background-color: #e6e6fa;\"># This is the most time-consuming step<\/span><\/em><br \/>\n<span style=\"background-color: #e6e6fa;\">sort<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> points by polar angle with points[0]<\/span><\/span><\/p>\n<p><span style=\"font-family: courier new,courier,monospace;\"><strong><span style=\"background-color: #e6e6fa;\">let<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> stack = NULL<\/span><br \/>\n<strong><span style=\"background-color: #e6e6fa;\">push<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> points[0] <\/span><strong><span style=\"background-color: #e6e6fa;\">to<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> stack<\/span><br \/>\n<strong><span style=\"background-color: #e6e6fa;\">push<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> points[1] <\/span><strong><span style=\"background-color: #e6e6fa;\">to<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> stack<\/span><br \/>\n<strong><span style=\"background-color: #e6e6fa;\">push<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> points[2] <\/span><strong><span style=\"background-color: #e6e6fa;\">to<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> stack<\/span><br \/>\n<strong><span style=\"background-color: #e6e6fa;\">for<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> i = 3 <\/span><strong><span style=\"background-color: #e6e6fa;\">to<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> N:<\/span><br \/>\n<span style=\"background-color: #e6e6fa;\">\u00a0\u00a0\u00a0 <\/span><strong><span style=\"background-color: #e6e6fa;\">while<\/span><\/strong> <strong><span style=\"background-color: #e6e6fa;\">ccw<\/span><\/strong><span style=\"background-color: #e6e6fa;\">(next_to_top(stack), top(stack), points[i]) &lt;= 0:<\/span><br \/>\n<span style=\"background-color: #e6e6fa;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><strong><span style=\"background-color: #e6e6fa;\">pop<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> stack<\/span><br \/>\n<span style=\"background-color: #e6e6fa;\">\u00a0\u00a0\u00a0 <\/span><strong><span style=\"background-color: #e6e6fa;\">push<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> points[i] <\/span><strong><span style=\"background-color: #e6e6fa;\">to<\/span><\/strong><span style=\"background-color: #e6e6fa;\"> stack<\/span><br \/>\n<strong><span style=\"background-color: #e6e6fa;\">end<\/span><\/strong><\/span><\/p>\n<p id=\"2ad1\">So, the time complexity of Graham\u2019s scan depends on the efficiency of the sort algorithm. Any general purpose sort technique can be used but there is a big difference between using a\u00a0<strong><em>O(n#k8SjZc9Dxk2)\u00a0<\/em><\/strong>and a\u00a0<strong><em>O(n.log(n))<\/em><\/strong>\u00a0algorithm (as illustrated in the following animation).<\/p>\n<figure id=\"e4bc\"><canvas width=\"75\" height=\"37\"><\/canvas><img decoding=\"async\" style=\"width: 750px; height: 380px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*6UxDYdMlnevixdo76xL8vA.gif\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*6UxDYdMlnevixdo76xL8vA.gif\" \/><figcaption><strong>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<\/strong><\/figcaption><\/figure>\n<p style=\"text-align: center;\"><strong>FIG:<\/strong>\u00a0Animations of various sort algorithms<\/p>\n<h4><\/h4>\n<h4 id=\"5d8f\"><strong>Summary<\/strong><\/h4>\n<p id=\"39a1\">In this article, we showed that how the simple sorting algorithm is at the heart of solving an important problem in computational geometry and how that relates to a widely used machine learning technique. Although there are many discrete optimization based algorithms to solve the SVM problem, this approach demonstrates the\u00a0<strong>importance of using fundamentally efficient algorithms at the core to build complex learning model for AI<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;In this article, we show how the simple sorting algorithm is at the heart of solving an important problem in computational geometry and how that relates to a widely used machine learning technique. Although there are many discrete optimization based algorithms to solve the SVM problem, this approach demonstrates the&nbsp;importance of using fundamentally efficient algorithms at the core to build complex learning model for AI. A dizzying array of clever algorithms are being developed continuously for solving ML problems to learn patterns from streams of data and build AI infrastructure.<\/p>\n","protected":false},"author":137,"featured_media":3276,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[183],"tags":[97],"ppma_author":[1967],"class_list":["post-1397","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-ml","tag-artificial-intelligence"],"authors":[{"term_id":1967,"user_id":137,"is_guest":0,"slug":"tirthajyoti-sarkar","display_name":"Tirthajyoti Sarkar","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","user_url":"","last_name":"Sarkar","first_name":"Tirthajyoti","job_title":"","description":"Dr. Tirthajyoti Sarkar, Principal Engineer at ON Semiconductor, conducts research on and designs advanced semiconductor technology and products, which power various things from smartphones to electric cars, with data centers and washing machines in between. He also moonlights by learning and practicing data science, machine learning, and Python\/R programming. He writes for multiple Data Science\/Artificial intelligence focused publications and loves to experiment with advanced machine learning techniques for application to semiconductor designs."}],"_links":{"self":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/1397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/users\/137"}],"replies":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/comments?post=1397"}],"version-history":[{"count":3,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/1397\/revisions"}],"predecessor-version":[{"id":28992,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/1397\/revisions\/28992"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/media\/3276"}],"wp:attachment":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/media?parent=1397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/categories?post=1397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/tags?post=1397"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=1397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}