Matlab libsvm - how to find the w coefficients
问题 How can find what the vector w is, i.e. the perpendicular to the separation plane? 回答1: This is how I did it here. If I remember correctly, this is based on how the dual form of the SVM optimisation works out. model = svmtrain(...); w = (model.sv_coef' * full(model.SVs)); And the bias is (and I don't really remember why its negative): bias = -model.rho; Then to do the classification (for a linear SVM), for a N-by-M dataset 'features' with N instances and M features, predictions = sign