class_docstr: A class that implements parametric inference for Hawkes processes
  with an exponential parametrisation of the kernels and a mix of Lasso
  and nuclear regularization
  
  Hawkes processes are point processes defined by the intensity:
  
  .. math::
      \forall i \in [1 \dots D], \quad
      \lambda_i(t) = \mu_i + \sum_{j=1}^D
      \sum_{t_k^j < t} \phi_{ij}(t - t_k^j)
  
  where
  
  * :math:`D` is the number of nodes
  * :math:`\mu_i` are the baseline intensities
  * :math:`\phi_{ij}` are the kernels
  * :math:`t_k^j` are the timestamps of all events of node :math:`j`
  
  and with an exponential parametrisation of the kernels
  
  .. math::
      \phi_{ij}(t) = \alpha^{ij} \beta \exp (- \beta t) 1_{t > 0}
  
  In our implementation we denote:
  
  * Integer :math:`D` by the attribute `n_nodes`
  * Vector :math:`\mu \in \mathbb{R}^{D}` by the attribute
    `baseline`
  * Matrix :math:`A = (\alpha^{ij})_{ij} \in \mathbb{R}^{D \times D}`
    by the attribute `adjacency`
  * Number :math:`\beta \in \mathbb{R}` by the parameter `decay`. This
    parameter is given to the model
  
  Parameters
  ----------
  decay : `float`
      The decay used in the exponential kernel
  
  C : `float`, default=1e3
      Level of penalization
  
  lasso_nuclear_ratio : `float`, default=0.5
      Ratio of Lasso-Nuclear regularization mixing parameter with
      0 <= ratio <= 1.
  
      * For ratio = 0 this is nuclear regularization
      * For ratio = 1 this is lasso (L1) regularization
      * For 0 < ratio < 1, the regularization is a linear combination
        of Lasso and nuclear.
  
  max_iter : `int`, default=50
      Maximum number of iterations of the solving algorithm
  
  tol : `float`, default=1e-5
      The tolerance of the solving algorithm (iterations stop when the
      stopping criterion is below it). If not reached it does ``max_iter``
      iterations
  
  verbose : `bool`, default=False
      If `True`, we verbose things
  
  n_threads : `int`, default=1
      Number of threads used for parallel computation.
  
      * if `int <= 0`: the number of physical cores available on the CPU
      * otherwise the desired number of threads
  
  print_every : `int`, default=10
      Print history information when ``n_iter`` (iteration number) is
      a multiple of ``print_every``
  
  record_every : `int`, default=10
      Record history information when ``n_iter`` (iteration number) is
      a multiple of ``record_every``
  
  Other Parameters
  ----------------
  rho : `float`, default=0.1
      Positive parameter of the augmented Lagrangian. Called penalty
      parameter, the higher it is, the more strict will be the
      penalization.
  
  approx : `int`, default=0 (read-only)
      Level of approximation used for computing exponential functions
  
      * if 0: no approximation
      * if 1: a fast approximated exponential function is used
  
  em_max_iter : `int`, default=30
      Maximum number of loop for inner em algorithm.
  
  em_tol : `float`, default=None
      Tolerance of loop for inner em algorithm. If relative difference of
      baseline and adjacency goes bellow this tolerance, em inner loop
      will stop.
      If None, it will be set given a heuristic which look at last
      relative difference obtained in the main loop.
  
  Attributes
  ----------
  n_nodes : `int`
      Number of nodes / components in the Hawkes model
  
  baseline : `np.array`, shape=(n_nodes,)
      Inferred baseline of each component's intensity
  
  adjacency : `np.ndarray`, shape=(n_nodes, n_nodes)
      Inferred adjacency matrix
  
  References
  ----------
  Zhou, K., Zha, H., & Song, L. (2013, May).
  Learning Social Infectivity in Sparse Low-rank Networks Using
  Multi-dimensional Hawkes Processes. In `AISTATS (Vol. 31, pp. 641-649)
  <http://www.jmlr.org/proceedings/papers/v31/zhou13a.pdf>`_.
class_docstr_tok: ["A","class","that","implements","parametric","inference","for","Hawkes","processes","with","an","exponential","parametrisation","of","the","kernels","and","a","mix","of","Lasso","and","nuclear","regularization","Hawkes","processes","are","point","processes","defined","by","the","intensity",":","..","math",":",":","\\forall","i","\\in","[","1","\\dots","D","]",",","\\quad","\\lambda_i","(","t",")","=","\\mu_i","+","\\sum_","{","j=1","}","^D","\\sum_","{","t_k^j","<","t","}","\\phi_","{","ij","}","(","t","-","t_k^j",")","where","*",":","math",":","`","D","`","is","the","number","of","nodes","*",":","math",":","`","\\mu_i","`","are","the","baseline","intensities","*",":","math",":","`","\\phi_","{","ij","}","`","are","the","kernels","*",":","math",":","`","t_k^j","`","are","the","timestamps","of","all","events","of","node",":","math",":","`","j","`","and","with","an","exponential","parametrisation","of","the","kernels","..","math",":",":","\\phi_","{","ij","}","(","t",")","=","\\alpha^","{","ij","}","\\beta","\\exp","(","-","\\beta","t",")","1_","{","t",">","0","}","In","our","implementation","we","denote",":","*","Integer",":","math",":","`","D","`","by","the","attribute","`","n_nodes","`","*","Vector",":","math",":","`","\\mu","\\in","\\mathbb","{","R","}","^","{","D","}","`","by","the","attribute","`","baseline","`","*","Matrix",":","math",":","`","A","=","(","\\alpha^","{","ij","}",")","_","{","ij","}","\\in","\\mathbb","{","R","}","^","{","D","\\times","D","}","`","by","the","attribute","`","adjacency","`","*","Number",":","math",":","`","\\beta","\\in","\\mathbb","{","R","}","`","by","the","parameter","`","decay","`",".","This","parameter","is","given","to","the","model","Parameters","--","--","--","--","--","decay",":","`","float","`","The","decay","used","in","the","exponential","kernel","C",":","`","float","`",",","default=1e3","Level","of","penalization","lasso_nuclear_ratio",":","`","float","`",",","default=0.5","Ratio","of","Lasso-Nuclear","regularization","mixing","parameter","with","0","<","=","ratio","<","=","1",".","*","For","ratio","=","0","this","is","nuclear","regularization","*","For","ratio","=","1","this","is","lasso","(","L1",")","regularization","*","For","0","<","ratio","<","1",",","the","regularization","is","a","linear","combination","of","Lasso","and","nuclear",".","max_iter",":","`","int","`",",","default=50","Maximum","number","of","iterations","of","the","solving","algorithm","tol",":","`","float","`",",","default=1e-5","The","tolerance","of","the","solving","algorithm","(","iterations","stop","when","the","stopping","criterion","is","below","it",")",".","If","not","reached","it","does","``","max_iter","``","iterations","verbose",":","`","bool","`",",","default=False","If","`","True","`",",","we","verbose","things","n_threads",":","`","int","`",",","default=1","Number","of","threads","used","for","parallel","computation",".","*","if","`","int","<","=","0","`",":","the","number","of","physical","cores","available","on","the","CPU","*","otherwise","the","desired","number","of","threads","print_every",":","`","int","`",",","default=10","Print","history","information","when","``","n_iter","``","(","iteration","number",")","is","a","multiple","of","``","print_every","``","record_every",":","`","int","`",",","default=10","Record","history","information","when","``","n_iter","``","(","iteration","number",")","is","a","multiple","of","``","record_every","``","Other","Parameters","--","--","--","--","--","--","--","--","rho",":","`","float","`",",","default=0.1","Positive","parameter","of","the","augmented","Lagrangian",".","Called","penalty","parameter",",","the","higher","it","is",",","the","more","strict","will","be","the","penalization",".","approx",":","`","int","`",",","default=0","(","read-only",")","Level","of","approximation","used","for","computing","exponential","functions","*","if","0",":","no","approximation","*","if","1",":","a","fast","approximated","exponential","function","is","used","em_max_iter",":","`","int","`",",","default=30","Maximum","number","of","loop","for","inner","em","algorithm",".","em_tol",":","`","float","`",",","default=None","Tolerance","of","loop","for","inner","em","algorithm",".","If","relative","difference","of","baseline","and","adjacency","goes","bellow","this","tolerance",",","em","inner","loop","will","stop",".","If","None",",","it","will","be","set","given","a","heuristic","which","look","at","last","relative","difference","obtained","in","the","main","loop",".","Attributes","--","--","--","--","--","n_nodes",":","`","int","`","Number","of","nodes","\/","components","in","the","Hawkes","model","baseline",":","`","np.array","`",",","shape=","(","n_nodes",",",")","Inferred","baseline","of","each","component","'s","intensity","adjacency",":","`","np.ndarray","`",",","shape=","(","n_nodes",",","n_nodes",")","Inferred","adjacency","matrix","References","--","--","--","--","--","Zhou",",","K.",",","Zha",",","H.",",","&","Song",",","L.","(","2013",",","May",")",".","Learning","Social","Infectivity","in","Sparse","Low-rank","Networks","Using","Multi-dimensional","Hawkes","Processes",".","In","`","AISTATS","(","Vol",".","31",",","pp",".","641-649",")","<","http",":","\/\/www.jmlr.org\/proceedings\/papers\/v31\/zhou13a.pdf",">","`","_","."]
docstr: Compute score metric
  Score metric is log likelihood (the higher the better)
  
  Parameters
  ----------
  events : `list` of `list` of `np.ndarray`, default = None
      List of Hawkes processes realizations used to measure score.
      Each realization of the Hawkes process is a list of n_node for
      each component of the Hawkes. Namely `events[i][j]` contains a
      one-dimensional `numpy.array` of the events' timestamps of
      component j of realization i.
      If only one realization is given, it will be wrapped into a list
      If None, events given while fitting model will be used
  
  end_times : `np.ndarray` or `float`, default = None
      List of end time of all hawkes processes used to measure score.
      If None, it will be set to each realization's latest time.
      If only one realization is provided, then a float can be given.
  
  baseline : `np.ndarray`, shape=(n_nodes, ), default = None
      Baseline vector for which the score is measured
      If `None` baseline obtained during fitting is used
  
  adjacency : `np.ndarray`, shape=(n_nodes, n_nodes), default = None
      Adjacency matrix for which the score is measured
      If `None` adjacency obtained during fitting is used
  
  Returns
  -------
  likelihood : `double`
      Computed log likelihood value
docstr_tok: ["Compute","score","metric","Score","metric","is","log","likelihood","(","the","higher","the","better",")","Parameters","--","--","--","--","--","events",":","`","list","`","of","`","list","`","of","`","np.ndarray","`",",","default","=","None","List","of","Hawkes","processes","realizations","used","to","measure","score",".","Each","realization","of","the","Hawkes","process","is","a","list","of","n_node","for","each","component","of","the","Hawkes",".","Namely","`","events","[","i","]","[","j","]","`","contains","a","one-dimensional","`","numpy.array","`","of","the","events","'","timestamps","of","component","j","of","realization","i",".","If","only","one","realization","is","given",",","it","will","be","wrapped","into","a","list","If","None",",","events","given","while","fitting","model","will","be","used","end_times",":","`","np.ndarray","`","or","`","float","`",",","default","=","None","List","of","end","time","of","all","hawkes","processes","used","to","measure","score",".","If","None",",","it","will","be","set","to","each","realization","'s","latest","time",".","If","only","one","realization","is","provided",",","then","a","float","can","be","given",".","baseline",":","`","np.ndarray","`",",","shape=","(","n_nodes",",",")",",","default","=","None","Baseline","vector","for","which","the","score","is","measured","If","`","None","`","baseline","obtained","during","fitting","is","used","adjacency",":","`","np.ndarray","`",",","shape=","(","n_nodes",",","n_nodes",")",",","default","=","None","Adjacency","matrix","for","which","the","score","is","measured","If","`","None","`","adjacency","obtained","during","fitting","is","used","Returns","--","--","--","-","likelihood",":","`","double","`","Computed","log","likelihood","value"]
code: def score(
      self, events=None, end_times=None, baseline=None, adjacency=None
  ):
      """Compute score metric
      Score metric is log likelihood (the higher the better)
  
      Parameters
      ----------
      events : `list` of `list` of `np.ndarray`, default = None
          List of Hawkes processes realizations used to measure score.
          Each realization of the Hawkes process is a list of n_node for
          each component of the Hawkes. Namely `events[i][j]` contains a
          one-dimensional `numpy.array` of the events' timestamps of
          component j of realization i.
          If only one realization is given, it will be wrapped into a list
          If None, events given while fitting model will be used
  
      end_times : `np.ndarray` or `float`, default = None
          List of end time of all hawkes processes used to measure score.
          If None, it will be set to each realization's latest time.
          If only one realization is provided, then a float can be given.
  
      baseline : `np.ndarray`, shape=(n_nodes, ), default = None
          Baseline vector for which the score is measured
          If `None` baseline obtained during fitting is used
  
      adjacency : `np.ndarray`, shape=(n_nodes, n_nodes), default = None
          Adjacency matrix for which the score is measured
          If `None` adjacency obtained during fitting is used
  
      Returns
      -------
      likelihood : `double`
          Computed log likelihood value
      """
      if events is None and not self._fitted:
          raise ValueError(
              "You must either call `fit` before `score` or "
              "provide events"
          )
  
      if baseline is not None or adjacency is not None:
          if baseline is None:
              baseline = self.baseline
          if adjacency is None:
              adjacency = self.adjacency
          coeffs = np.hstack((baseline, adjacency.ravel()))
      else:
          coeffs = self.coeffs
  
      if events is None and end_times is None:
          model = self._model
      else:
          model = ModelHawkesExpKernLogLik(
              self.decay, n_threads=self.n_threads
          )
          model.fit(events, end_times)
  
      return -model.loss(coeffs)
  
imports: import numpy
  from tick.hawkes import ModelHawkesExpKernLogLik, SimuHawkesExpKernels
  from tick.hawkes.inference.base import LearnerHawkesNoParam
  from tick.hawkes.inference.build.hawkes_inference import HawkesADM4
  from tick.prox import ProxNuclear
  from tick.prox.prox_l1 import ProxL1
  from tick.solver.base.utils import relative_distance
label_desc: Use image node_id 17 for calling the HawkesADM4 obj's underlying member method code with example usage: obj.score(events, end_times, baseline, adjacency) and returns: unknown