class_docstr: Abstract class for a model. It describes a zero-order model,
  namely only with the ability to compute a loss (goodness-of-fit
  criterion).
  
  Attributes
  ----------
  n_coeffs : `int` (read-only)
      Total number of coefficients of the model
  
  n_calls_loss : `int` (read-only)
      Number of times ``loss`` has been called so far
  
  n_passes_over_data : `int` (read-only)
      Number of effective passes through the data
  
  dtype : `{'float64', 'float32'}`
      Type of the data arrays used.
  
  Notes
  -----
  This class should be not used by end-users, it is intended for
  development only.
class_docstr_tok: ["Abstract","class","for","a","model",".","It","describes","a","zero-order","model",",","namely","only","with","the","ability","to","compute","a","loss","(","goodness-of-fit","criterion",")",".","Attributes","--","--","--","--","--","n_coeffs",":","`","int","`","(","read-only",")","Total","number","of","coefficients","of","the","model","n_calls_loss",":","`","int","`","(","read-only",")","Number","of","times","``","loss","``","has","been","called","so","far","n_passes_over_data",":","`","int","`","(","read-only",")","Number","of","effective","passes","through","the","data","dtype",":","`","{","'float64","'",",","'float32","'","}","`","Type","of","the","data","arrays","used",".","Notes","--","--","-","This","class","should","be","not","used","by","end-users",",","it","is","intended","for","development","only","."]
docstr: Computes the value of the goodness-of-fit at ``coeffs``
  
  Parameters
  ----------
  coeffs : `numpy.ndarray`
      The loss is computed at this point
  
  Returns
  -------
  output : `float`
      The value of the loss
  
  Notes
  -----
  The ``fit`` method must be called to give data to the model,
  before using ``loss``. An error is raised otherwise.
docstr_tok: ["Computes","the","value","of","the","goodness-of-fit","at","``","coeffs","``","Parameters","--","--","--","--","--","coeffs",":","`","numpy.ndarray","`","The","loss","is","computed","at","this","point","Returns","--","--","--","-","output",":","`","float","`","The","value","of","the","loss","Notes","--","--","-","The","``","fit","``","method","must","be","called","to","give","data","to","the","model",",","before","using","``","loss","``",".","An","error","is","raised","otherwise","."]
code: def loss(self, coeffs: np.ndarray) -> float:
      """Computes the value of the goodness-of-fit at ``coeffs``
  
      Parameters
      ----------
      coeffs : `numpy.ndarray`
          The loss is computed at this point
  
      Returns
      -------
      output : `float`
          The value of the loss
  
      Notes
      -----
      The ``fit`` method must be called to give data to the model,
      before using ``loss``. An error is raised otherwise.
      """
      # This is a bit of a hack as I don't see how to control the dtype of
      #  coeffs returning from scipy through lambdas
      if coeffs.dtype != self.dtype:
          warnings.warn(
              "coeffs vector of type {} has been cast to {}".format(
                  coeffs.dtype, self.dtype
              )
          )
          coeffs = coeffs.astype(self.dtype)
  
      if not self._fitted:
          raise ValueError("call ``fit`` before using ``loss``")
      if coeffs.shape[0] != self.n_coeffs:
          raise ValueError(
              (
                  "``coeffs`` has size %i while the model"
                  + " expects %i coefficients"
              )
              % (coeffs.shape[0], self.n_coeffs)
          )
      self._inc_attr(N_CALLS_LOSS)
      self._inc_attr(PASS_OVER_DATA, step=self.pass_per_operation[LOSS])
  
      return self._loss(coeffs)
  
file_path: tick/tick/base_model/model.py
imports: import warnings
  from abc import ABC, abstractmethod
  import numpy
  from tick.base import Base
label_desc: Use image node_id 6 for calling the Model obj's underlying member method code with example usage: obj.loss(coeffs) and returns: self