A separating hyperplane’s equation is W.X + b = 0.
For a support vector machine in scikit-learn, how is the separating hyperplane derived? What do ‘a‘ and ‘w‘ signify?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In scikit-learn
coef_attribute holds the vectors of the separating hyperplanes for linear models. It has shape(n_classes, n_features)ifn_classes > 1(multi-class one-vs-all) and(1, n_features)for binary classification.In this toy binary classification example,
n_features == 2, hencew = coef_[0]is the vector orthogonal to the hyperplane (the hyperplane is fully defined by it + the intercept).To plot this hyperplane in the 2D case (any hyperplane of a 2D plane is a 1D line), we want to find a
fas iny = f(x) = a.x + b. In this caseais the slope of the line and can be computed bya = -w[0] / w[1].