adelie.state.pinball#
- adelie.state.pinball(A: MatrixConstraintBase32 | MatrixConstraintBase64, y_var: float, S: ndarray, penalty_neg: ndarray, penalty_pos: ndarray, kappa: int, max_iters: int, tol: float, screen_set_size: int, screen_set: ndarray, is_screen: ndarray, screen_ASAT_diag: ndarray, screen_AS: ndarray, active_set_size: int, active_set: ndarray, is_active: ndarray, beta: ndarray, resid: ndarray, grad: ndarray, loss: float)[source]#
Creates a pinball state object.
- Parameters:
- A(m, d) Union[MatrixConstraintBase32, MatrixConstraintBase64]
Constraint matrix. It is typically one of the matrices defined in
adelie.matrix
submodule.- y_varfloat
Variance of \(y = S^{-\frac{1}{2}} v\) equivalent to \(\|y\|_2^2\).
- S(d, d) ndarray
Positive semi-definite matrix.
- penalty_neg(m,) ndarray
Penalty on the negative part of \(\beta\).
- penalty_pos(m,) ndarray
Penalty on the positive part of \(\beta\).
- kappaint
Violation batching size.
- max_itersint
Maximum number of coordinate descents.
- tolfloat
Coordinate descent convergence tolerance.
- screen_set_sizeint
Number of screen groups.
screen_set[i]
is only well-defined fori
in the range[0, screen_set_size)
.- screen_set(m,) ndarray
Screen set buffer.
screen_set[i]
is thei
th screen variable that is in the range[0, m)
.- is_screen(m,) ndarray
Boolean vector indicating whether the
j
th feature is screen.- screen_ASAT_diag(m,) ndarray
\(A_j^\top S A_j\) where feature
j
is screen.- screen_AS(m, d) ndarray
\(A_j^\top S\) where feature
j
is screen.- active_set_sizeint
Number of active groups.
active_set[i]
is only well-defined fori
in the range[0, active_set_size)
.- active_set(m,) ndarray
Active set buffer.
active_set[i]
is thei
th active variable that is in the range[0, m)
.- is_active(m,) ndarray
Boolean vector indicating whether the
j
th feature is active.- beta(m,) ndarray
Coefficient vector.
- resid(d,) ndarray
Residual \(v-SA^\top\beta\).
- grad(m,) ndarray
Internal buffer that is implementation-defined.
- lossfloat
The current loss \(\frac{1}{2} \|S^{-\frac{1}{2}} v - S^{\frac{1}{2}} A^\top \beta\|_2^2\).
- Returns:
- wrap
Wrapper state object.