skglm.experimental.QuantileHuber#
- class skglm.experimental.QuantileHuber(quantile=0.5, delta=1.0)[source]#
Quantile Huber loss for quantile regression.
Implements the smoothed pinball loss:
`\begin{split}\rho_\tau^\delta(r) = \begin{cases} \tau\, r - \dfrac{\delta}{2}, & \text{if } r \ge \delta,\\ \dfrac{\tau r^{2}}{2\delta}, & \text{if } 0 \le r < \delta,\\ \dfrac{(1-\tau) r^{2}}{2\delta}, & \text{if } -\delta < r < 0,\\ (\tau - 1)\, r - \dfrac{\delta}{2}, & \text{if } r \le -\delta. \end{cases}\end{split}`- Parameters:
- quantilefloat, default=0.5
Desired quantile level between 0 and 1.
- deltafloat, default=1.0
Smoothing parameter (0 mean no smoothing).
Methods
__init__([quantile, delta])full_grad_sparse(X_data, X_indptr, ...)Compute full gradient for sparse matrices.
get_global_lipschitz(X, y)get_global_lipschitz_sparse(X_data, ...)Compute global Lipschitz constant for sparse matrices.
get_lipschitz(X, y)get_lipschitz_sparse(X_data, X_indptr, ...)Compute Lipschitz constants for sparse matrices.
get_spec()Specify the numba types of the class attributes.
gradient_scalar(X, y, w, Xw, j)Compute gradient w.r.t.
gradient_scalar_sparse(X_data, X_indptr, ...)Compute gradient w.r.t.
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)inverse_link(Xw)Inverse link function (identity by default).
params_to_dict()Get the parameters to initialize an instance of the class.
value(y, w, Xw)Compute the quantile Huber loss value.