Got things working. Can't match the exact data from matlab due to precision differences, so I need a new test. Also needs cleanup and faster prediction (it scales poorly)