Implementation of a SVM in Python (SMO algorithm to set weights)