Linear algebraLesson 1 of 6
A record becomes a vector
Vectors, coordinates, and features
Suppose we record study hours, completed practice sets, and a quiz score. These are invented numbers for working through the arithmetic:
| Record | Hours | Sets | Score |
|---|---|---|---|
| 1 | 1 | 0 | 2 |
| 2 | 2 | 1 | 5 |
| 3 | 3 | 1 | 8 |
The first two measurements are inputs. The score is the output we want to predict. Keeping that distinction matters: putting the score among the inputs would give the model information it will not have when making a new prediction.
An ordered list of measurements
Section titled “An ordered list of measurements”Record 2 has input measurements 2 and 1. Put them in a column:
This is a vector. Here it represents one record, with hours first and sets second. Swapping the entries changes its meaning. Calling it a vector does not make the measurements more abstract; it gives us a way to calculate with them together.
The subscript in identifies the second record. To name a single entry, use : record , feature . Thus hours and set. Different books choose different conventions, so check the definition before interpreting a subscript.
The notation says that each input has two real-number entries. Read as “belongs to” and as “the collection of real vectors with two entries.” The superscript describes the number of coordinates; it does not square the measurements.
Calculating entry by entry
Section titled “Calculating entry by entry”Subtract records 1 and 2 in matching positions:
Record 2 contains one more hour and one more set. Vector subtraction keeps both differences. Multiplying a vector by a single number, called a scalar, scales every entry: . The superscript turns a displayed row into a column; the next lessons explain this operation, the transpose.
You can also plot at horizontal coordinate 2 and vertical coordinate 1. The plot and column are two representations of the same ordered pair. With hundreds of features, the arithmetic remains available even though a two-dimensional plot cannot show every coordinate.
Units still matter. Converting hours to minutes changes the first coordinate from 2 to 120. It does not change the underlying record. Raw numerical distance between records therefore depends on how their features are measured.
Try it
Section titled “Try it”What is , and what does each entry mean?
Work through the answer
: record 3 has one more study hour and the same number of practice sets. This comparison does not establish that the extra hour caused the score difference.