{"id":178,"date":"2018-01-21T06:50:00","date_gmt":"2018-01-21T05:50:00","guid":{"rendered":"https:\/\/kindsonthegenius.com\/blog\/2018\/01\/21\/3-approaches-to-classification-in-machine-learning\/"},"modified":"2020-08-22T09:23:52","modified_gmt":"2020-08-22T07:23:52","slug":"3-approaches-to-classification-in-machine-learning","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/blog\/3-approaches-to-classification-in-machine-learning\/","title":{"rendered":"3 Approaches to Classification in Machine Learning"},"content":{"rendered":"<div style=\"color: #555555; font-size: 18px; line-height: 30px; text-align: justify;\">\n<div style=\"font-family: 'segoe ui';\">In this lesson, we would examine 3 approaches to classification. The first 2 would be based on the a priori knowledge of the probabilities. The third one would be based on the formulation of a discriminant function.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/2.bp.blogspot.com\/-jaV9cuuaZE0\/WmQ4EQIHPjI\/AAAAAAAAA2Q\/lYY0raVhQGwl5h0doSHu4rqJOAmVMDL1wCLcBGAs\/s1600\/3%2BApproaches%2Bto%2BClassification%2Bin%2BMachine%2BLearning%2528thumbnail%2529.jpg\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" loading=\"lazy\" border=\"0\" data-original-height=\"483\" data-original-width=\"1262\" height=\"122\" src=\"https:\/\/2.bp.blogspot.com\/-jaV9cuuaZE0\/WmQ4EQIHPjI\/AAAAAAAAA2Q\/lYY0raVhQGwl5h0doSHu4rqJOAmVMDL1wCLcBGAs\/s320\/3%2BApproaches%2Bto%2BClassification%2Bin%2BMachine%2BLearning%2528thumbnail%2529.jpg\" width=\"320\" \/><\/a><\/div>\n<ol>\n<li><span style=\"color: #990000;\">Determination of the Class-Conditional Densities<i><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\"> p(x | C<sub>k<\/sub>)<\/span><\/i><\/span><\/li>\n<p><span style=\"color: #990000;\"><\/span><\/p>\n<li><span style=\"color: #990000;\">Determination of the a Posteriori Class Probabilities<i><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\"> p(C<sub>k<\/sub> | x)<\/span><\/i><\/span><\/li>\n<p><span style=\"color: #990000;\"><\/span><\/p>\n<li><span style=\"color: #990000;\">Use of a Discriminative Function<\/span> <\/li>\n<\/ol>\n<p>Let&#8217;s begin with the first one.<\/p>\n<p><b>1. Determination of the Class-Conditional Densities  <span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\"><span style=\"color: black;\"><i>p(x | C<sub>k<\/sub>)<\/i><\/span><\/span><\/b><br \/>&nbsp;The first step is to solve the inference problem of determining the class-conditional probability densities <i><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\"><span style=\"color: black;\">p(x|C<sub>k<\/sub><\/span><\/span><\/i>) for each class <span style=\"color: black;\"><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\"><i>C<sub>k<\/sub><\/i><\/span><\/span> individually. Also separately infer the prior class probabilities <span style=\"color: black;\"><i><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\">p(C<sub>k<\/sub>).<\/span><\/i><\/span><br \/>Then use Bayes theory of the form<\/p>\n<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-left: auto; margin-right: auto; text-align: center;\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\"><a href=\"https:\/\/4.bp.blogspot.com\/-0LsGbh6LCEU\/WmO1TsJ7KwI\/AAAAAAAAA10\/SYmJ8_aFUcwZL-bufAWdmnAI-AfzgvV1QCLcBGAs\/s1600\/Bayes%2BTheory%2Bof%2BProbability.jpg\" style=\"margin-left: auto; margin-right: auto;\"><img decoding=\"async\" loading=\"lazy\" border=\"0\" data-original-height=\"111\" data-original-width=\"441\" height=\"79\" src=\"https:\/\/4.bp.blogspot.com\/-0LsGbh6LCEU\/WmO1TsJ7KwI\/AAAAAAAAA10\/SYmJ8_aFUcwZL-bufAWdmnAI-AfzgvV1QCLcBGAs\/s320\/Bayes%2BTheory%2Bof%2BProbability.jpg\" width=\"320\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">Bayes Theorem<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>to find the posterior class probabilities<span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\"><i><span style=\"color: black;\"> p(C<sub>k<\/sub> |  x)<\/span><\/i><\/span>.<br \/>We not that the expression <span style=\"color: black;\"><i><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\">p(x)<\/span><\/i><\/span> in the numerator can be found by the formula:<\/p>\n<p>Having found the posterior probability <span style=\"color: black;\"><i><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\">p(C<sub>k<\/sub> | x)<\/span><\/i><\/span>, we can use decision theory to determine the class membership. Such approaches that model the inputs as well as the outputs are called generative models, because they can be used to generate synthetic data points in the input space.<\/p>\n<p><b>2. First Determine the Posterior Class Probabilities, <span style=\"color: black;\"><i><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\">p(C<sub>k<\/sub> | x)<\/span><\/i><\/span><\/b><br \/>This approach first solves the inference problem of determining the posterior class probabilities <span style=\"color: black;\"><i><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\">p(C<sub>k<\/sub> | x),<\/span><\/i><\/span> and then subsequently use decision theory to assign each new x to one of the available classes. Such approaches that model the posterior probabilities directly are called discriminative models.<\/p>\n<p><b>3. Using a Discriminant Function<\/b><br \/>The third approach is to find a function <span style=\"color: black;\"><i><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\">f(x)<\/span><\/i><\/span>, called a discriminant function. This function maps each input <span style=\"color: black;\"><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\"><i>x<\/i><\/span><\/span> directly to a class label. <br \/>For example, in the case of the two-class problem, the function could have a binary output such that <i><span style=\"color: black;\"><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\">f(x) = 0<\/span><\/span><\/i> represents class C<sub>1<\/sub> while <span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\"><i><span style=\"color: black;\">f(x) = 1<\/span><\/i><\/span> represents class C<sub>2<\/sub>. In the use of discriminant function, probability is not used. The binary output discriminant function is shown:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/3.bp.blogspot.com\/-83jm9RaoV5E\/WmQ0Vokc8sI\/AAAAAAAAA2E\/LAIz-OisQLwV2gxCHkdrSyq99snEu7TOQCLcBGAs\/s1600\/Discriminant%2BFunction.jpg\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" loading=\"lazy\" border=\"0\" data-original-height=\"144\" data-original-width=\"556\" height=\"82\" src=\"https:\/\/3.bp.blogspot.com\/-83jm9RaoV5E\/WmQ0Vokc8sI\/AAAAAAAAA2E\/LAIz-OisQLwV2gxCHkdrSyq99snEu7TOQCLcBGAs\/s320\/Discriminant%2BFunction.jpg\" width=\"320\" \/><\/a><\/div>\n<p><b>Final Notes<\/b><br \/>The first approach is the most demanding&nbsp; of the three. This is because it involves finding the joint distribution over both x and <span style=\"color: black;\"><span style=\"font-family: &quot;times&quot; , &quot;times new roman&quot; , serif;\"><i>C<sub>k<\/sub><\/i><\/span><\/span>. But this approach have the advantage of allowing for marginal dencity of data to be determined.<br \/>The simplest approach is the last one as it does not require probability functions.<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this lesson, we would examine 3 approaches to classification. The first 2 would be based on the a priori knowledge of the probabilities. The &hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[11,16],"tags":[],"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/178"}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/comments?post=178"}],"version-history":[{"count":1,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":1443,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/178\/revisions\/1443"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media?parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/categories?post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/tags?post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}