Learn R Programming

RSDA (version 2.0.8)

predictsym.glm: Predict method to Lasso, Ridge and and Elastic Net Linear regression model to interval variables

Description

To execute Predict method to Lasso, Ridge and and Elastic Net Linear regression model to interval variables.

Usage

predictsym.glm(model, new.sym.data, response = 1, method = c('cm', 'crm'))

Arguments

model

The output of glm method.

new.sym.data

Should be a symbolic data table read with the function read.sym.table(...).

response

The number of the column where is the response variable in the interval data table.

method

'cm' to generalized Center Method and 'crm' to generalized Center and Range Method.

Value

The object returned depends the ... argument which is passed on to the predict method for glmnet objects.

References

Rodriguez O. (2013). A generalization of Centre and Range method for fitting a linear regression model to symbolic interval data using Ridge Regression, Lasso and Elastic Net methods. The IFCS2013 conference of the International Federation of Classification Societies, Tilburg University Holland.

See Also

sym.glm

Examples

Run this code
# NOT RUN {
data(int_prost_train)
data(int_prost_test)
res.cm.lasso<-sym.glm(sym.data=int_prost_train,response=9,method='cm',
                      alpha=1,nfolds=10,grouped=TRUE)
pred.cm.lasso<-predictsym.glm(res.cm.lasso,response=9,int_prost_test,method='cm')
plot(res.cm.lasso)
plot(res.cm.lasso$glmnet.fit, 'norm', label=TRUE)
plot(res.cm.lasso$glmnet.fit, 'lambda', label=TRUE)
RMSE.L(sym.var(int_prost_test,9),pred.cm.lasso)
RMSE.U(sym.var(int_prost_test,9),pred.cm.lasso)
R2.L(sym.var(int_prost_test,9),pred.cm.lasso)
R2.U(sym.var(int_prost_test,9),pred.cm.lasso)
deter.coefficient(sym.var(int_prost_test,9),pred.cm.lasso)

# }

Run the code above in your browser using DataLab