![](https://csdnimg.cn/release/download_crawler_static/10377644/bg13.jpg)
1.
4 Types of Learning
N
ow that we can compare feature vectors, we have the tools necessary to use data for
practical algorithms. Machine learning is often split into three perspectives: supervised
learning, unsupervised learning, and reinforcement learning. Let's examine each, one by one.
1.4.1 Supervised Learning
B
y definition, a supervisor is someone higher up in the chain of command. When in doubt,
he or she dictates what to do. Likewise, supervised learning is all about learning from examples
laid out by a "supervisor" (such as a teacher).
A supervised machine learning system needs labeled data to develop a useful
understanding, which we call its model. For example, given many photographs of people and
their recorded corresponding ethnicity, we can train a model to classify the ethnicity of a
never-before-seen individual in an arbitrary photograph. Simply put, a model is a function that
assigns a label to some data. It does so by using previous examples, called a training dataset,
as reference.
A convenient way to talk about models is through mathematical notation. Let x be an
instance of data, such as a feature vector. The corresponding label associated with x is f(x),
often referred to as the ground truth of x. Usually, we use the variable y = f(x) because it’s
quicker to write. In the example of classifying the ethnicity of a person through a photograph, x
can be a hundred-dimensional vector of various relevant features, and y is one of a couple
values to represent the various ethnicities. Since y is discrete with few values, the model is
called a classifier. If y could result in many values, and the values have a natural ordering,
then the model is called a regressor.
Let’s denote a model's prediction of x as g(x). Sometimes you can tweak a model to change
its performance drastically. Models have some parameters that can be tuned either by a
human or automatically. We use the vector θ to represent the parameters. Putting it all
together, g(x|θ) more completely represents the model, read "g of x given θ."
AS
IDE
Models may also have hyper-parameters, which are extra ad-hoc properties about a model. The word
“hyper” in “hyper-parameter” is a bit strange at first. If it helps, a better name could be “meta-parameter,”
because the parameter is akin to metadata about the model.
T
he success of a model’s prediction g(x|θ) depends on how well it agrees with the ground
truth y. We need a way to measure the distance between these two vectors. For example, the
L2-norm may be used to measure how close two vectors lie. The distance between the ground
truth and prediction is called the cost.
The essence of a supervised machine learning algorithm is to figure out the parameters of a
model that results in the least cost. Mathematically put, we are trying to look for a θ* (Theta
star) that minimizes the cost among all data points x ∈ X. One way of formalizing this
optimization problem is the following:
14