class_docstr: Base class for MLP classification and regression.
  
  Warning: This class should not be used directly.
  Use derived classes instead.
  
  .. versionadded:: 0.18
code: def _initialize(self, y, layer_units):
      # set all attributes, allocate weights etc for first call
      # Initialize parameters
      self.n_iter_ = 0
      self.t_ = 0
      self.n_outputs_ = y.shape[1]
  
      # Compute the number of layers
      self.n_layers_ = len(layer_units)
  
      # Output for regression
      if not isinstance(self, ClassifierMixin):
          self.out_activation_ = "identity"
      # Output for multi class
      elif self._label_binarizer.y_type_ == "multiclass":
          self.out_activation_ = "softmax"
      # Output for binary class and multi-label
      else:
          self.out_activation_ = "logistic"
  
      # Initialize coefficient and intercept layers
      self.coefs_ = []
      self.intercepts_ = []
  
      for i in range(self.n_layers_ - 1):
          coef_init, intercept_init = self._init_coef(
              layer_units[i], layer_units[i + 1]
          )
          self.coefs_.append(coef_init)
          self.intercepts_.append(intercept_init)
  
      if self.solver in _STOCHASTIC_SOLVERS:
          self.loss_curve_ = []
          self._no_improvement_count = 0
          if self.early_stopping:
              self.validation_scores_ = []
              self.best_validation_score_ = -np.inf
          else:
              self.best_loss_ = np.inf
  
imports: import numpy
  from abc import ABCMeta, abstractmethod
  from scipy.optimize import fmin_l_bfgs_b
  import warnings
  from ..base import BaseEstimator, ClassifierMixin, RegressorMixin
  from ._base import ACTIVATIONS, DERIVATIVES, LOSS_FUNCTIONS
  from ._stochastic_optimizers import SGDOptimizer, AdamOptimizer
  from ..model_selection import train_test_split
  from ..externals import six
  from ..preprocessing import LabelBinarizer
  from ..utils import gen_batches, check_random_state
  from ..utils import shuffle
  from ..utils import check_array, check_X_y, column_or_1d
  from ..exceptions import ConvergenceWarning
  from ..utils.extmath import safe_sparse_dot
  from ..utils.validation import check_is_fitted
  from ..utils.multiclass import _check_partial_fit_first_call, unique_labels
  from ..utils.multiclass import type_of_target
label_desc: Use image node_id 7 for calling the BaseMultilayerPerceptron obj's underlying member method code with example usage: obj._initialize(y, layer_units) without return types