title: Extract decision boundary with scikit-learn linear SVM
body: <p>I have a very simple 1D classification problem: a list of values [0, 0.5, 2] and their associated classes [0, 1, 2]. I would like to get the classification boundaries between those classes.</p>
  
  <p>Adapting the <a href="http://scikit-learn.org/stable/modules/svm.html" rel="noreferrer">iris example</a> (for visualization purposes), getting rid of the non-linear models:</p>
  
  <pre><code>X = np.array([[x, 1] for x in [0, 0.5, 2]]) 
  Y = np.array([1, 0, 2])
  
  C = 1.0  # SVM regularization parameter
  svc = svm.SVC(kernel='linear', C=C).fit(X, Y)
  lin_svc = svm.LinearSVC(C=C).fit(X, Y)
  </code></pre>
  
  <p>Gives the following result: <img src="https://i.stack.imgur.com/abi4B.png" alt="enter image description here"></p>
  
  <p>LinearSVC is returning junk (why?), but the SVC with linear kernel is working okay. So I would like to get the boundaries values, that you can graphically guess: ~0.25 and ~1.25.</p>
  
  <p>That's where I'm lost: <code>svc.coef_</code> returns</p>
  
  <pre><code>array([[ 0.5       ,  0.        ],
         [-1.33333333,  0.        ],
         [-1.        ,  0.        ]])
  </code></pre>
  
  <p>while <code>svc.intercept_</code> returns <code>array([-0.125     ,  1.66666667,  1.        ])</code>.
  This is not explicit.</p>
  
  <p>I must be missing something silly, how to obtain those values? They seem obvious to compute, that would be ridiculous to iterate over the x-axis to find the boundary...</p>