title: Logistic Regression is sensitive to outliers? Using on synthetic 2D dataset
body: <p>I am currently using sklearn's Logistic Regression function to work on a synthetic 2d problem. The dataset is shown as below:</p>
  
  <p><a href="https://i.stack.imgur.com/xskqp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xskqp.png" alt="Binary label, 2D dataset"></a></p>
  
  <p>I'm basic plugging the data into sklearn's model, and this is what I'm getting (the light green; disregard the dark green):</p>
  
  <p><a href="https://i.stack.imgur.com/G3W8x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G3W8x.png" alt=""></a></p>
  
  <p>The code for this is only two lines; model = LogisticRegression(); model.fit(tr_data,tr_labels). I've checked the plotting function; that's fine as well. I'm using no regularizer (should that affect it?)</p>
  
  <p>It seems really strange to me that the boundaries behave in this way. Intuitively I feel they should be more diagonal, as the data is (mostly) located top-right and bottom-left, and from testing some things out it seems a few stray datapoints are what's causing the boundaries to behave in this manner.</p>
  
  <p>For example here's another dataset and its boundaries</p>
  
  <p><a href="https://i.stack.imgur.com/5pzNy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5pzNy.png" alt="2D dataset without stray datapoints"></a></p>
  
  <p><a href="https://i.stack.imgur.com/cUsho.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cUsho.png" alt="boundaries"></a></p>
  
  <p>Would anyone know what might be causing this? From my understanding Logistic Regression shouldn't be this sensitive to outliers.</p>