class_docstr: JoinAEEmbedding is a supervised auto-encoder architecture. It expects
  a class label with each input data. It jointly trains an auto-encoder and
  a classifier model. The classifier model classifies the obtained embedding
  by the provided class label.
class_docstr_tok: ["JoinAEEmbedding","is","a","supervised","auto-encoder","architecture",".","It","expects","a","class","label","with","each","input","data",".","It","jointly","trains","an","auto-encoder","and","a","classifier","model",".","The","classifier","model","classifies","the","obtained","embedding","by","the","provided","class","label","."]
code: def fit(
      self,
      x: Union[pd.DataFrame, np.ndarray],
      y: np.ndarray,
      epochs: int = 5,
      batch_size: int = 128,
      shuffle: bool = True,
      validation_fraction: float = 0.1,
      verbose: int = 1,
      random_seed: int = None,
  ):
      try:
          import tensorflow as tf
      except ImportError:
          raise RuntimeError(
              f"Error: can not import tensorflow library!"
          )
  
      tf.random.set_seed(random_seed)
      x = self.preprocess(x, fit=True)
      y = np.array(y).astype("float32")
  
      assert (
          x.shape[0] == y.shape[0]
      ), f"Error: train x and y size does not match {x.shape[0]} != {y.shape[0]}"
      assert (
          len(y.shape) == 2
      ), f"Error: expects dense representation of classification tags!"
  
      input_shape = x.shape[-1]
      n_classes = y.shape[-1]
      self.build(input_shape=input_shape, n_classes=n_classes)
  
      n = x.shape[0]
      n = int(n * (1.0 - validation_fraction))
      x_train, x_val = x[:n], x[n:]
      y_train, y_val = y[:n], y[n:]
      x_inp = tf.keras.layers.Input(
          input_shape,
      )
      model = tf.keras.Model(
          inputs=x_inp,
          outputs=[
              self._decoder(self._encoder(x_inp)),
              self._classifier(self._encoder(x_inp)),
          ],
      )
  
      model.compile(
          loss=["mean_squared_error", "categorical_crossentropy"],
          optimizer="adam",
      )
  
      if n < self._max_train_records:
          history = model.fit(
              x_train,
              [x_train, y_train],
              validation_data=(x_val, [x_val, y_val]),
              batch_size=batch_size,
              shuffle=shuffle,
              epochs=epochs,
              verbose=verbose,
          )
      else:
          from .utils import JointAESampler
  
          sampler = JointAESampler(
              x_train,
              y_train,
              batch_size=batch_size,
              max_size=self._max_train_records,
          )
          history = model.fit_generator(
              sampler.train_generator, epochs=epochs, verbose=verbose
          )
      self._fitted = True
      return history
  
imports: import numpy
  import pandas
  from abc import ABC, abstractmethod
  from typing import Union, List, Any
  from sklearn.preprocessing import OneHotEncoder, OrdinalEncoder, QuantileTransformer, StandardScaler, MinMaxScaler
label_desc: Use image node_id 3 for calling the JointAEEmbedding obj's underlying member method code with example usage: obj.fit(x, y, epochs, batch_size, shuffle, validation_fraction, verbose, random_seed) and returns: history