Learn R Programming

SMLE (version 0.4.0)

smle_predict: Predict method for SMLE screening and selection

Description

This function returns predictions based on the feature retained from screening or selected by selection.

Usage

smle_predict(x, ...)

# S3 method for selection smle_predict(x, type = c("link", "response", "terms"), terms = NULL, ...)

# S3 method for smle smle_predict(x, type = c("link", "response", "terms"), terms = NULL, ...)

# S3 method for default smle_predict(x, ...)

Arguments

x

Objects of 'smle' object, as the output from SMLE; or 'selection' object, as the output from smle_select.

...

Other parameters.

type

e type of prediction required. The default is on the scale of the linear predictors; the alternative "response" is on the scale of the response variable. Thus for a default binomial model the default predictions are of log-odds (probabilities on logit scale) and type = "response" gives the predicted probabilities. The "terms" option returns a matrix giving the fitted values of each term in the model formula on the linear predictor scale.

terms

with type = "terms" by default all terms are returned. A character vector specifies which terms are to be returned

Value

The predictor variable

Details

First, smle_predict refits the regression model by glm.fit between response variable and features selected. Then, prediction by predict.glm function.

Examples

Run this code
# NOT RUN {
set.seed(123.456)

Data_sim<-Gen_Data(n= 200, p =1000, correlation="AR",family = "gaussian")

fit<-SMLE(Data_sim$Y,Data_sim$X, family = "gaussian")

E<-smle_select(fit)

p<-smle_predict(E,type = "link")

# }

Run the code above in your browser using DataLab