{"id":551,"date":"2020-10-14T12:57:35","date_gmt":"2020-10-14T16:57:35","guid":{"rendered":"https:\/\/www.macloo.com\/ai\/?p=551"},"modified":"2021-06-03T13:04:22","modified_gmt":"2021-06-03T17:04:22","slug":"ai-building-blocks-what-are-models","status":"publish","type":"post","link":"https:\/\/www.macloo.com\/ai\/2020\/10\/14\/ai-building-blocks-what-are-models\/","title":{"rendered":"AI building blocks: What are models?"},"content":{"rendered":"\n<p>Descriptions of <strong>machine learning<\/strong> are often centered on <em>training a model<\/em>. Not having a background in math or statistics, I was puzzled by this the first time I encountered it. What is the model?<\/p>\n\n\n\n<p>This 10-minute video first describes how you select labeled data for training. You examine the features in the data, so you know what&#8217;s available to you (such as <em>color<\/em> and <em>alcohol content<\/em> of beers and wines). Then the next step is <strong>choosing the model<\/strong> that you will train.<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube aligncenter wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"The 7 steps of machine learning\" width=\"739\" height=\"416\" src=\"https:\/\/www.youtube.com\/embed\/nKW8Ndu7Mjw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p>In the video, Yufeng Guo chooses a small linear model without much explanation as to <em>why<\/em>. For those of us with an impoverished math background, this choice is completely mysterious. (Guo does point out that some models are better suited for image data, while others might be better suited for text data, and so on.) But wait, <a rel=\"noreferrer noopener\" href=\"https:\/\/towardsdatascience.com\/all-machine-learning-models-explained-in-6-minutes-9fe30ff6776a\" target=\"_blank\">there&#8217;s help<\/a>. You can read various short or long explanations about the kinds of models available.<\/p>\n\n\n\n<p>It&#8217;s important for the outsider to grasp that this is all <strong>code<\/strong>. The model is an <strong>algorithm,<\/strong> or a set of algorithms (<em>not<\/em> a graph). But this is <em>not<\/em> the final model. This is a model you will <em>train,<\/em> using the data.<\/p>\n\n\n\n<p>What are you doing while training? You are \u2014 or rather, the system is \u2014 adjusting numbers known as <em>weights<\/em> and <em>biases<\/em>. At the outset, these numbers are randomly selected. They have no meaning and no reason for being the numbers they are. As the data go into the algorithm, the weights and biases are used with the data to produce a result, a <em>prediction<\/em>. Early predictions are bad. Wine is called beer, and beer is called wine.<\/p>\n\n\n\n<p>The output (the prediction) is compared to the &#8220;correct answer&#8221; (it is wine, or it is beer). The weights and biases are adjusted <em>by the system<\/em>. The predictions get better as the training data are run again and again and again. Running all the data through the system once is called an <em>epoch<\/em>; the weights and biases are not adjusted until after <em>all the data<\/em> have run through once. Then the adjustment. Then run the data again. Epoch 2: adjust, repeat. Many epochs are required before the predictions become good.<\/p>\n\n\n\n<p>After the predictions are good for the training data, it&#8217;s time to evaluate the model using data that were set aside and not used for training. These &#8220;test data&#8221; (or &#8220;evaluation data&#8221;) have never run through the system before.<\/p>\n\n\n\n<p>The results from the evaluation using the test data can be used to further fine-tune the system, which is done by the programmers, not by the code. This is called adjusting the <strong>hyperparameters<\/strong> and affects the learning process (<em>e.g., <\/em>how fast it runs; how the weights are initialized). These adjustments have been called &#8220;a \u2018black art\u2019 that requires expert experience, unwritten rules of thumb, or sometimes brute-force search&#8221; (<a rel=\"noreferrer noopener\" href=\"https:\/\/arxiv.org\/abs\/1206.2944\" target=\"_blank\">Snoek <em>et al., <\/em>2012<\/a>).<\/p>\n\n\n\n<p>And now, what you have is a <strong>trained model<\/strong>. This model is ready to be used on data <em>similar to<\/em> the data it was trained on. Say it&#8217;s a model for machine vision that&#8217;s part of a robot assembling cars in a factory \u2014 it&#8217;s ready to go into all the robots in all the car factories. It will see what it has been trained to see and send its prediction along to another system that turns the screw or welds the door or \u2014 whatever.<\/p>\n\n\n\n<p>And it&#8217;s still just \u2014 <strong>code<\/strong>. It can be copied and sent to another computer, uploaded and downloaded, and further modified.<\/p>\n\n\n\n<p><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-nc-nd\/4.0\/\"><img decoding=\"async\" alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https:\/\/i.creativecommons.org\/l\/by-nc-nd\/4.0\/88x31.png\"><\/a><br>\n<small><span xmlns:dct=\"http:\/\/purl.org\/dc\/terms\/\" property=\"dct:title\"><strong>AI in Media and Society<\/strong><\/span> by <span xmlns:cc=\"http:\/\/creativecommons.org\/ns#\" property=\"cc:attributionName\">Mindy McAdams<\/span> is licensed under a <a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-nc-nd\/4.0\/\">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License<\/a>.<br>\nInclude the author&#8217;s name (Mindy McAdams) and a link to the original post in any reuse of this content.<\/small><\/p>\n\n\n\n<p>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Descriptions of machine learning are often centered on training a model. Not having a background in math or statistics, I was puzzled by this the first time I encountered it. What is the model? This 10-minute video first describes how you select labeled data for training. You examine the features in the data, so you&hellip; <a class=\"more-link\" href=\"https:\/\/www.macloo.com\/ai\/2020\/10\/14\/ai-building-blocks-what-are-models\/\">Continue reading <span class=\"screen-reader-text\">AI building blocks: What are models?<\/span> <span class=\"meta-nav\" aria-hidden=\"true\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[157,5],"tags":[105,106,95,56,18],"class_list":["post-551","post","type-post","status-publish","format-standard","hentry","category-basics","category-machine-learning","tag-basics","tag-building_blocks","tag-hyperparameters","tag-model","tag-training"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.macloo.com\/ai\/wp-json\/wp\/v2\/posts\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.macloo.com\/ai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.macloo.com\/ai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.macloo.com\/ai\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.macloo.com\/ai\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":10,"href":"https:\/\/www.macloo.com\/ai\/wp-json\/wp\/v2\/posts\/551\/revisions"}],"predecessor-version":[{"id":565,"href":"https:\/\/www.macloo.com\/ai\/wp-json\/wp\/v2\/posts\/551\/revisions\/565"}],"wp:attachment":[{"href":"https:\/\/www.macloo.com\/ai\/wp-json\/wp\/v2\/media?parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.macloo.com\/ai\/wp-json\/wp\/v2\/categories?post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.macloo.com\/ai\/wp-json\/wp\/v2\/tags?post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}