adelie.state.bvls#
- adelie.state.bvls(X: MatrixNaiveBase32 | MatrixNaiveBase64, y_var: float, X_vars: ndarray, lower: ndarray, upper: ndarray, weights: ndarray, kappa: int, max_iters: int, tol: float, screen_set_size: int, screen_set: ndarray, is_screen: ndarray, active_set_size: int, active_set: ndarray, is_active: ndarray, beta: ndarray, resid: ndarray, grad: ndarray, loss: float)[source]#
Creates a BVLS state object.
- Parameters:
- X(n, p) Union[MatrixNaiveBase32, MatrixNaiveBase64]
Feature matrix. It is typically one of the matrices defined in
adelie.matrix
submodule.- y_varfloat
Variance of \(y\) equivalent to \(y^\top W y\).
- X_vars(p,) ndarray
Variance of each column of
X
equivalent to \(\mathrm{diag}(X^\top W X)\).- lower(p,) ndarray
Lower bound for each variable.
- upper(p,) ndarray
Upper bound for each variable.
- weights(n,) ndarray
Observation weights.
- 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(p,) ndarray
Screen set buffer.
screen_set[i]
is thei
th screen variable that is in the range[0, p)
.- is_screen(p,) ndarray
Boolean vector indicating whether the
j
th feature 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(p,) ndarray
Active set buffer.
active_set[i]
is thei
th active variable that is in the range[0, p)
.- is_active(p,) ndarray
Boolean vector indicating whether the
j
th feature is active.- beta(p,) ndarray
Coefficient vector.
- resid(n,) ndarray
Residual \(y-X\beta\).
- grad(p,) ndarray
Internal buffer that is implementation-defined.
- lossfloat
The current loss \(\frac{1}{2} \|y - X\beta\|_W^2\).
- Returns:
- wrap
Wrapper state object.