code: def test_mixture_of_experts_multi_class_classification(self):
      insize, outsize = (10, 3)
      n_epochs = 10
  
      default_configs = dict(
          step=0.1,
          batch_size=10,
          loss="categorical_crossentropy",
          verbose=False,
      )
  
      architecture = layers.join(
          layers.Input(insize), layers.Relu(20), layers.Softmax(outsize)
      )
  
      data, target = datasets.make_classification(
          n_samples=200,
          n_features=insize,
          n_classes=outsize,
          n_clusters_per_class=2,
          n_informative=5,
      )
  
      input_scaler = preprocessing.MinMaxScaler((-1, 1))
      one_hot = preprocessing.OneHotEncoder(categories="auto")
  
      target = target.reshape((-1, 1))
      encoded_target = one_hot.fit_transform(target)
      (
          x_train,
          x_test,
          y_train,
          y_test,
      ) = model_selection.train_test_split(
          input_scaler.fit_transform(data),
          np.asarray(encoded_target.todense()),
          test_size=0.2,
      )
  
      # -------------- Train single GradientDescent -------------- #
  
      bpnet = algorithms.Momentum(
          copy.deepcopy(architecture), **default_configs
      )
  
      bpnet.train(x_train, y_train, epochs=n_epochs)
      network_output = bpnet.predict(x_test)
  
      network_error = self.eval(
          objectives.categorical_crossentropy(y_test, network_output)
      )
  
      # -------------- Train ensemlbe -------------- #
  
      moe = algorithms.Momentum(
          architectures.mixture_of_experts(
              [
                  copy.deepcopy(architecture),
                  copy.deepcopy(architecture),
                  copy.deepcopy(architecture),
              ]
          ),
          **default_configs,
      )
      moe.train(x_train, y_train, epochs=n_epochs)
      ensemble_output = moe.predict(x_test)
  
      ensemlbe_error = self.eval(
          objectives.categorical_crossentropy(y_test, ensemble_output)
      )
  
      self.assertGreater(network_error, ensemlbe_error)
  
file_path: neupy/tests/architectures/test_mixtures_of_experts.py
imports: import copy
  import numpy
  from sklearn import datasets, preprocessing, model_selection
  from neupy.utils import asfloat
  from neupy.exceptions import LayerConnectionError
  from neupy.algorithms.gd import objectives
  from neupy import algorithms, layers, architectures
  from base import BaseTestCase
label_desc: Use image node_id 7 for calling the MixtureOfExpertsTestCase obj's underlying member method code with example usage: obj.test_mixture_of_experts_multi_class_classification() without return types