code: def test_class_init(self):
      phi = CanonicalDistribution(
          ["x1", ("y", "z"), "x3"],
          np.array([[1.1, -1, 0], [-1, 4, -2], [0, -2, 4]]),
          np.array([[1], [4.7], [-1]]),
          -2,
      )
      self.assertEqual(phi.variables, ["x1", ("y", "z"), "x3"])
      np_test.assert_array_equal(
          phi.K,
          np.array(
              [[1.1, -1, 0], [-1, 4, -2], [0, -2, 4]], dtype=float
          ),
      )
      np_test.assert_array_equal(
          phi.h, np.array([[1], [4.7], [-1]], dtype=float)
      )
      self.assertEqual(phi.g, -2)
  
      phi = CanonicalDistribution(
          ["x1", ("y", "z"), "x3"],
          np.array([[1.1, -1, 0], [-1, 4, -2], [0, -2, 4]]),
          np.array([1, 4.7, -1]),
          -2,
      )
      self.assertEqual(phi.variables, ["x1", ("y", "z"), "x3"])
      np_test.assert_array_equal(
          phi.K,
          np.array(
              [[1.1, -1, 0], [-1, 4, -2], [0, -2, 4]], dtype=float
          ),
      )
      np_test.assert_array_equal(
          phi.h, np.array([[1], [4.7], [-1]], dtype=float)
      )
      self.assertEqual(phi.g, -2)
  
      phi = CanonicalDistribution(["x"], [[1]], [0], 1)
      self.assertEqual(phi.variables, ["x"])
      np_test.assert_array_equal(phi.K, np.array([[1]], dtype=float))
      np_test.assert_array_equal(phi.h, np.array([[0]], dtype=float))
      self.assertEqual(phi.g, 1)
  
file_path: pgmpy/pgmpy/tests/test_factors/test_continuous/test_Canonical_Factor.py
imports: import unittest
  import numpy
  import numpy.testing
  from pgmpy.factors.distributions import GaussianDistribution
  from pgmpy.factors.continuous import CanonicalDistribution
label_desc: Use image node_id 1 for calling the TestCanonicalFactor obj's underlying member method code with example usage: obj.test_class_init() without return types