geometry - Python scikits learn - Separating Hyperplane equation -
a separating hyperplane's equation w.x + b = 0
.
for support vector machine in scikit-learn, how separating hyperplane derived? 'a
' , 'w
' signify?
in scikit-learn coef_
attribute holds vectors of separating hyperplanes linear models. has shape (n_classes, n_features)
if n_classes > 1
(multi-class one-vs-all) , (1, n_features)
binary classification.
in toy binary classification example, n_features == 2
, hence w = coef_[0]
vector orthogonal hyperplane (the hyperplane defined + intercept).
to plot hyperplane in 2d case (any hyperplane of 2d plane 1d line), want find f
in y = f(x) = a.x + b
. in case a
slope of line , can computed a = -w[0] / w[1]
.
Comments
Post a Comment