title: How to train a model for XOR using scikit-learn?
body: <p>Is there a magic sequence of parameters to allow the model to infer correctly from the data it hasn't seen before?</p>
  <pre class="lang-py prettyprint-override"><code>from sklearn.neural_network import MLPClassifier
  
  clf = MLPClassifier(
                  activation='logistic',
                  max_iter=100,
                  hidden_layer_sizes=(2,),
                  solver='lbfgs')
  X = [[ 0,  0],  # 2 samples, 3 features
       [0, 1],
  #      [1, 0],
      [1, 1]]
  y = [0, 
       1,
  #      1,
       0]  # classes of each sample
  clf.fit(X, y)
  
  assert clf.predict([[0, 1]]) == [1]
  assert clf.predict([[1, 0]]) == [1]
  </code></pre>