adelie.adelie_core.state.StateGaussianPinCov32#
- class adelie.adelie_core.state.StateGaussianPinCov32#
Core state class for Gaussian, pin, covariance method.
Methods
__init__(*args, **kwargs)Overloaded function.
solve(self)Solves the state-specific problem.
Attributes
Positive semi-definite matrix \(A\).
List of indices that index a corresponding list of values for each active group.
Ordering such that
groupsis sorted in ascending order for the active groups.List of indices into
screen_setthat correspond to active groups.Number of active groups.
Percent deviance explained tolerance.
Elastic net parameter.
Benchmark time for performing coordinate-descent on the active set for each \(\lambda\).
Benchmark time for performing coordinate-descent on the screen set for each \(\lambda\).
betas[i]is the solution atlmdas[i].Max constraint buffer size.
List of constraints for each group.
Difference in percent deviance explained tolerance.
List of group sizes corresponding to each element in
groups.List of starting indices to each group where G is the number of groups.
Trueif the function should fit with intercept.intercepts[i]is the intercept atlmdas[i].Number of coordinate descents taken.
The regularization path to solve for.
lmdas[i]is the regularization \(\lambda\) used for theith solution.Maximum number of active groups allowed.
Maximum number of coordinate descents.
Number of threads.
Maximum number of iterations for the BCD update.
Convergence tolerance for the BCD update.
Penalty factor for each group in the same order as
groups.Relative percent deviance explained tolerance.
The change in unnormalized \(R^2\) given by \(2(\ell(\beta_{\mathrm{old}}) - \ell(\beta_{\mathrm{curr}}))\).
rsqs[i]is the unnormalized \(R^2\) atbetas[i].List of indices that index a corresponding list of values for each screen group.
Coefficient vector on the screen set.
Gradient \(v_k - A_{k,\cdot} \beta\) on the screen groups \(k\) where \(\beta\) is given by
screen_beta.Boolean vector that indicates whether each screen group in
groupsis active or not.List of indices into
groupsthat correspond to the screen groups.Ordering such that
screen_subsetis sorted in ascending order wherescreen_subsetis a list of column indices into \(A\) in the implicit ordering ofscreen_grad.Ordered
screen_subset(seescreen_subset_orderfor its definition).List of \(V_k\) where \(V_k\) are the eigenvectors of \(A_{kk}\) along the screen groups \(k\).
List of \(D_k^2\) where \(D_k^2\) are the eigenvalues of \(A_{kk}\) along the screen groups \(k\).
Coordinate descent convergence tolerance.
- __init__(*args, **kwargs)#
Overloaded function.
__init__(self: adelie.adelie_core.state.StateGaussianPinCov32, A: adelie.adelie_core.matrix.MatrixCovBase32, constraints: adelie.adelie_core.constraint.VectorConstraintBase32, groups: numpy.ndarray[numpy.int64[1, n]], group_sizes: numpy.ndarray[numpy.int64[1, n]], alpha: float, penalty: numpy.ndarray[numpy.float32[1, n]], screen_set: numpy.ndarray[numpy.int64[1, n]], screen_begins: numpy.ndarray[numpy.int64[1, n]], screen_vars: numpy.ndarray[numpy.float32[1, n]], screen_transforms: adelie.adelie_core.VectorMatrix32, screen_subset_order: numpy.ndarray[numpy.int64[1, n]], screen_subset_ordered: numpy.ndarray[numpy.int64[1, n]], lmda_path: numpy.ndarray[numpy.float32[1, n]], constraint_buffer_size: int, max_active_size: int, max_iters: int, tol: float, rdev_tol: float, newton_tol: float, newton_max_iters: int, n_threads: int, rsq: float, screen_beta: numpy.ndarray[numpy.float32[1, n], flags.writeable], screen_grad: numpy.ndarray[numpy.float32[1, n], flags.writeable], screen_is_active: numpy.ndarray[bool[1, n], flags.writeable], active_set_size: int, active_set: numpy.ndarray[numpy.int64[1, n], flags.writeable]) -> None
__init__(self: adelie.adelie_core.state.StateGaussianPinCov32, arg0: adelie.adelie_core.state.StateGaussianPinCov32) -> None
- solve(self: adelie.adelie_core.state.StateGaussianPinCov32) dict#
Solves the state-specific problem.
- A#
Positive semi-definite matrix \(A\).
- active_begins#
List of indices that index a corresponding list of values for each active group.
active_begins[i]is the starting index corresponding to theith active group.
- active_order#
Ordering such that
groupsis sorted in ascending order for the active groups.groups[screen_set[active_set[active_order[i]]]]is theith active group in ascending order.
- active_set#
List of indices into
screen_setthat correspond to active groups.screen_set[active_set[i]]is theith active group. An active group is one with non-zero coefficient block, that is, for everyith active group,screen_beta[b:b+p] == 0wherej = active_set[i],k = screen_set[j],b = screen_begins[j], andp = group_sizes[k].
- active_set_size#
Number of active groups.
active_set[i]is only well-defined foriin the range[0, active_set_size).
- adev_tol#
Percent deviance explained tolerance.
- alpha#
Elastic net parameter.
- benchmark_active#
Benchmark time for performing coordinate-descent on the active set for each \(\lambda\).
- benchmark_screen#
Benchmark time for performing coordinate-descent on the screen set for each \(\lambda\).
- betas#
betas[i]is the solution atlmdas[i].
- constraint_buffer_size#
Max constraint buffer size. Equivalent to
np.max([0 if c is None else c.buffer_size() for c in constraints]).
- constraints#
List of constraints for each group.
constraints[i]is the constraint object corresponding to groupi.
- ddev_tol#
Difference in percent deviance explained tolerance.
- group_sizes#
List of group sizes corresponding to each element in
groups.group_sizes[i]is the group size of theith group.
- groups#
List of starting indices to each group where G is the number of groups.
groups[i]is the starting index of theith group.
- intercept#
Trueif the function should fit with intercept.
- intercepts#
intercepts[i]is the intercept atlmdas[i].
- iters#
Number of coordinate descents taken.
- lmda_path#
The regularization path to solve for.
- lmdas#
lmdas[i]is the regularization \(\lambda\) used for theith solution.
- max_active_size#
Maximum number of active groups allowed.
- max_iters#
Maximum number of coordinate descents.
- n_threads#
Number of threads.
- newton_max_iters#
Maximum number of iterations for the BCD update.
- newton_tol#
Convergence tolerance for the BCD update.
- penalty#
Penalty factor for each group in the same order as
groups.
- rdev_tol#
Relative percent deviance explained tolerance.
- rsq#
The change in unnormalized \(R^2\) given by \(2(\ell(\beta_{\mathrm{old}}) - \ell(\beta_{\mathrm{curr}}))\).
- rsqs#
rsqs[i]is the unnormalized \(R^2\) atbetas[i].
- screen_begins#
List of indices that index a corresponding list of values for each screen group.
screen_begins[i]is the starting index corresponding to theith screen group. From this index, readinggroup_sizes[screen_set[i]]number of elements will grab values corresponding to the fullith screen group block.
- screen_beta#
Coefficient vector on the screen set.
screen_beta[b:b+p]is the coefficient for theith screen group wherek = screen_set[i],b = screen_begins[i], andp = group_sizes[k].
- screen_grad#
Gradient \(v_k - A_{k,\cdot} \beta\) on the screen groups \(k\) where \(\beta\) is given by
screen_beta.screen_grad[b:b+p]is the gradient for theith screen group wherek = screen_set[i],b = screen_begins[i], andp = group_sizes[k].
- screen_is_active#
Boolean vector that indicates whether each screen group in
groupsis active or not.screen_is_active[i]isTrueif and only ifscreen_set[i]is active.
- screen_set#
List of indices into
groupsthat correspond to the screen groups.screen_set[i]isith screen group.
- screen_subset_order#
Ordering such that
screen_subsetis sorted in ascending order wherescreen_subsetis a list of column indices into \(A\) in the implicit ordering ofscreen_grad.screen_subset[screen_subset_order[i]]is theith column index into \(A\) corresponding toscreen_grad[screen_subset_order[i]].
- screen_subset_ordered#
Ordered
screen_subset(seescreen_subset_orderfor its definition). We have the equivalencescreen_subset_ordered[i] == screen_subset[screen_subset_order[i]].
- screen_transforms#
List of \(V_k\) where \(V_k\) are the eigenvectors of \(A_{kk}\) along the screen groups \(k\). It only needs to be properly initialized for groups with size > 1.
screen_transforms[i]is \(V_k\) for theith screen group wherek = screen_set[i].
- screen_vars#
List of \(D_k^2\) where \(D_k^2\) are the eigenvalues of \(A_{kk}\) along the screen groups \(k\).
screen_vars[b:b+p]is \(D_k^2\) for theith screen group wherek = screen_set[i],b = screen_begins[i], andp = group_sizes[k].
- tol#
Coordinate descent convergence tolerance.