plot.sgs {sgs} | R Documentation |
Plot models of the following object types: "sgs"
, "sgs_cv"
, "gslope"
, "gslope_cv"
.
Description
Plots the pathwise solution of a cross-validation fit, from a call to one of the following: fit_sgs()
, fit_sgs_cv()
, fit_gslope()
, fit_gslope_cv()
.
Usage
## S3 method for class 'sgs'
plot(x, how_many = 10, ...)
Arguments
x |
Object of one of the following classes: |
how_many |
Defines how many predictors to plot. Plots the predictors in decreasing order of largest absolute value. |
... |
further arguments passed to base function. |
Value
A list containing:
response |
The predicted response. In the logistic case, this represents the predicted class probabilities. |
class |
The predicted class assignments. Only returned if type = "logistic" in the model object. |
See Also
fit_sgs()
, fit_sgs_cv()
, fit_gslope()
, fit_gslope_cv()
Other SGS-methods:
as_sgs()
,
coef.sgs()
,
fit_sgs()
,
fit_sgs_cv()
,
predict.sgs()
,
print.sgs()
,
scaled_sgs()
Other gSLOPE-methods:
coef.sgs()
,
fit_gslope()
,
fit_gslope_cv()
,
predict.sgs()
,
print.sgs()
Examples
# specify a grouping structure
groups = c(1,1,2,2,3)
# generate data
data = gen_toy_data(p=5, n=4, groups = groups, seed_id=3,signal_mean=20,group_sparsity=1)
# run SGS
model = fit_sgs(X = data$X, y = data$y, groups=groups, type = "linear",
path_length = 20, alpha = 0.95, vFDR = 0.1, gFDR = 0.1,
min_frac = 0.05, standardise="l2",intercept=TRUE,verbose=FALSE)
plot(model, how_many = 10)