skglm.datafits.QuadraticHessian

class skglm.datafits.QuadraticHessian[source]

Quadratic datafit where we pass the Hessian A directly.

The datafit reads:

`1 / 2 x^(\top) A x + \langle b, x \rangle`

For a symmetric A. Up to a constant, it is the same as a Quadratic, with `A = 1 / (n_"samples") X^(\top)X` and `b = - 1 / n_"samples" X^(\top)y`. When the Hessian is available, this datafit is more efficient than using Quadratic.

__init__()[source]

Methods

__init__()

get_lipschitz(A, b)

get_spec()

Specify the numba types of the class attributes.

gradient_scalar(A, b, w, Ax, j)

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.

params_to_dict()

Get the parameters to initialize an instance of the class.

value(b, x, Ax)

Value of datafit at vector w.