Vectors and Matrices
- by hand
Let and . Work out , then , then .
- by hand
Check that and have a dot product of zero. Then find a vector whose dot product with is zero. What do such pairs look like when drawn as arrows?
- by hand
Three students have features (hours studied, hours slept) of , and . A model uses weights and a bias of 10. What score does it predict for each student? What are the shapes of the matrix, the weight vector and the result?
- in code
Put the three students from the previous exercise into a NumPy array
Xand the weights intow. Compute the predictions withX @ w + 10. Then tryw @ Xand explain what happens. - with the figure
Go back to the figure “How much do two arrows agree?”. Keeping the length of b about the same, swing it all the way round a. Where does b point when the dot product is largest? Where is it most negative? Where is it zero?