Unit 2 Lecture 5
Unit 2 Lecture 5
Unit 2 Lecture 5
In this section and the next we’ll design those non-learned functions — the fea-
turizers and readouts, respectively — to construct a hypothesis class H suitable
given our domain knowledge and our goals. In this section, we’ll discuss how
the design of features determines the patterns that the machine is able to express;
feature design can thus make or break an ML project.
A way to represent x as a fixed-length list of numbers is a featurization. Each
map from raw inputs to numbers is a feature. Different featurizations make
different patterns easier to learn. We judge a featurization not in a vacuum but
with respect to the kinds of patterns we use it to learn. information easy for the
machine to use (e.g. through apt nonlinearities) and throw away task-irrelevant
information (e.g. by turning 784 pixel darknesses to 2 meaningful numbers).
Here are two themes in the engineering art of featurization.◦ ← For now, we imagine hand-coding our fea-
tures rather than adapting them to training
predicates — If domain knowledge suggests some subset S ⊆ X is salient, then we can data. We’ll later discuss adapted features; sim-
define the feature ple examples include thresholding into quan-
tiles based on sorted training data (Is x more
x �→ 1 if x lies in S else 0
than the median training point?), and choosing
coordinate transforms that measure similarity
The most important case helps us featurize categorical attributes (e.g. kind-of-
to landmarks (How far is x from each of these 5
chess-piece, biological sex, or letter-of-the-alphabet): if an attribute takes K pos- “representative” training points?). Deep learning
sible values, then each value induces a subset of X and thus a feature. These is a fancy example.