{"id":1374,"date":"2019-02-15T10:32:06","date_gmt":"2019-02-15T10:32:06","guid":{"rendered":"http:\/\/kusuaks7\/?p=979"},"modified":"2023-08-08T06:20:00","modified_gmt":"2023-08-08T06:20:00","slug":"coding-deep-learning-for-beginners-types-of-machine-learning","status":"publish","type":"post","link":"https:\/\/www.experfy.com\/blog\/ai-ml\/coding-deep-learning-for-beginners-types-of-machine-learning\/","title":{"rendered":"Coding Deep Learning For Beginners\u200a &#8211; \u200aTypes of Machine Learning"},"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<blockquote><p>This is the 2nd article of series \u201c<strong>Coding Deep Learning for Beginners<\/strong>\u201d. You can view the <a href=\"https:\/\/www.experfy.com\/blog\/coding-deep-learning-for-beginners-start\">1st article here<\/a>.\u200b<\/p><\/blockquote>\n<p style=\"text-align: center;\"><img decoding=\"async\" style=\"width: 700px; height: 474px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/1*8wU0hfUY3UK_D8Y7tbIyFQ.png\" \/><\/p>\n<h3 id=\"d522\"><strong>Goals<\/strong><\/h3>\n<p id=\"760c\">Getting into Machine Learning isn\u2019t an easy thing. I really want to\u00a0<strong>take good care of the reader<\/strong>. That\u2019s why from time to time, you can expect\u00a0<strong>articles focused only on theory<\/strong>. Because long articles discourage from learning, I will keep them at<strong>\u00a05\u20138 minutes of reading time<\/strong>. I cannot just put everything into a single article \u2014 code snippets, math, terminology \u2014 because that would result in reducing the explanations of essential concepts. I believe that dividing the knowledge into smaller parts and expanding it across more articles will\u00a0<strong>make the learning process smooth<\/strong>\u00a0as there will be no need to take stops and detours.<\/p>\n<h3 id=\"7d3f\"><strong>Machine Learning\u00a0model<\/strong><\/h3>\n<p id=\"da3c\">Starting with the definition of \u201cmodel\u201d which will appear quite often from now on. The names like\u00a0<em>Linear Regression<\/em>,\u00a0<em>Logistic Regression<\/em>,\u00a0Decision Trees etc. are just the names of the algorithms. Those are just\u00a0<strong>theoretical concepts\u00a0<\/strong>that describe what to do in order to achieve the specific effect. Model is a\u00a0<strong>mathematical formula<\/strong>\u00a0which is a result of Machine Learning\u00a0<strong>algorithm implementation<\/strong>\u00a0(in case of these articles \u2014 in code). It has measurable parameters that can be used for prediction. Models can be trained by modifying their parameters in order to achieve better results. It is possible to say that models are representations of what a Machine Learning system has learned from the training data.<\/p>\n<figure id=\"fa13\"><canvas width=\"75\" height=\"47\"><\/canvas><img decoding=\"async\" style=\"width: 700px; height: 451px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*-gZUJG8u8DllAHBcnDZ8kQ.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*-gZUJG8u8DllAHBcnDZ8kQ.png\" \/><\/figure>\n<p style=\"text-align: center;\">Diagram visualising difference between Machine Learning Algorithm and Machine Learning\u00a0Model.<\/p>\n<h3 id=\"8d50\"><strong>Branches of Machine\u00a0Learning<\/strong><\/h3>\n<p id=\"a941\">There are three most regularly listed categories of Machine Learning:<\/p>\n<ul>\n<li id=\"bee9\">Supervised Learning<\/li>\n<li id=\"4acf\">Unsupervised Learning<\/li>\n<li id=\"49d9\">Reinforcement Learning<\/li>\n<\/ul>\n<h4 id=\"620b\"><strong>Supervised Learning<\/strong><\/h4>\n<p id=\"9916\">The group of algorithms that\u00a0<strong>require<\/strong>\u00a0<strong>dataset which consists of example input-output pairs<\/strong>. Each pair consists of\u00a0<strong>data sample<\/strong>\u00a0used to make prediction and expected outcome called\u00a0<strong>label<\/strong>. Word \u201csupervised\u201d comes from a fact that labels need to be assigned to data by the\u00a0<strong>human supervisor<\/strong>.<\/p>\n<p id=\"627c\">In training process, samples are being iteratively fed to the model. For every sample, the model uses the current state of parameters and returns a prediction. Prediction is compared to label, and the difference is called an error.\u00a0<strong>The error is a feedback for the model of what went wrong and how to update itself in order to decrease the error in future predictions.<\/strong>\u00a0This means that model will change the values of its parameters according to the algorithm based on which it was created.<\/p>\n<figure id=\"b5eb\"><canvas width=\"75\" height=\"47\"><\/canvas><img decoding=\"async\" style=\"width: 700px; height: 462px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*Ws6dN6RnlTnAwrgZz3Xruw.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*Ws6dN6RnlTnAwrgZz3Xruw.png\" \/><\/figure>\n<p id=\"729d\" style=\"text-align: center;\">Diagram demonstrating how Supervised Learning\u00a0works.<\/p>\n<p>Supervised Learning models are\u00a0<strong>trying to find parameter values that will allow them to perform well on historical data<\/strong>. Then they are\u00a0<strong>used for making predictions on unknown data<\/strong>, that was not a part of training dataset.<\/p>\n<p id=\"d960\">There are two main problems that can be solved with Supervised Learning:<\/p>\n<ul>\n<li id=\"3083\"><strong>Classification<\/strong> \u2014 process of\u00a0<em>assigning category to input<\/em>\u00a0data sample. Example usages: predicting whether a person is ill or not, detecting fraudulent transactions, face classifier.<\/li>\n<li id=\"16ea\"><strong>Regression<\/strong>\u00a0&#8211; process of\u00a0<em>predicting a continuous, numerical value<\/em>\u00a0for input data sample. Example usages: assessing the house price, forecasting grocery store food demand, temperature forecasting.<\/li>\n<\/ul>\n<figure id=\"3906\" data-scroll=\"native\"><canvas width=\"75\" height=\"20\"><\/canvas><img decoding=\"async\" style=\"width: 700px; height: 206px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/1*YdFpc4tjH_qzdghANfQu5g.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/1*YdFpc4tjH_qzdghANfQu5g.png\" \/>.<\/figure>\n<p style=\"text-align: center;\">Example of Classification and Regression models<\/p>\n<h4 id=\"f14e\"><strong>Unsupervised Learning<\/strong><\/h4>\n<p id=\"2a68\">Group of algorithms that try to\u00a0<strong>draw inferences from non-labeled data<\/strong>(without reference to known or labeled outcomes). In Unsupervised Learning,\u00a0<strong>there are no correct answers<\/strong>. Models based on this type of algorithms can be used for discovering unknown data patterns and data structure itself.<\/p>\n<figure id=\"4b8e\"><canvas width=\"75\" height=\"37\"><\/canvas><img decoding=\"async\" style=\"width: 700px; height: 356px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*UDQeTGvnsHYZQlSFJFfNAQ.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*UDQeTGvnsHYZQlSFJFfNAQ.png\" \/><\/figure>\n<p id=\"418e\" style=\"text-align: center;\">Example of Unsupervised Learning concept. All data is fed to the model and it produces an output on it\u2019s own based on similarity between samples and algorithm used to create the\u00a0model.<\/p>\n<p>The most common applications of Unsupervised Learning are:<\/p>\n<ul>\n<li id=\"7228\"><strong>Pattern recognition and data clustering<\/strong>\u00a0&#8211; Process of\u00a0<em>dividing and grouping similar data<\/em>\u00a0samples together. Groups are usually called clusters. Example usages: segmentation of supermarkets, user base segmentation, signal denoising.<\/li>\n<li id=\"4f78\"><strong>Reducing data dimensionality<\/strong>\u00a0&#8211; Data dimension is the number of features needed to describe data sample. Dimensionality reduction is a<em>process of compressing features into so-called principal values<\/em>\u00a0which conveys similar information concisely. By selecting only a few components, the amount of features is reduced and a small part of the data is lost in the process. Example usages: speeding up other Machine Learning algorithms by reducing numbers of calculations, finding a group of most reliable features in data.<\/li>\n<\/ul>\n<figure id=\"7891\"><canvas width=\"75\" height=\"70\"><\/canvas><img decoding=\"async\" style=\"width: 700px; height: 668px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*W6uSE6lsFApiNW-2iS0tOA.gif\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*W6uSE6lsFApiNW-2iS0tOA.gif\" \/><\/figure>\n<p style=\"text-align: center;\">Dividing data from various countries around the world into three clusters representing Developed, Developing and Underdeveloped nations (source:\u00a0<a href=\"https:\/\/www.tableau.com\/about\/blog\/2016\/7\/uncover-patterns-your-data-tableau-10s-clustering-feature-56373\" target=\"_blank\" rel=\"noopener noreferrer\" data-href=\"https:\/\/www.tableau.com\/about\/blog\/2016\/7\/uncover-patterns-your-data-tableau-10s-clustering-feature-56373\" data->Tableau\u00a0blog<\/a>).<\/p>\n<h4 id=\"552e\"><strong>Reinforcement Learning<\/strong><\/h4>\n<p id=\"4949\">Branch of Machine Learning algorithms which produces so-called\u00a0<strong>agents<\/strong>. The agent role is slightly different than classic model. It\u2019s to\u00a0<strong>receive information from the environment and react to it<\/strong>\u00a0by performing an\u00a0<strong>action<\/strong>. The information is fed to an agent in form of numerical data, called\u00a0<strong>state,<\/strong>which is<strong>\u00a0<\/strong>stored and then used for choosing right action. As a result, an agent receives a\u00a0<strong>reward<\/strong>\u00a0that can be either positive or negative. The reward is a feedback that can be used by an agent to update its parameters.<\/p>\n<p id=\"2c3c\">Training of an agent is a process of\u00a0<strong>trial and error<\/strong>. It needs to find itself in various situations and get punished every time it takes the wrong action in order to learn. The goal of optimisation can be set in many ways depending on Reinforcement Learning approach e.g. based on\u00a0<em>Value Function<\/em>,\u00a0<em>Gradient Policy<\/em>\u00a0or<em>\u00a0Environment Model<\/em>.<\/p>\n<figure id=\"7b84\"><canvas width=\"75\" height=\"20\"><\/canvas><img decoding=\"async\" style=\"width: 700px; height: 194px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*BasRwCdkMhaHIAPDCMFG-w.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*BasRwCdkMhaHIAPDCMFG-w.png\" \/><\/figure>\n<p id=\"e4e4\" style=\"text-align: center;\">Interaction between Agent and Environment.<\/p>\n<p>There is a broad group of Reinforcement Learning applications. Majority of them are the inventions, that are regularly mentioned as most innovative accomplishments of AI.<\/p>\n<figure id=\"a7ee\" data-scroll=\"native\"><canvas width=\"75\" height=\"17\"><\/canvas><img decoding=\"async\" style=\"width: 700px; height: 172px;\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/1*schHxgSoscqVbrb1R6KPEA.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/1*schHxgSoscqVbrb1R6KPEA.png\" \/><\/figure>\n<p id=\"fdaa\" style=\"text-align: center;\">Example of solutions where Reinforcement Learning is used. From self-driving cars through various games such as Go, Chess, Poker or computer ones \u2014 Dota or Starcraft, to manufacturing.<\/p>\n<p>Simulating the movement of 3D models is a complicated task. Such models need to interact with different models in a given environment. Reinforcement Learning is becoming more actively used as a tool for solving this problem, as the results it produces seem very trustworthy for human eye and algorithms are capable of automatically adjusting to rules describing the environment.<\/p>\n<p style=\"text-align: center;\">\n<p style=\"text-align: center;\">Main video accompanying the SIGGRAPH 2018 paper: \u201cDeepMimic: Example-Guided Deep Reinforcement Learning of Physics-Based Character Skill\u201d.\u00a0<a href=\"https:\/\/youtu.be\/vppFvq2quQ0\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"Share link https:\/\/youtu.be\/vppFvq2quQ0\">https:\/\/youtu.be\/vppFvq2quQ0<\/a><\/p>\n<h3 id=\"19be\"><strong>Summary<\/strong><\/h3>\n<p id=\"67e5\">And that\u2019s it. In the next article, I will explain basics and implementation of Linear Regression algorithm which is one of the basic Supervised Learning algorithms.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting into Machine Learning isn&rsquo;t an easy thing. The names like&nbsp;Linear Regression,&nbsp;Logistic Regression,&nbsp;and Decision Trees etc. are just the names of the algorithms. Those are just&nbsp;theoretical concepts that describe what to do in order to achieve the specific effect. Model is a&nbsp;mathematical formula&nbsp;which is a result of Machine Learning&nbsp;algorithm implementation. It has measurable parameters that can be used for prediction. Models can be trained by modifying their parameters in order to achieve better results. It is possible to say that models are representations of what a Machine Learning system has learned from the training data.<\/p>\n","protected":false},"author":321,"featured_media":23820,"comment_status":"open","ping_status":"open","sticky":false,"template":"single-post-2.php","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[183],"tags":[97],"ppma_author":[2905],"class_list":["post-1374","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-ml","tag-artificial-intelligence"],"authors":[{"term_id":2905,"user_id":321,"is_guest":0,"slug":"kamil-krzyk","display_name":"Kamil Krzyk","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","user_url":"","last_name":"Krzyk","first_name":"Kamil","job_title":"","description":"Kamil Krzyk is Data Scientist at <a href=\"http:\/\/www.azimo.com\/\">Azimo<\/a>,&nbsp; In the past, he was a Full Stack Engineer on the mobile team. Passionate about Machine Learning technology, he focuses on building software components which use data and math as its core."}],"_links":{"self":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/1374","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\/321"}],"replies":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/comments?post=1374"}],"version-history":[{"count":3,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/1374\/revisions"}],"predecessor-version":[{"id":29989,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/1374\/revisions\/29989"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/media\/23820"}],"wp:attachment":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/media?parent=1374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/categories?post=1374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/tags?post=1374"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=1374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}