49. Solving Systems of Equations
In the world of linear algebra, we are interested in solving systems of linear
equations of the form:
Ax = b
where A is a matrix of our set of input row vectors and b is the column vector of
labels for each vector in the A matrix. If we take the first three rows of serialized
sparse output from the previous example and place the values in its linear
algebra form, it looks like this:
Column 1 Column 2 Column 3 Column 4
0.7500000000000001 0.41666666666666663 0.702127659574468 0.5652173913043479
0.6666666666666666 0.5 0.9148936170212765 0.6956521739130436
0.45833333333333326 0.3333333333333336 0.8085106382978723 0.7391304347826088
This matrix of numbers is our A variable in our equation, and each independent
value or value in each row is considered a feature of our input data.
WHAT IS A FEATURE?
A feature in machine learning is any column value in the input matrix A that we’re using as an
independent variable. Features can be taken straight from the source data, but most of the time we’re
going to use some sort of transformation to get the raw input data into a form that is more appropriate
for modeling.
An example would be a column of input that has four different text labels in the source data. We’d
need to scan all of the input data and index the labels being used. We’d then need to normalize these
values (0, 1, 2, 3) between 0.0 and 1.0 based on each label’s index for every row’s column value.
These types of transforms greatly help machine learning find better solutions to modeling problems.
We’ll see more techniques for vectorization transforms in Chapter 5.
We want to find coefficients for each column in a given row for a predictor
function that give us the output b, or the label for each row. The labels from the
serialized sparse vectors we looked at earlier would be as follows:
Labels
26