Machine learning is a subfield of artificial intelligence that uses computer science, mathematics, and statistics to create algorithms capable of analyzing and learning from previously collected data. Machine learning models are trained to perform certain tasks through trial and error, rather than by following a set of rules that have been explicitly programmed by a human. In many cases, this approach is simpler to implement than developing explicit rules, and is often more effective.
Machine learning has applications in many fields. A (non-exaustive) list of applications includes spam detection, generating search results, image classification, voice recognition, programming autonomous vehicles, predicting credit scores, predicting housing costs, medical diagnoses, recommender systems, and handwriting recognition.
There are three main categories of machine learning problems: supervised learning, unsupervised learning, and reinforcement learning.
In this class, we will focus primarily on supervised learning.
In a supervised learning task, the goal is to generate a model or prediction function that can predict an output based on one or more input values.
The algorithm "learns" the optimal model by studying a training set of data that consists of several observations (or instances, or samples), each of which contains values for both its features and its label. You can imagine a supervised learning algorithm as a function that takes training data as input, and that produces a model, or prediction function, as its output.
Supervised learning tasks can be further grouped into regression and classification problems, based on whether the labels are continuous and real-valued or categorical.
The upper left plot in the figure below shows a small data set that could be used for a regression task. The horizontal axis represents the single feature, while the vertical axis represents the continuous label.
The figure also displays plots of 5 models (or prediction functions) that were generated using different regression algorithms.
The upper left plot in the figure below shows the plot of a sythetic data set created for use in a classification task. The two axes represent two different features. Each point represents a singple observation. Each observation is assigned on of two classes, "Orange" or "Blue", as indicated by the color of the point.
A model created by a classification algorithm would assign one of the two classes to each point in the plane. The figure below shows the regions designated as being in each class according to 5 different classification models.
In unsupervised learning, we work with data sets in which features are provided, but no labels. Not only are the labels "missing", but we typically do not start an unsupervised learning tasks with a preconception of what the possible labels might be. The goal of unsupervised learning is to identify structure within the data that might not be readily perceptible to humans.
Some common unsupervised learning tasks are:
The cell below shows the results of applying a clustering algorithm to an unlabeled dataset. The algorithm used in this example is referred to as K-means clustering.
Reinforcement learning is a branch of machine learning concerned with training an AI to interact with an virtual environment to perform a specific task. Examples of reinforcement learning tasks include training an algortihm to play chess, to play a video game, or to navigate a self-driving car.
In reinforcement learning, a software agent is provided with rules governing how it can interact with its environment. A goal is set for the agent, and a method is provided to score how successful the agent is at accomplishing that task. The RL algorithm then collects a training set through trial-and-error. Which each new attempt, the agent receives feedback regarding its performance, and then makes adjustments as needed.
Some links to YouTube videos demonstrating interesting applications of reinforcement learning are provided below.