code: def image_predict_proba(self, X):
          
          self._check_image(X)
  
          patches, patches_shape = self._to_patches(X)
  
          probabilities = self.classifier.predict_proba(self._transform_input(patches))
  
          image_probabilities = probabilities.reshape(patches_shape[0:3] + (probabilities.shape[1],))
  
          image_results = np.zeros((self._samples,) + self._image_size + (probabilities.shape[1],))
  
          nx, ny = self.receptive_field
          row_steps = self._image_size[0] // nx
          col_steps = self._image_size[1] // ny
  
          # how can this be optimised?
          for i, j, k in itertools.product(range(row_steps), range(col_steps), range(self._samples)):
              image_results[k, nx * i:nx * (i + 1), ny * j:ny * (j + 1), :] = image_probabilities[k, i, j, :]
  
          return image_results
docs: Predicts class probabilities for the entire image.
  
          Parameters:
          -----------
  
          X: array, shape = [n_samples, n_pixels_x, n_pixels_y, n_bands]
              Array of training images
  
          y: array, shape = [n_samples] or [n_samples, n_pixels_x, n_pixels_y, n_classes]
              Target probabilities