docstr: ...Test that ModelHawkesExpKernLeastSq can be serialized
          
docstr_tok: ["...","Test","that","ModelHawkesExpKernLeastSq","can","be","serialized"]
code: def test_model_hawkes_sum_exp_least_sq_serialization(self):
      """...Test that ModelHawkesExpKernLeastSq can be serialized"""
      import os
  
      file_name = "model.pickle"
  
      for model in [self.model, self.model_list]:
          model.period_length = 1.0
          model.n_baselines = 3
          model._model.compute_weights()
  
          with open(file_name, "wb") as write_file:
              pickle.dump(model, write_file)
  
          with open(file_name, "rb") as read_file:
              pickled = pickle.load(read_file)
  
          self.assertEqual(model.n_nodes, pickled.n_nodes)
          np.testing.assert_equal(model.decays, pickled.decays)
          self.assertEqual(model.n_jumps, pickled.n_jumps)
  
          self.assertEqual(model.n_coeffs, pickled.n_coeffs)
          self.assertEqual(model.n_threads, pickled.n_threads)
          np.testing.assert_equal(model.data, pickled.data)
          coeffs = np.random.rand(model.n_coeffs)
          self.assertEqual(model.loss(coeffs), pickled.loss(coeffs))
  
      os.remove(file_name)
  
imports: import pickle
  import unittest
  import numpy
  from numpy.linalg import norm
  from scipy.optimize import check_grad, fmin_bfgs
  from tick.base.inference import InferenceTest
  from tick.hawkes.model import ModelHawkesSumExpKernLeastSq
  from tick.hawkes.model.tests.model_hawkes_test_utils import hawkes_sumexp_kernel_intensities, hawkes_sumexp_kernel_varying_intensities, hawkes_least_square_error
label_desc: Use image node_id 12 for calling the Test obj's underlying member method code with example usage: obj.test_model_hawkes_sum_exp_least_sq_serialization() without return types