Description Usage Arguments Value Author(s) References See Also Examples
One of the main functions in the hierNet package. Builds a logistic regression model with hierarchically constrained pairwise interactions. Required inputs are an x matrix of features (the columns are the features) and a y vector of values. Reasonably fast for moderate sized problems (100-200 variables). We are currently working on a alternate algorithm for large scale problems.
1 2 3 4 |
x |
A matrix of predictors, where the rows are the samples and the columns are the predictors |
y |
A vector of observations, with values 0 or 1, where length(y) equals nrow(x) |
lam |
Regularization parameter (>0). L1 penalty param is |
delta |
Elastic Net parameter. Squared L2 penalty param is |
diagonal |
Flag specifying whether to include "pure" quadratic terms, th_jjX_j^2, in the model. Default TRUE. |
strong |
Flag specifying strong hierarchy (TRUE) or weak hierarchy (FALSE). Default FALSE |
aa |
An *optional* argument, a list with results from a previous call |
zz |
An *optional* argument, a matrix whose columns are products of features, computed by the function compute.interactions.c |
center |
Should features be centered? Default TRUE; FALSE should rarely be used. This option is available for special uses only |
stand.main |
Should main effects be standardized? Default TRUE |
stand.int |
Should interactions be standardized? Default FALSE |
rho |
ADMM parameter: tuning parameter (>0) for ADMM. If there are convergence
problems, try decreasing |
niter |
ADMM parameter: number of iterations |
sym.eps |
ADMM parameter Thresholding for symmetrizing with strong=TRUE |
step |
Stepsize for generalized gradient descent |
maxiter |
Maximum number of iterations for generalized gradient descent |
backtrack |
Backtrack parameter for generalized gradient descent |
tol |
Error tolerance parameter for generalized gradient descent |
trace |
Output option; trace=1 gives verbose output |
b0 |
Intercept |
bp |
p-vector of estimated "positive part" main effect (p=#features) |
bn |
p-vector of estimated "negative part" main effect; overall main effect estimated coefficients are bp-bn |
th |
Matrix of estimated interaction coefficients, of dimension p by p |
obj |
Value of objective function at minimum. |
lam |
Value of lambda used |
type |
Type of model fit- "gaussian" or "logistic" (binomial) |
mx |
p-vector of column means of x |
my |
Mean of y |
sx |
p-vector of column standard deviations of x |
mzz |
column means of feature product matrix |
call |
The call to hierNet |
Jacob Bien and Robert Tibshirani
Bien, J., Taylor, J., Tibshirani, R., (2013) "A Lasso for Hierarchical Interactions." Annals of Statistics. 41(3). 1111-1141.
predict.hierNet.logistic,linkhierNet.logistic.path
1 2 3 4 5 6 7 |
Computing zz...
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889GG converged in 89 iterations.
Call:
hierNet.logistic(x = x, y = y, lam = 5)
Non-zero coefficients:
(Rows are predictors with nonzero main effects)
(1st column is main effect)
(Next columns are nonzero interactions of row predictor)
(Last column indicates whether hierarchy constraint is tight.)
Main effect 1 2 3 4 5 6 7 8 9
1 0.3228 0 0.2948 0 0 0 0 0 0 0
2 0.6132 0.2948 0.0922 0 0 -0.0567 0 0 0 0
3 0.0272 0 0 -0.0272 0 0 0 0 0 0
4 0.075 0 0 0 0 0 0 0 -0.0375 0
5 -0.0154 0 -0.0567 0 0 0 0 0 -0.0077 0
6 -0.0774 0 0 0 0 0 0.0774 0 0 0
7 0.0343 0 0 0 0 0 0 0 0 0
8 0.0332 0 0 0 -0.0375 -0.0077 0 0 0.0332 0.1228
9 -0.2456 0 0 0 0 0 0 0 0.1228 0
10 Tight?
1 -0.0704 *
2 0
3 0 *
4 0
5 0 *
6 0 *
7 0.0171
8 0 *
9 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.