## If no Z provided, perform Empirical Bayes tuning
## simulate linear data
set.seed(9)
data(example)
X <- example$X
Y <- example$Y
Z <- example$Z
# \donttest{
fit.eb <- xtune(X,Y)
coef_xtune(fit.eb)
predict_xtune(fit.eb,X)
# }
## Feature specific shrinkage based on external information Z:
## simulate multi-categorical data
data(example.multiclass)
X <- example.multiclass$X
Y <- example.multiclass$Y
Z <- example.multiclass$Z
# \donttest{
fit <- xtune(X,Y,Z,family = "multiclass")
## Coef and predict methods
coef_xtune(fit)
predict_xtune(fit,X, type = "class")
# }
Run the code above in your browser using DataLab