title: MLP with partial_fit() performing worse than with fit() in a supervised classification
body: <p>The learning dataset I'm using is a grayscale image that was <code>flatten</code> to have each pixel representing an individual sample. The second image will be classified pixel by pixel after training the <code>Multilayer perceptron</code> (<code>MLP</code>) classifier on the former one.</p>
  
  <p>The problem I have is that the <code>MLP</code> is performing better when it receives the training dataset all at once (<code>fit()</code>) compared to when it is trained by chunks (<code>partial_fit()</code>). I'm keeping the default parameters provided by <code>Scikit-learn</code> in both cases.</p>
  
  <p>I'm asking this question because when the training dataset is in the order of millions of samples, I will have to employ <code>partial_fit()</code> to train the <code>MLP</code> by chunks.</p>
  
  <pre class="lang-py prettyprint-override"><code>def batcherator(data, target, chunksize):
      for i in range(0, len(data), chunksize):
          yield data[i:i+chunksize], target[i:i+chunksize]
  
  def classify():
      classifier = MLPClassifier(verbose=True)
  
      # classifier.fit(training_data, training_target)
  
      gen = batcherator(training.data, training.target, 1000)
      for chunk_data, chunk_target in gen:
          classifier.partial_fit(chunk_data, chunk_target,
                                 classes=np.array([0, 1]))
  
      predictions = classifier.predict(test_data)
  </code></pre>
  
  <p>My question is which parameters should I adjust in the <code>MLP</code> classifier to make its results more acceptable when it's trained by chunks of data?</p>
  
  <p>I've tried to increase the number of neurons in the hidden layer using <code>hidden_layer_sizes</code> but I didn't see any improvement. No improvement either if I change the activation function of the hidden layer from the default <code>relu</code> to <code>logistic</code> using the <code>activation</code> parameter.</p>
  
  <p>Below are the images I'm working on (all of them are <code>512x512</code> images) with a link to the <code>Google Fusion</code> table where they were exported as <code>CSV</code> from the <code>numpy</code> arrays (to leave the image as a float instead of an int):</p>
  
  <p><strong>Training_data:</strong></p>
  
  <p>The white areas are masked out: <a href="https://www.google.com/fusiontables/DataSource?docid=1ZJw6SWK6diN93ZJg6kFAokA_PDfYVwntBUug7orV" rel="nofollow noreferrer">Google Fusion Table (training_data)</a></p>
  
  <p>Class0:</p>
  
  <p><a href="https://i.stack.imgur.com/dq0vd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dq0vd.png" alt="enter image description here"></a></p>
  
  <p>Class1:</p>
  
  <p><a href="https://i.stack.imgur.com/T4Jj8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T4Jj8.png" alt="enter image description here"></a></p>
  
  <p><strong>Training_target:</strong></p>
  
  <p><a href="https://www.google.com/fusiontables/DataSource?docid=1q-97eOrDofJFdlUzyB_oO1vsRoOV9SXr41a_Du7h" rel="nofollow noreferrer">Google Fusion Table (training_target)</a></p>
  
  <p><strong>Test_data:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/B7SDY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B7SDY.png" alt="enter image description here"></a></p>
  
  <p><a href="https://www.google.com/fusiontables/DataSource?docid=1VcUSml-sF_KPN8pttpy9gEONHCQpds-41t-j3Eiu" rel="nofollow noreferrer">Google Fusion Table (test_data)</a></p>
  
  <p><strong>Prediction (with partial_fit):</strong></p>
  
  <p><a href="https://i.stack.imgur.com/WP98W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WP98W.png" alt="enter image description here"></a></p>
  
  <p><a href="https://www.google.com/fusiontables/DataSource?docid=1cQwjgtIwyasoeEDzOzIYn2fPBuD9dFfPatjIvp6e" rel="nofollow noreferrer">Google Fusion Table (predictions)</a></p>