Title: | Implementation of the Conic Multivariate Adaptive Regression Splines in R |
---|---|
Description: | An implementation of 'Conic Multivariate Adaptive Regression Splines (CMARS)' in R. See Weber et al. (2011) CMARS: a new contribution to nonparametric regression with multivariate adaptive regression splines supported by continuous optimization, <DOI:10.1080/17415977.2011.624770>. It constructs models by using the terms obtained from the forward step of MARS and then estimates parameters by using 'Tikhonov' regularization and conic quadratic optimization. It is possible to construct models for prediction and binary classification. It provides performance measures for the model developed. The package needs the optimisation software 'MOSEK' <https://www.mosek.com/> to construct the models. Please follow the instructions in 'Rmosek' for the installation. |
Authors: | Fatma Yerlikaya-Ozkurt [aut], Ceyda Yazici [aut, cre], Inci Batmaz [aut] |
Maintainer: | Ceyda Yazici <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.3 |
Built: | 2024-10-26 03:40:11 UTC |
Source: | https://github.com/yaziciceyda/cmars |
Pre-processed and standardized Breast Cancer Wisconsin (Diagnostic) is a real-life data set from University of California at Irvine (UCI) machine learning data repository UCI: Machine Learning Repository (available at http://archive.ics.uci.edu/ml/).
data(classdata.std)
data(classdata.std)
A data frame with 569 rows and 31 variables.
http://archive.ics.uci.edu/ml/index.php
Dua, D. and Graff, C. (2017). UCI machine learning repository.
## Not run: data(classdata.std) cmaRs(y ~ ., classification = TRUE, data = classdata.std) ## End(Not run)
## Not run: data(classdata.std) cmaRs(y ~ ., classification = TRUE, data = classdata.std) ## End(Not run)
This function allows you to construct a CMARS Model.
cmaRs( formula, data, classification = FALSE, threshold.class = 0.5, degree = 1, nk = 20, Auto.linpreds = FALSE )
cmaRs( formula, data, classification = FALSE, threshold.class = 0.5, degree = 1, nk = 20, Auto.linpreds = FALSE )
formula |
A symbolic description of the model to be fitted. |
data |
An optional data frame, list or environment containing the variables in the model. |
classification |
Logical: If FALSE, a prediction model will be constructed. |
threshold.class |
If the model is classification, this threshold is used to convert probabilities to classes. Default is 0.5. |
degree |
Maximum degree of interaction (Friedman's mi). Default is 1, meaning build an additive model (i.e., no interaction terms). |
nk |
Maximum number of model terms before pruning, i.e., the maximum number of terms created by the forward pass. Includes the intercept. |
Auto.linpreds |
Default is TRUE, for detailed explanation please check earth package. |
An S3 model of class "cmaRs"
## Not run: # Without \code{MOSEK}, the example code is not executable. # For installation of Mosek, plese see the documentation of 'Rmosek'. data(table.b6) model.ex1 <- cmaRs(y ~ ., degree = 2, nk = 20, classification = FALSE, Auto.linpreds = FALSE, data = table.b6 ) data("trees", package = "datasets") model.prediction <- cmaRs(Volume ~ ., degree = 5, nk = 20, data = trees) data("etitanic", package = "earth") model.classification <- cmaRs(survived ~ age, data = etitanic, classification = TRUE ) ## End(Not run)
## Not run: # Without \code{MOSEK}, the example code is not executable. # For installation of Mosek, plese see the documentation of 'Rmosek'. data(table.b6) model.ex1 <- cmaRs(y ~ ., degree = 2, nk = 20, classification = FALSE, Auto.linpreds = FALSE, data = table.b6 ) data("trees", package = "datasets") model.prediction <- cmaRs(Volume ~ ., degree = 5, nk = 20, data = trees) data("etitanic", package = "earth") model.classification <- cmaRs(survived ~ age, data = etitanic, classification = TRUE ) ## End(Not run)
This function allows you to construct three different plots, namely actual versus predicted response; fitted values versus standardized residuals; and standardized residuals versus order if the model is constructed for prediction purpose. Moreover, Receiver Operating Characteristic Curve of classification models can be produced.
## S3 method for class 'cmaRs' plot(x, ...)
## S3 method for class 'cmaRs' plot(x, ...)
x |
A cmaRs object which is obtained by prediction. |
... |
Additional parameters. |
An S3 model of class "plot.cmaRs"
## Not run: # Without \code{MOSEK}, the example code is not executable. # For installation of Mosek, plese see the documentation of 'Rmosek'. data("trees", package = "datasets") model.prediction <- cmaRs(Volume ~ ., degree = 5, nk = 20, data = trees) plot.cmaRs(model.prediction) ## End(Not run)
## Not run: # Without \code{MOSEK}, the example code is not executable. # For installation of Mosek, plese see the documentation of 'Rmosek'. data("trees", package = "datasets") model.prediction <- cmaRs(Volume ~ ., degree = 5, nk = 20, data = trees) plot.cmaRs(model.prediction) ## End(Not run)
Pre-processed and standardized Concrete Slump Test is a real-life data set from University of California at Irvine (UCI) machine learning data repository UCI: Machine Learning Repository (available at http://archive.ics.uci.edu/ml/).
data(preddata.std)
data(preddata.std)
A data frame with 103 rows and 8 variables.
https://archive.ics.uci.edu/ml/datasets/Concrete+Compressive+Strength
Yeh, I.-C. (2007). Modeling slump flow of concrete using second-order regressions and artificial neural networks. Cement and Concrete Composites, 29(6): 474 - 480.
## Not run: data(preddata.std) cmaRs(Compressive_Strength ~ ., classification = FALSE, data = preddata.std) ## End(Not run)
## Not run: data(preddata.std) cmaRs(Compressive_Strength ~ ., classification = FALSE, data = preddata.std) ## End(Not run)
This function allows you to obtain the predicted values of a CMARS model.
## S3 method for class 'cmaRs' predict(object, new = NULL, ...)
## S3 method for class 'cmaRs' predict(object, new = NULL, ...)
object |
A cmaRs object which is obtained by prediction. |
new |
The data for which the fitted values will be constructed. |
... |
Additional parameters affecting the predictions. |
y The predicted values.
## Not run: # Without \code{MOSEK}, the example code is not executable. # For installation of Mosek, plese see the documentation of 'Rmosek'. data("trees", package = "earth") model.prediction <- cmaRs(Volume ~ ., degree = 5, nk = 20, data = trees) predict.cmaRs(model.prediction, data = trees) ## End(Not run)
## Not run: # Without \code{MOSEK}, the example code is not executable. # For installation of Mosek, plese see the documentation of 'Rmosek'. data("trees", package = "earth") model.prediction <- cmaRs(Volume ~ ., degree = 5, nk = 20, data = trees) predict.cmaRs(model.prediction, data = trees) ## End(Not run)
This function allows you to print the output of CMARS model.
## S3 method for class 'cmaRs' summary(object, ...)
## S3 method for class 'cmaRs' summary(object, ...)
object |
A cmaRs object which is constructed by cmaRs. |
... |
Additional arguments affecting the summary result. |
An S3 model of class "summary.cmaRs"
## Not run: # Without \code{MOSEK}, the example code is not executable. # For installation of Mosek, plese see the documentation of 'Rmosek'. data("trees", package = "datasets") model.prediction <- cmaRs(Volume ~ ., degree = 5, nk = 20, data = trees) summary.cmaRs(model.prediction) ## End(Not run)
## Not run: # Without \code{MOSEK}, the example code is not executable. # For installation of Mosek, plese see the documentation of 'Rmosek'. data("trees", package = "datasets") model.prediction <- cmaRs(Volume ~ ., degree = 5, nk = 20, data = trees) summary.cmaRs(model.prediction) ## End(Not run)
This data set is taken from MPV package (version 1.58). Please check library(MPV) for more detail.
data(table.b6)
data(table.b6)
A data frame with 28 rows and 5 variables.
Montgomery, D.C., Peck, E.A., and Vining, C.G. (2001) Introduction to Linear Regression Analysis. 3rd Edition, John Wiley and Sons.
(1972) Kinetics of Chlorination of Niobium oxychloride by Phosgene in a Tube-Flow Reactor. Industrial and Engineering Chemistry, Process Design Development, 11(2).
data(table.b6)
data(table.b6)