Skip to contents

Print the predict.ptLasso object.

Usage

# S3 method for class 'predict.ptLasso'
print(x, ...)

Arguments

x

output of predict called with a ptLasso object.

...

other arguments to pass to the print function.

See also

ptLasso and predict.ptLasso.

Author

Erin Craig and Rob Tibshirani
Maintainer: Erin Craig <erincr@stanford.edu>

Examples

# Train data
out = gaussian.example.data()
x = out$x; y=out$y; groups = out$group;

# Test data
outtest = gaussian.example.data()
xtest=outtest$x; ytest=outtest$y; groupstest=outtest$groups

fit = ptLasso(x, y, groups = groups, family = "gaussian", type.measure = "mse")
pred = predict(fit, xtest, groupstest, ytest=ytest, s="lambda.min")
print(pred)
#> 
#> Call:  
#> predict.ptLasso(object = fit, xtest = xtest, groupstest = groupstest,  
#>     ytest = ytest, s = "lambda.min") 
#> 
#> 
#> alpha =  0.5 
#> 
#> Performance (Mean squared error):
#> 
#>            allGroups  mean group_1 group_2 group_3 group_4 group_5    r^2
#> Overall        685.8 685.8   637.4   498.3   570.1   735.4   987.9 0.5213
#> Pretrain       519.3 519.3   446.3   434.3   600.1   583.5   532.3 0.6376
#> Individual     563.0 563.0   524.2   455.1   656.3   622.9   556.4 0.6070
#> 
#> Support size:
#>                                          
#> Overall    44                            
#> Pretrain   89 (12 common + 77 individual)
#> Individual 105                           

# If ytest is not supplied, just prints the pretrained predictions.
pred = predict(fit, xtest, groupstest, s="lambda.min")
print(pred)
#> 
#> Call:  
#> predict.ptLasso(object = fit, xtest = xtest, groupstest = groupstest,  
#>     s = "lambda.min") 
#> 
#> 
#> alpha =  0.5 
#> 
#> Support size:
#>                                          
#> Overall    44                            
#> Pretrain   89 (12 common + 77 individual)
#> Individual 105