{"id":3424,"date":"2024-09-01T13:55:06","date_gmt":"2024-09-01T13:55:06","guid":{"rendered":"https:\/\/workhouse.sweetdishy.com\/?p=3424"},"modified":"2024-09-01T13:55:06","modified_gmt":"2024-09-01T13:55:06","slug":"k-nearest-neighbor-supervised-learning-classification","status":"publish","type":"post","link":"https:\/\/workhouse.sweetdishy.com\/index.php\/2024\/09\/01\/k-nearest-neighbor-supervised-learning-classification\/","title":{"rendered":"K-Nearest\u00a0Neighbor\u00a0(Supervised Learning\/Classification)"},"content":{"rendered":"\n<p id=\"Par159\">The k-Nearest Neighbor (k-NN&nbsp;) is a method for classifying a dataset (k represents the number of neighbors). The theory is that those values that are close together are likely to be good predictors for a model. Think of it as \u201cBirds of a feather flock together.\u201d<\/p>\n\n\n\n<p id=\"Par160\">A use case for&nbsp;k-NN&nbsp;is the credit score, which is based on a variety of factors like income, payment histories, location, home ownership, and so on. The algorithm will divide the dataset into different segments of customers. Then, when there is a new customer added to the base, you will see what cluster he or she falls into\u2014and this will be the credit&nbsp;score.<\/p>\n\n\n\n<p id=\"Par161\">K-NN is actually simple to calculate. In fact, it is called lazy learning because there is no training process with the data.<\/p>\n\n\n\n<p id=\"Par162\">To use k-NN, you need to come up with the distance between the nearest values. If the values are numerical, it could be based on a Euclidian distance, which involves complicated math. Or, if there is categorical data, then you can use an overlap metric (this is where the data is the same or very similar).<\/p>\n\n\n\n<p id=\"Par163\">Next, you\u2019ll need to identify the number of&nbsp;neighbors. While having more will smooth the model, it can also mean a need for huge amount of computational&nbsp;resources. To manage this, you can assign higher weights to data that are closer to their neighbors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The k-Nearest Neighbor (k-NN&nbsp;) is a method for classifying a dataset (k represents the number of neighbors). The theory is that those values that are close together are likely to be good predictors for a model. Think of it as \u201cBirds of a feather flock together.\u201d A use case for&nbsp;k-NN&nbsp;is the credit score, which is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3326,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[441],"tags":[],"class_list":["post-3424","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-3-machine-learning"],"jetpack_featured_media_url":"https:\/\/workhouse.sweetdishy.com\/wp-content\/uploads\/2024\/08\/images-41-1.jpeg","_links":{"self":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/3424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/comments?post=3424"}],"version-history":[{"count":1,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/3424\/revisions"}],"predecessor-version":[{"id":3425,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/3424\/revisions\/3425"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/media\/3326"}],"wp:attachment":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/media?parent=3424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/categories?post=3424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/tags?post=3424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}