# predict.hierNet.path: Prediction function for hierNet.path and... In pejovic/int3D: A Lasso for Hierarchical Interactions

## Description

A function to perform prediction, using an x matrix and the output of the "hierNet.path" or "hiernet.logistic.path" functions.

## Usage

 ```1 2``` ```## S3 method for class 'hierNet.path' predict(object, newx, newzz=NULL, ...) ```

## Arguments

 `object` The results of a call to the "hierNet" or "hierNet.path" or function. The coefficients that are part of this object will be used for making predictions. `newx` The new x at which predictions should be made. Can be a vector or a matrix (one obseration per row). `newzz` Optional matrix of products of columns of newx, computed by compute.interactions.c `...` additional arguments (not currently used)

## Value

 `yhat` Matrix of predictions, one row per observation. For logistic model, these are the estimated probabilities.

## Author(s)

Jacob Bien and Robert Tibshirani

## References

Bien, J., Taylor, J., Tibshirani, R., (2013) "A Lasso for Hierarchical Interactions." Annals of Statistics. 41(3). 1111-1141.

hierNet, hierNet.path

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10``` ```set.seed(12) x=matrix(rnorm(100*10),ncol=10) x=scale(x,TRUE,TRUE) y=x[,1]+2*x[,2]+ x[,1]*x[,2]+3*rnorm(100) newx=matrix(rnorm(100*10),ncol=10) fit=hierNet(x,y,lam=50) yhat=predict.hierNet(fit,newx) fit=hierNet.path(x,y) yhat=predict.hierNet(fit,newx) ```

pejovic/int3D documentation built on May 25, 2019, 12:45 a.m.