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(k=2, class.sizes = c(50, 50))
x = out$x; y=out$y; groups = out$group;

# Test data
outtest = gaussian.example.data(k=2, class.sizes = c(50, 50))
xtest=outtest$x; ytest=outtest$y; groupstest=outtest$groups

fit = ptLasso(x, y, groups = groups, nfolds = 3, 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     r^2
#> Overall        710.8 710.8   487.6   934.0 -0.1502
#> Pretrain       700.7 700.7   451.1   950.3 -0.1338
#> Individual     700.3 700.3   450.5   950.1 -0.1331
#> 
#> Support size:
#>                                         
#> Overall    19                           
#> Pretrain   13 (0 common + 13 individual)
#> Individual 13                           

# 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    19                           
#> Pretrain   13 (0 common + 13 individual)
#> Individual 13