Changed to sparse matrices in SVM