{"id":127,"date":"2025-01-12T22:16:11","date_gmt":"2025-01-12T14:16:11","guid":{"rendered":"https:\/\/www.toothlessos.xyz\/?p=127"},"modified":"2025-01-12T22:16:11","modified_gmt":"2025-01-12T14:16:11","slug":"machine-learning-all-about-distributions","status":"publish","type":"post","link":"https:\/\/www.toothlessos.xyz\/index.php\/2025\/01\/12\/machine-learning-all-about-distributions\/","title":{"rendered":"Machine learning: All about distributions"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Forewords<\/h2>\n\n\n\n<p>I am recently starting the &#8220;Introduction to Machine Learning&#8221; course at college. Therefore, I decide to start a new series on the topic of machine learning, in which I will note down important take aways from ML.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">All about distributions<\/h2>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"392\" height=\"512\" src=\"http:\/\/38.246.252.17:8080\/wp-content\/uploads\/2025\/01\/image.png\" alt=\"\" class=\"wp-image-132\" srcset=\"https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/image.png 392w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/image-230x300.png 230w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><\/figure>\n\n\n\n<p>The essence of machine learning lies in <strong>statistics<\/strong> and <strong>optimization<\/strong> (an argument borrowed from my professor). The datasets that we look at have some inherent patterns or distributions, while we create probabilistic models to <strong>fit<\/strong> these inherent patterns. We then use optimization tools to actually do the fitting.<\/p>\n\n\n\n<p>I know this summary can be abstract, so next let&#8217;s look at some examples together.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The examples<\/h2>\n\n\n\n<p>We first consider the classic example of linear <strong>regression<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"1024\" src=\"http:\/\/38.246.252.17:8080\/wp-content\/uploads\/2025\/01\/368dfb167fc3ebd5602e75942c73f02-737x1024.jpg\" alt=\"\" class=\"wp-image-143\" srcset=\"https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/368dfb167fc3ebd5602e75942c73f02-737x1024.jpg 737w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/368dfb167fc3ebd5602e75942c73f02-216x300.jpg 216w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/368dfb167fc3ebd5602e75942c73f02-768x1066.jpg 768w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/368dfb167fc3ebd5602e75942c73f02-1106x1536.jpg 1106w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/368dfb167fc3ebd5602e75942c73f02.jpg 1279w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"1024\" src=\"http:\/\/38.246.252.17:8080\/wp-content\/uploads\/2025\/01\/43a3f8bff4925ee4b514d1859323659-723x1024.jpg\" alt=\"\" class=\"wp-image-144\" srcset=\"https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/43a3f8bff4925ee4b514d1859323659-723x1024.jpg 723w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/43a3f8bff4925ee4b514d1859323659-212x300.jpg 212w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/43a3f8bff4925ee4b514d1859323659-768x1087.jpg 768w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/43a3f8bff4925ee4b514d1859323659-1085x1536.jpg 1085w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/43a3f8bff4925ee4b514d1859323659.jpg 1279w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><\/figure>\n\n\n\n<p>Another example worth looking at is <strong>classification<\/strong>, which will be introduced in more details in the following logs. <\/p>\n\n\n\n<p>For now, the most important takeaway is: <strong>Regression<\/strong> and <strong>classification<\/strong> are two of the most important and fundamental applications of machine learning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Appendix: KL-Divergence and Cross-entropy<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"689\" height=\"1024\" src=\"http:\/\/38.246.252.17:8080\/wp-content\/uploads\/2025\/01\/7a6b2effdcc3e1aa0d958a6c8885bf8-689x1024.jpg\" alt=\"\" class=\"wp-image-149\" srcset=\"https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/7a6b2effdcc3e1aa0d958a6c8885bf8-689x1024.jpg 689w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/7a6b2effdcc3e1aa0d958a6c8885bf8-202x300.jpg 202w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/7a6b2effdcc3e1aa0d958a6c8885bf8-768x1142.jpg 768w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/7a6b2effdcc3e1aa0d958a6c8885bf8-1033x1536.jpg 1033w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/7a6b2effdcc3e1aa0d958a6c8885bf8.jpg 1279w\" sizes=\"auto, (max-width: 689px) 100vw, 689px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"1024\" src=\"http:\/\/38.246.252.17:8080\/wp-content\/uploads\/2025\/01\/9be2c7eab11466c4ea2d4955f5d5a14-697x1024.jpg\" alt=\"\" class=\"wp-image-150\" srcset=\"https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/9be2c7eab11466c4ea2d4955f5d5a14-697x1024.jpg 697w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/9be2c7eab11466c4ea2d4955f5d5a14-204x300.jpg 204w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/9be2c7eab11466c4ea2d4955f5d5a14-768x1129.jpg 768w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/9be2c7eab11466c4ea2d4955f5d5a14-1045x1536.jpg 1045w, https:\/\/www.toothlessos.xyz\/wp-content\/uploads\/2025\/01\/9be2c7eab11466c4ea2d4955f5d5a14.jpg 1279w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/figure>\n\n\n\n<p><strong><em>Remarks<\/em><\/strong>: It&#8217;s worth noting that KL-divergence and cross-entropy both characterize the difference between two distributions. This may sound familiar to you.<\/p>\n\n\n\n<p>Spoiler: Cross-entropy can be used as an objective of optimization too! (Or you may also call it a loss function)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reference &amp; Extended Readings<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>STATS 302@DKU<\/li>\n\n\n\n<li><a href=\"https:\/\/www.bilibili.com\/video\/BV15V411W7VB?spm_id_from=333.788.videopod.sections&amp;vd_source=abeaf60fdc29cdc1bdc7925f758e6515\">\u201c\u4ea4\u53c9\u71b5\u201d\u5982\u4f55\u505a\u635f\u5931\u51fd\u6570\uff1f\u6253\u5305\u7406\u89e3\u201c\u4fe1\u606f\u91cf\u201d\u3001\u201c\u6bd4\u7279\u201d\u3001\u201c\u71b5\u201d\u3001\u201cKL\u6563\u5ea6\u201d\u3001\u201c\u4ea4\u53c9\u71b5\u201d_\u54d4\u54e9\u54d4\u54e9_bilibili<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.bilibili.com\/video\/BV1Y64y1Q7hi?spm_id_from=333.788.videopod.sections&amp;vd_source=abeaf60fdc29cdc1bdc7925f758e6515\">\u201c\u635f\u5931\u51fd\u6570\u201d\u662f\u5982\u4f55\u8bbe\u8ba1\u51fa\u6765\u7684\uff1f\u76f4\u89c2\u7406\u89e3\u201c\u6700\u5c0f\u4e8c\u4e58\u6cd5\u201d\u548c\u201c\u6781\u5927\u4f3c\u7136\u4f30\u8ba1\u6cd5\u201d_\u54d4\u54e9\u54d4\u54e9_bilibili<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/zh-v2.d2l.ai\/\">\u300a\u52a8\u624b\u5b66\u6df1\u5ea6\u5b66\u4e60\u300b \u2014 \u52a8\u624b\u5b66\u6df1\u5ea6\u5b66\u4e60 2.0.0 documentation<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Forewords I am recently starting the &#8220;Introductio [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[23,22,21,20],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-ml","tag-cross-entropy-loss","tag-kl-divergence","tag-linear-regression","tag-machine-learning"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.toothlessos.xyz\/index.php\/wp-json\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.toothlessos.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.toothlessos.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.toothlessos.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.toothlessos.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":18,"href":"https:\/\/www.toothlessos.xyz\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":151,"href":"https:\/\/www.toothlessos.xyz\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions\/151"}],"wp:attachment":[{"href":"https:\/\/www.toothlessos.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.toothlessos.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.toothlessos.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}