Skip to content

Commit

Permalink
Merge pull request plotly#1192 from smujjiga/patch-1
Browse files Browse the repository at this point in the history
Corrected the SVM margins
  • Loading branch information
cldougl authored Dec 3, 2018
2 parents b491dcc + deb9862 commit 4c7dd35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _posts/scikit/svm-margins/SVM Margins.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@
" # plot the parallels to the separating hyperplane that pass through the\n",
" # support vectors\n",
" margin = 1 / np.sqrt(np.sum(clf.coef_ ** 2))\n",
" yy_down = yy + a * margin\n",
" yy_up = yy - a * margin\n",
" yy_down = yy + np.sqrt(1 + a ** 2) * margin\n",
" yy_up = yy - np.sqrt(1 + a ** 2) * margin\n",
" \n",
" x_min = -4.8\n",
" x_max = 4.2\n",
Expand Down

0 comments on commit 4c7dd35

Please sign in to comment.