adelie.adelie_core.state.StateGaussianPinNaive64#

class adelie.adelie_core.state.StateGaussianPinNaive64#

Core state class for Gaussian, pin, naive method.

Methods

__init__(*args, **kwargs)

Overloaded function.

Attributes

X

Feature matrix.

active_begins

List of indices that index a corresponding list of values for each active group.

active_order

Ordering such that groups is sorted in ascending order for the active groups.

active_set

List of indices into screen_set that correspond to active groups.

active_set_size

Number of active groups.

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 at lmdas[i].

constraint_buffer_size

Max constraint buffer size.

constraints

List of constraints for each group.

ddev_tol

Difference in percent deviance explained tolerance.

dual_groups

List of starting indices to each dual group where G is the number of groups.

duals

duals[i] is the dual at lmdas[i].

group_sizes

List of group sizes corresponding to each element in groups.

groups

List of starting indices to each group where G is the number of groups.

intercept

True if the function should fit with intercept.

intercepts

intercepts[i] is the intercept at lmdas[i].

iters

Number of coordinate descents taken.

lmda_path

The regularization path to solve for.

lmdas

lmdas[i] is the regularization \(\lambda\) used for the i th 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.

resid

Residual \(y_c - X \beta\) where \(\beta\) is given by screen_beta.

resid_sum

Weighted (by \(W\)) sum of resid.

rsq

The change in unnormalized \(R^2\) given by \(\|y_c-X_c\beta_{\mathrm{old}}\|_{W}^2 - \|y_c-X_c\beta_{\mathrm{curr}}\|_{W}^2\).

rsqs

rsqs[i] is the unnormalized \(R^2\) at betas[i].

screen_X_means

Column means of \(X\) for screen groups (weighted by \(W\)).

screen_begins

List of indices that index a corresponding list of values for each screen group.

screen_beta

Coefficient vector on the screen set.

screen_is_active

Boolean vector that indicates whether each screen group in groups is active or not.

screen_set

List of indices into groups that correspond to the screen groups.

screen_transforms

List of \(V_k\) where \(V_k\) is from the SVD of \(\sqrt{W} X_{c,k}\) along the screen groups \(k\) and for possibly column-centered (weighted by \(W\)) \(X_k\).

screen_vars

List of \(D_k^2\) where \(D_k\) is from the SVD of \(\sqrt{W} X_{c,k}\) along the screen groups \(k\) and for possibly column-centered (weighted by \(W\)) \(X_k\).

tol

Coordinate descent convergence tolerance.

weights

Observation weights \(W\).

y_mean

Mean of the response vector \(y\) (weighted by \(W\)), i.e. \(\mathbf{1}^\top W y\).

y_var

Variance of the response vector \(y\) (weighted by \(W\)), i.e. \(\|y_c\|_{W}^2\).

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: adelie.adelie_core.state.StateGaussianPinNaive64, X: adelie.adelie_core.matrix.MatrixNaiveBase64, y_mean: float, y_var: float, constraints: adelie.adelie_core.constraint.VectorConstraintBase64, groups: numpy.ndarray[numpy.int64[1, n]], group_sizes: numpy.ndarray[numpy.int64[1, n]], dual_groups: numpy.ndarray[numpy.int64[1, n]], alpha: float, penalty: numpy.ndarray[numpy.float64[1, n]], weights: numpy.ndarray[numpy.float64[1, n]], screen_set: numpy.ndarray[numpy.int64[1, n]], screen_begins: numpy.ndarray[numpy.int64[1, n]], screen_vars: numpy.ndarray[numpy.float64[1, n]], screen_X_means: numpy.ndarray[numpy.float64[1, n]], screen_transforms: adelie.adelie_core.VectorMatrix64, lmda_path: numpy.ndarray[numpy.float64[1, n]], constraint_buffer_size: int, intercept: bool, max_active_size: int, max_iters: int, tol: float, adev_tol: float, ddev_tol: float, newton_tol: float, newton_max_iters: int, n_threads: int, rsq: float, resid: numpy.ndarray[numpy.float64[1, n], flags.writeable], resid_sum: float, screen_beta: numpy.ndarray[numpy.float64[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

  2. __init__(self: adelie.adelie_core.state.StateGaussianPinNaive64, arg0: adelie.adelie_core.state.StateGaussianPinNaive64) -> None

X#

Feature matrix.

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 the i th active group.

active_order#

Ordering such that groups is sorted in ascending order for the active groups. groups[screen_set[active_set[active_order[i]]]] is the i th active group in ascending order.

active_set#

List of indices into screen_set that correspond to active groups. screen_set[active_set[i]] is the i th active group. An active group is one with non-zero coefficient block, that is, for every i th active group, screen_beta[b:b+p] == 0 where j = active_set[i], k = screen_set[j], b = screen_begins[j], and p = group_sizes[k].

active_set_size#

Number of active groups. active_set[i] is only well-defined for i in 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 at lmdas[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 group i.

ddev_tol#

Difference in percent deviance explained tolerance.

dual_groups#

List of starting indices to each dual group where G is the number of groups. dual_groups[i] is the starting index of the i th dual group.

duals#

duals[i] is the dual at lmdas[i].

group_sizes#

List of group sizes corresponding to each element in groups. group_sizes[i] is the group size of the i th group.

groups#

List of starting indices to each group where G is the number of groups. groups[i] is the starting index of the i th group.

intercept#

True if the function should fit with intercept.

intercepts#

intercepts[i] is the intercept at lmdas[i].

iters#

Number of coordinate descents taken.

lmda_path#

The regularization path to solve for.

lmdas#

lmdas[i] is the regularization \(\lambda\) used for the i th 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.

resid#

Residual \(y_c - X \beta\) where \(\beta\) is given by screen_beta.

Note

This definition is unconventional. This was done deliberately as the algorithm is most efficient when it updates this quantity compared to the conventional quantity \(y_c-X_c \beta\).

resid_sum#

Weighted (by \(W\)) sum of resid.

rsq#

The change in unnormalized \(R^2\) given by \(\|y_c-X_c\beta_{\mathrm{old}}\|_{W}^2 - \|y_c-X_c\beta_{\mathrm{curr}}\|_{W}^2\).

rsqs#

rsqs[i] is the unnormalized \(R^2\) at betas[i].

screen_X_means#

Column means of \(X\) for screen groups (weighted by \(W\)).

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 the i th screen group. From this index, reading group_sizes[screen_set[i]] number of elements will grab values corresponding to the full i th screen group block.

screen_beta#

Coefficient vector on the screen set. screen_beta[b:b+p] is the coefficient for the i th screen group where k = screen_set[i], b = screen_begins[i], and p = group_sizes[k].

screen_is_active#

Boolean vector that indicates whether each screen group in groups is active or not. screen_is_active[i] is True if and only if screen_set[i] is active.

screen_set#

List of indices into groups that correspond to the screen groups. screen_set[i] is i th screen group.

screen_transforms#

List of \(V_k\) where \(V_k\) is from the SVD of \(\sqrt{W} X_{c,k}\) along the screen groups \(k\) and for possibly column-centered (weighted by \(W\)) \(X_k\). It only needs to be properly initialized for groups with size > 1. screen_transforms[i] is \(V_k\) for the i th screen group where k = screen_set[i].

screen_vars#

List of \(D_k^2\) where \(D_k\) is from the SVD of \(\sqrt{W} X_{c,k}\) along the screen groups \(k\) and for possibly column-centered (weighted by \(W\)) \(X_k\). screen_vars[b:b+p] is \(D_k^2\) for the i th screen group where k = screen_set[i], b = screen_begins[i], and p = group_sizes[k].

tol#

Coordinate descent convergence tolerance.

weights#

Observation weights \(W\).

y_mean#

Mean of the response vector \(y\) (weighted by \(W\)), i.e. \(\mathbf{1}^\top W y\).

y_var#

Variance of the response vector \(y\) (weighted by \(W\)), i.e. \(\|y_c\|_{W}^2\).