class_docstr: Self-Concordant Proximal Gradient descent
  
  For the minimization of objectives of the form
  
  .. math::
      f(w) + g(w),
  
  where :math:`f` is self-concordant and :math:`g` is prox-capable.
  Function :math:`f` corresponds to the ``model.loss`` method of the model
  (passed with ``set_model`` to the solver) and :math:`g` corresponds to
  the ``prox.value`` method of the prox (passed with the ``set_prox`` method).
  One iteration of :class:`SCPG <tick.solver.SCPG>` is as follows:
  
  .. math::
      y^k &\gets \mathrm{prox}_{g / L_k} \big( w^k - \tfrac{1}{L_k}
      \nabla f(w^k) \big) \\
      d^k &\gets y^k - w^k \\
      \beta_k &\gets \sqrt{L_k} \| d^k \|_2 \\
      \lambda_k &\gets \sqrt{{d^k}^\top \nabla^2 f(w^k) d^k} \\
      \alpha_k &\gets \frac{\beta_k}{\lambda_k (\lambda_k +
      \beta_k^2)} \\
      w^{k + 1} &\gets w^{k} + \alpha_k d^k \\
  
  where :math:`\nabla f(w)` is the gradient of :math:`f` given by the
  ``model.grad`` method and :math:`\mathrm{prox}_{g / L_k}` is given by the
  ``prox.call`` method. The first step size :math:`1 / L_k` can be tuned with
  ``step`` it will then be updated with Barzilai-Borwein steps and linesearch.
  The iterations stop whenever tolerance ``tol`` is achieved, or after
  ``max_iter`` iterations. The obtained solution :math:`w` is returned
  by the ``solve`` method, and is also stored in the ``solution`` attribute
  of the solver.
  
  Parameters
  ----------
  step : `float`, default=None
      Step-size parameter that will be used at the first iteration. Then
      the linesearch algorithm will compute the next steps.
  
  tol : `float`, default=1e-10
      The tolerance of the solver (iterations stop when the stopping
      criterion is below it)
  
  max_iter : `int`, default=100
      Maximum number of iterations of the solver.
  
  verbose : `bool`, default=True
      If `True`, solver verboses history, otherwise nothing is displayed,
      but history is recorded anyway
  
  print_every : `int`, default=10
      Print history information every time the iteration number is a
      multiple of ``print_every``. Used only is ``verbose`` is True
  
  record_every : `int`, default=1
      Save history information every time the iteration number is a
      multiple of ``record_every``
  
  linesearch_step_increase : `float`, default=2.
      Factor of step increase when using linesearch
  
  linesearch_step_decrease : `float`, default=0.5
      Factor of step decrease when using linesearch
  
  modified : `bool`, default=False
      Enables modified verison. The modified version of this algorithm
      consists in evaluating :math:`f` at :math:`y_k` and :math:`w^{k+1}`
      and keeping the iterate that minimizes the best :math:`f`.
  
  dtype : `{'float64', 'float32'}`, default='float64'
      Type of the arrays used. This value is set from model and prox dtypes.
  
  Attributes
  ----------
  model : `Model`
      The model used by the solver, passed with the ``set_model`` method
  
  prox : `Prox`
      Proximal operator used by the solver, passed with the ``set_prox``
      method
  
  solution : `numpy.array`, shape=(n_coeffs,)
      Minimizer found by the solver
  
  history : `dict`-like
      A dict-type of object that contains history of the solver along
      iterations. It should be accessed using the ``get_history`` method
  
  time_start : `str`
      Start date of the call to ``solve()``
  
  time_elapsed : `float`
      Duration of the call to ``solve()``, in seconds
  
  time_end : `str`
      End date of the call to ``solve()``
  
  Notes
  -----
  This algorithm is designed to work properly with self-concordant losses
  such as Poisson regression with linear link
  `ModelPoisReg <tick.optim.model.ModelPoisReg>` or Hawkes processes likelihood
  `ModelHawkesSumExpKernLogLik <tick.optim.model.ModelHawkesSumExpKernLogLik>`
  
  References
  ----------
  Tran-Dinh Q, Kyrillidis A, Cevher V. Composite self-concordant
  minimization. *The Journal of Machine Learning Research* (2015)
class_docstr_tok: ["Self-Concordant","Proximal","Gradient","descent","For","the","minimization","of","objectives","of","the","form","..","math",":",":","f","(","w",")","+","g","(","w",")",",","where",":","math",":","`","f","`","is","self-concordant","and",":","math",":","`","g","`","is","prox-capable",".","Function",":","math",":","`","f","`","corresponds","to","the","``","model.loss","``","method","of","the","model","(","passed","with","``","set_model","``","to","the","solver",")","and",":","math",":","`","g","`","corresponds","to","the","``","prox.value","``","method","of","the","prox","(","passed","with","the","``","set_prox","``","method",")",".","One","iteration","of",":","class",":","`","SCPG","<","tick.solver.SCPG",">","`","is","as","follows",":","..","math",":",":","y^k","&","\\gets","\\mathrm","{","prox","}","_","{","g","\/","L_k","}","\\big","(","w^k","-","\\tfrac","{","1","}","{","L_k","}","\\nabla","f","(","w^k",")","\\big",")","\\\\","d^k","&","\\gets","y^k","-","w^k","\\\\","\\beta_k","&","\\gets","\\sqrt","{","L_k","}","\\|","d^k","\\|_2","\\\\","\\lambda_k","&","\\gets","\\sqrt","{","{","d^k","}","^\\top","\\nabla^2","f","(","w^k",")","d^k","}","\\\\","\\alpha_k","&","\\gets","\\frac","{","\\beta_k","}","{","\\lambda_k","(","\\lambda_k","+","\\beta_k^2",")","}","\\\\","w^","{","k","+","1","}","&","\\gets","w^","{","k","}","+","\\alpha_k","d^k","\\\\","where",":","math",":","`","\\nabla","f","(","w",")","`","is","the","gradient","of",":","math",":","`","f","`","given","by","the","``","model.grad","``","method","and",":","math",":","`","\\mathrm","{","prox","}","_","{","g","\/","L_k","}","`","is","given","by","the","``","prox.call","``","method",".","The","first","step","size",":","math",":","`","1","\/","L_k","`","can","be","tuned","with","``","step","``","it","will","then","be","updated","with","Barzilai-Borwein","steps","and","linesearch",".","The","iterations","stop","whenever","tolerance","``","tol","``","is","achieved",",","or","after","``","max_iter","``","iterations",".","The","obtained","solution",":","math",":","`","w","`","is","returned","by","the","``","solve","``","method",",","and","is","also","stored","in","the","``","solution","``","attribute","of","the","solver",".","Parameters","--","--","--","--","--","step",":","`","float","`",",","default=None","Step-size","parameter","that","will","be","used","at","the","first","iteration",".","Then","the","linesearch","algorithm","will","compute","the","next","steps",".","tol",":","`","float","`",",","default=1e-10","The","tolerance","of","the","solver","(","iterations","stop","when","the","stopping","criterion","is","below","it",")","max_iter",":","`","int","`",",","default=100","Maximum","number","of","iterations","of","the","solver",".","verbose",":","`","bool","`",",","default=True","If","`","True","`",",","solver","verboses","history",",","otherwise","nothing","is","displayed",",","but","history","is","recorded","anyway","print_every",":","`","int","`",",","default=10","Print","history","information","every","time","the","iteration","number","is","a","multiple","of","``","print_every","``",".","Used","only","is","``","verbose","``","is","True","record_every",":","`","int","`",",","default=1","Save","history","information","every","time","the","iteration","number","is","a","multiple","of","``","record_every","``","linesearch_step_increase",":","`","float","`",",","default=2",".","Factor","of","step","increase","when","using","linesearch","linesearch_step_decrease",":","`","float","`",",","default=0.5","Factor","of","step","decrease","when","using","linesearch","modified",":","`","bool","`",",","default=False","Enables","modified","verison",".","The","modified","version","of","this","algorithm","consists","in","evaluating",":","math",":","`","f","`","at",":","math",":","`","y_k","`","and",":","math",":","`","w^","{","k+1","}","`","and","keeping","the","iterate","that","minimizes","the","best",":","math",":","`","f","`",".","dtype",":","`","{","'float64","'",",","'float32","'","}","`",",","default='float64'","Type","of","the","arrays","used",".","This","value","is","set","from","model","and","prox","dtypes",".","Attributes","--","--","--","--","--","model",":","`","Model","`","The","model","used","by","the","solver",",","passed","with","the","``","set_model","``","method","prox",":","`","Prox","`","Proximal","operator","used","by","the","solver",",","passed","with","the","``","set_prox","``","method","solution",":","`","numpy.array","`",",","shape=","(","n_coeffs",",",")","Minimizer","found","by","the","solver","history",":","`","dict","`","-like","A","dict-type","of","object","that","contains","history","of","the","solver","along","iterations",".","It","should","be","accessed","using","the","``","get_history","``","method","time_start",":","`","str","`","Start","date","of","the","call","to","``","solve","(",")","``","time_elapsed",":","`","float","`","Duration","of","the","call","to","``","solve","(",")","``",",","in","seconds","time_end",":","`","str","`","End","date","of","the","call","to","``","solve","(",")","``","Notes","--","--","-","This","algorithm","is","designed","to","work","properly","with","self-concordant","losses","such","as","Poisson","regression","with","linear","link","`","ModelPoisReg","<","tick.optim.model.ModelPoisReg",">","`","or","Hawkes","processes","likelihood","`","ModelHawkesSumExpKernLogLik","<","tick.optim.model.ModelHawkesSumExpKernLogLik",">","`","References","--","--","--","--","--","Tran-Dinh","Q",",","Kyrillidis","A",",","Cevher","V.","Composite","self-concordant","minimization",".","*","The","Journal","of","Machine","Learning","Research","*","(","2015",")"]
docstr: Updates the history of the solver.
          
docstr_tok: ["Updates","the","history","of","the","solver","."]
code: def _handle_history(self, n_iter: int, force: bool = False, **kwargs):
      """Updates the history of the solver."""
      if n_iter == 1:
          self._set(
              "_initial_n_hessiannorm_calls",
              self.model.n_calls_hessian_norm,
          )
  
      hessiannorm_calls = (
          self.model.n_calls_hessian_norm
          - self._initial_n_hessiannorm_calls
      )
      SolverFirstOrder._handle_history(
          self,
          n_iter,
          force=force,
          n_calls_hessiannorm=hessiannorm_calls,
          **kwargs,
      )
  
file_path: tick/tick/solver/scpg.py
imports: import numpy
  from numpy.linalg import norm
  from tick.base_model import ModelSecondOrder
  from tick.prox.base import Prox
  from .base import SolverFirstOrder
  from .base.utils import relative_distance
label_desc: Use image node_id 9 for calling the SCPG obj's underlying member method code with example usage: obj._handle_history(n_iter, force) without return types