Skip to contents

Print the predict.cv.ptLasso object.

Usage

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

Arguments

x

output of predict called with a ptLasso object.

...

other arguments to pass to the print function.

See also

cv.ptLasso and predict.cv.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

cvfit = cv.ptLasso(x, y, groups = groups, family = "gaussian", type.measure = "mse")
pred = predict(cvfit, xtest, groupstest, ytest=ytest, s="lambda.min")
print(pred)
#> 
#> Call:  
#> predict.cv.ptLasso(object = cvfit, 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        653.8 653.8   699.0   477.3   398.2   647.3  1047.4 0.5271
#> Pretrain       519.6 519.6   428.4   482.6   551.9   526.1   609.1 0.6242
#> Individual     563.6 563.6   481.3   545.4   590.1   582.0   619.0 0.5924
#> 
#> Support size:
#>                                          
#> Overall    57                            
#> Pretrain   89 (14 common + 75 individual)
#> Individual 108                           

# If ytest is not supplied, just prints the pretrained predictions.
pred = predict(cvfit, xtest, groupstest, s="lambda.min")
print(pred)
#> 
#> Call:  
#> predict.cv.ptLasso(object = cvfit, xtest = xtest, groupstest = groupstest,  
#>     s = "lambda.min") 
#> 
#> 
#> alpha =  0.5 
#> 
#> Support size:
#>                                          
#> Overall    57                            
#> Pretrain   89 (14 common + 75 individual)
#> Individual 108