code: def test_cmac(self):
      X_train = np.reshape(np.linspace(0, 2 * np.pi, 100), (100, 1))
      X_train_before = X_train.copy()
  
      X_test = np.reshape(np.linspace(np.pi, 2 * np.pi, 50), (50, 1))
  
      y_train = np.sin(X_train)
      y_train_before = y_train.copy()
      y_test = np.sin(X_test)
  
      cmac = algorithms.CMAC(
          quantization=100,
          associative_unit_size=32,
          step=0.2,
          verbose=False,
      )
      cmac.train(X_train, y_train, epochs=100)
  
      predicted_test = cmac.predict(X_test)
      predicted_test = predicted_test.reshape((len(predicted_test), 1))
      error = metrics.mean_absolute_error(y_test, predicted_test)
  
      self.assertAlmostEqual(error, 0.0024, places=4)
  
      # Test that algorithm didn't modify data samples
      np.testing.assert_array_equal(X_train, X_train_before)
      np.testing.assert_array_equal(X_train, X_train_before)
      np.testing.assert_array_equal(y_train, y_train_before)
  
      self.assertPickledNetwork(cmac, X_train)
  
file_path: neupy/tests/algorithms/memory/test_cmac.py
imports: import numpy
  from sklearn import metrics
  from neupy import algorithms
  from base import BaseTestCase
label_desc: Use image node_id 1 for calling the CMACTestCase obj's underlying member method code with example usage: obj.test_cmac() without return types