docstr: ...Test fit method of HawkesEM
          
docstr_tok: ["...","Test","fit","method","of","HawkesEM"]
code: def test_hawkes_em_fit_1(self):  # hard-coded
      """...Test fit method of HawkesEM"""
      kernel_support = 3
      kernel_size = 3
      baseline = np.zeros(self.n_nodes) + 0.2
      kernel = np.zeros((self.n_nodes, self.n_nodes, kernel_size)) + 0.4
  
      em = HawkesEM(
          kernel_support=kernel_support,
          kernel_size=kernel_size,
          n_threads=2,
          max_iter=11,
          verbose=False,
      )
      em.fit(self.events, baseline_start=baseline, kernel_start=kernel)
  
      np.testing.assert_array_almost_equal(
          em.baseline, [1.2264, 0.2164, 1.6782], decimal=4
      )
  
      expected_kernel = [
          [
              [2.4569e-02, 2.5128e-06, 0.0000e00],
              [1.8072e-02, 5.4332e-11, 0.0000e00],
              [2.7286e-03, 4.0941e-08, 3.5705e-15],
          ],
          [
              [8.0077e-01, 2.2624e-02, 6.7577e-10],
              [2.7503e-02, 3.1840e-05, 0.0000e00],
              [1.4984e-01, 7.8428e-06, 2.8206e-12],
          ],
          [
              [1.2163e-01, 1.0997e-02, 5.4724e-05],
              [4.7348e-02, 6.6093e-03, 5.5433e-12],
              [1.0662e-03, 5.3920e-05, 1.4930e-08],
          ],
      ]
  
      np.testing.assert_array_almost_equal(
          em.kernel, expected_kernel, decimal=4
      )
  
      em2 = HawkesEM(
          kernel_discretization=np.array([0.0, 1.0, 2.0, 3.0]),
          n_threads=1,
          max_iter=11,
          verbose=False,
      )
      em2.fit(self.events, baseline_start=baseline, kernel_start=kernel)
      np.testing.assert_array_almost_equal(
          em2.kernel, expected_kernel, decimal=4
      )
  
      np.testing.assert_array_almost_equal(
          em.get_kernel_values(1, 0, np.linspace(0, 3, 5)),
          [0.0000e00, 8.0077e-01, 2.2624e-02, 6.7577e-10, 0.0000e00],
          decimal=4,
      )
  
      np.testing.assert_array_almost_equal(
          em.get_kernel_norms(),
          [
              [0.0246, 0.0181, 0.0027],
              [0.8234, 0.0275, 0.1499],
              [0.1327, 0.054, 0.0011],
          ],
          decimal=3,
      )
  
      np.testing.assert_array_equal(
          em.get_kernel_supports(),
          np.ones((self.n_nodes, self.n_nodes)) * 3,
      )
  
imports: import unittest
  import numpy
  from tick.hawkes.inference import HawkesEM
  from tick.hawkes.model.tests.model_hawkes_test_utils import hawkes_intensities, hawkes_log_likelihood
  from tick.hawkes import SimuHawkes, HawkesKernelTimeFunc, HawkesKernelExp, SimuHawkesExpKernels
  from tick.base import TimeFunction
label_desc: Use image node_id 3 for calling the Test obj's underlying member method code with example usage: obj.test_hawkes_em_fit_1() without return types