Move all the matrix algebra to a separate module.
Add some validation: randomly generate data, derive a classifier, and check that it classifies the data.