<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/machine-learning-explained-supervised-learning-unsupervised-learning-and-reinforcement-learning/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://enhancedatascience.com/2017/07/19/machine-learning-explained-supervised-learning-unsupervised-learning-and-reinforcement-learning/"> Enhance Data Science</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Machine learning is often split between three main types of learning: supervised learning, unsupervised learning, and reinforcement learning. Knowing the differences between these three types of learning is necessary for any data scientist.</p>
<h2>The big picture</h2>
<p>The type of learning is defined by the problem you want to solve and is intrinsic to the goal of your analysis:</p>
<ul>
<li>You have a <strong>target, a value or a class to predict</strong>. For instance, let’s say you want to predict the revenue of a store from different inputs (day of the week, advertising, promotion). Then your model will be trained on historical data and use them to forecast future revenues. Hence the model is supervised, it knows what to learn.</li>
<li>You have <strong>unlabelled data and looks for patterns</strong>, groups in these data. For example, you want to cluster to clients according to the type of products they order, how often they purchase your product, their last visit, … Instead of doing it manually, <strong>unsupervised machine learning</strong> will automatically discriminate different clients.</li>
<li>You want <strong>to attain an objective</strong>. For example, you want to find the best strategy to win a game with specified rules. Once these rules are specified, <strong>reinforcement learning techniques</strong> will play this game many times to find the best strategy.</li>
</ul>
<h2>On supervised learning</h2>
<p>Supervised learning regroups different techniques which all share the same principles:</p>
<ul>
<li>The training dataset contains inputs data (your predictors) and the value you want to predict (which can be numeric or not).</li>
<li>The model will use the training data to learn a link between the input and the outputs. Underlying idea is that the training data can be generalized and that the model can be used on new data with some accuracy.</li>
</ul>
<p>Some supervised learning algorithms:</p>
<ul>
<li>Linear and logistic regression</li>
<li>Support vector machine</li>
<li>Naive Bayes</li>
<li>Neural network</li>
<li>Gradient boosting</li>
<li>Classification trees and random forest</li>
</ul>
<p>Supervised learning is often used for expert systems in image recognition, speech recognition, forecasting, and in some specific business domain (Targeting, Financial analysis, ..)</p>
<h2>On unsupervised learning</h2>
<p><img data-orig-file="https://i0.wp.com/enhancedatascience.com/wp-content/uploads/2017/07/217px-Cluster-2.svg_.png?fit=217%2C145" data-orig-size="217,145" data-medium-file="https://i0.wp.com/enhancedatascience.com/wp-content/uploads/2017/07/217px-Cluster-2.svg_.png?fit=217%2C145" data-attachment-id="2176" data-image-meta="{" data-image-description="" src="https://i0.wp.com/enhancedatascience.com/wp-content/uploads/2017/07/217px-Cluster-2.svg_.png?resize=242%2C162" data-permalink="http://enhancedatascience.com/2017/07/19/machine-learning-explained-supervised-learning-unsupervised-learning-and-reinforcement-learning/217px-cluster-2-svg/" data-large-file="https://i0.wp.com/enhancedatascience.com/wp-content/uploads/2017/07/217px-Cluster-2.svg_.png?fit=217%2C145" alt="" data-image-title="217px-Cluster-2.svg" data-comments-opened="1" class="wp-image-2176" data-recalc-dims="1"></p>
<p><a rel="nofollow" href="https://en.wikipedia.org/wiki/Cluster_analysis" target="_blank">Cluster Analysis</a> from Wikipedia</p>
<p>On the other hand, unsupervised learning does not use output data (at least output data that are different from the input). Unsupervised algorithms can be split into different categories:</p>
<ul>
<li>Clustering algorithm, such as K-means, hierarchical clustering or mixture models. These algorithms try to discriminate and separate the observations in different groups.</li>
<li>Dimensionality reduction algorithms (which are mostly unsupervised) such as PCA, ICA or autoencoder. These algorithms find the best representation of the data with fewer dimensions.</li>
<li>Anomaly detections to find outliers in the data, i.e. observations which do not follow the data set patterns.</li>
</ul>
<p>Most of the time unsupervised learning algorithms are used to pre-process the data, during the exploratory analysis or to pre-train supervised learning algorithms.</p>
<h2>On reinforcement learning</h2>
<p>Reinforcement learning algorithms try to find the best ways to earn the greatest reward. Rewards can be winning a game, earning more money or beating other opponents. They present state-of-art results on very human task, for instance, <a rel="nofollow" href="https://www.cs.toronto.edu/~vmnih/docs/dqn.pdf" target="_blank">this paper </a>from the University of Toronto shows how a computer can beat human in old-school Atari video game.</p>
<p>Reinforcement learnings algorithms follow the different circular steps:</p>
<figure class="wp-caption"><img data-orig-file="https://i1.wp.com/enhancedatascience.com/wp-content/uploads/2017/07/reinforcementLearning.png?fit=437%2C450" data-orig-size="437,450" data-medium-file="https://i1.wp.com/enhancedatascience.com/wp-content/uploads/2017/07/reinforcementLearning.png?fit=291%2C300" data-attachment-id="2177" data-image-meta="{" data-image-description="" src="https://i1.wp.com/enhancedatascience.com/wp-content/uploads/2017/07/reinforcementLearning.png?resize=242%2C249" data-permalink="http://enhancedatascience.com/2017/07/19/machine-learning-explained-supervised-learning-unsupervised-learning-and-reinforcement-learning/reinforcementlearning/" data-large-file="https://i1.wp.com/enhancedatascience.com/wp-content/uploads/2017/07/reinforcementLearning.png?fit=437%2C450" alt="" data-image-title="reinforcementLearning" sizes="(max-width: 242px) 100vw, 242px" data-comments-opened="1" class="wp-image-2177" data-recalc-dims="1"><br>
<figcaption class="wp-caption-text">From Wikipedia: Reinforcement Learning</figcaption>
</figure>
<p>Given its and the environment’s states, the agent will choose the action which will maximize its reward or will explore a new possibility. These actions will change the environment’s and the agent states. They will also be interpreted to give a reward to the agent. By performing this loop many times, the agents will improve its behavior.</p>
<p>Reinforcement learning already performs wells on ‘small’ dynamic system and is definitely to follow for the years to come.</p>
<p>The post <a rel="nofollow" href="http://enhancedatascience.com/2017/07/19/machine-learning-explained-supervised-learning-unsupervised-learning-and-reinforcement-learning/" target="_blank">Machine Learning Explained: supervised learning, unsupervised learning, and reinforcement learning</a> appeared first on <a rel="nofollow" href="http://enhancedatascience.com/" target="_blank">Enhance Data Science</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://enhancedatascience.com/2017/07/19/machine-learning-explained-supervised-learning-unsupervised-learning-and-reinforcement-learning/"> Enhance Data Science</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/0mCGRsSKJRo" height="1"></a></div>