Mercurial > hg > machine-learning-hw6
view visualizeBoundaryLinear.m @ 0:f602dc601e9e
Initial commit
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Mon, 21 Nov 2011 15:08:02 -0500 |
parents | |
children |
line wrap: on
line source
function visualizeBoundaryLinear(X, y, model) %VISUALIZEBOUNDARYLINEAR plots a linear decision boundary learned by the %SVM % VISUALIZEBOUNDARYLINEAR(X, y, model) plots a linear decision boundary % learned by the SVM and overlays the data on it w = model.w; b = model.b; xp = linspace(min(X(:,1)), max(X(:,1)), 100); yp = - (w(1)*xp + b)/w(2); plotData(X, y); hold on; plot(xp, yp, '-b'); hold off end