skglm.datafits.Gamma#
- class skglm.datafits.Gamma[source]#
Gamma datafit.
The datafit reads:
`1 / n_"samples" \sum_(i=1)^(n_"samples") ((Xw)_i + y_i exp(-(Xw)_i) - 1 - log(y_i))`Notes
The class is jit compiled at fit time using Numba compiler. This allows for faster computations.
Methods
__init__
()get_spec
()Specify the numba types of the class attributes.
gradient_scalar
(X, y, w, Xw, j)gradient_scalar_sparse
(X_data, X_indptr, ...)initialize
(X, y)Pre-computations before fitting on X and y.
initialize_sparse
(X_data, X_indptr, X_indices, y)Pre-computations before fitting on X and y when X is a sparse matrix.
intercept_update_step
(y, Xw)params_to_dict
()Get the parameters to initialize an instance of the class.
raw_grad
(y, Xw)Compute gradient of datafit w.r.t.
raw_hessian
(y, Xw)Compute Hessian of datafit w.r.t.
value
(y, w, Xw)Value of datafit at vector w.