Package 'cmaRs'

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

Help Index


Classification Data - Breast Cancer Wisconsin (Diagnostic)

Description

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/).

Usage

data(classdata.std)

Format

A data frame with 569 rows and 31 variables.

Source

http://archive.ics.uci.edu/ml/index.php

References

Dua, D. and Graff, C. (2017). UCI machine learning repository.

Examples

## Not run: 
data(classdata.std)
cmaRs(y ~ ., classification = TRUE, data = classdata.std)

## End(Not run)

A cmaRs Function

Description

This function allows you to construct a CMARS Model.

Usage

cmaRs(
  formula,
  data,
  classification = FALSE,
  threshold.class = 0.5,
  degree = 1,
  nk = 20,
  Auto.linpreds = FALSE
)

Arguments

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.

Value

An S3 model of class "cmaRs"

Examples

## 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)

A plot function designed for prediction of CMARS

Description

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.

Usage

## S3 method for class 'cmaRs'
plot(x, ...)

Arguments

x

A cmaRs object which is obtained by prediction.

...

Additional parameters.

Value

An S3 model of class "plot.cmaRs"

Examples

## 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)

Prediction Data - Concrete Slump Test

Description

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/).

Usage

data(preddata.std)

Format

A data frame with 103 rows and 8 variables.

Source

https://archive.ics.uci.edu/ml/datasets/Concrete+Compressive+Strength

References

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.

Examples

## Not run: 
data(preddata.std)
cmaRs(Compressive_Strength ~ ., classification = FALSE, data = preddata.std)

## End(Not run)

A prediction function for a new data set for prediction purpose

Description

This function allows you to obtain the predicted values of a CMARS model.

Usage

## S3 method for class 'cmaRs'
predict(object, new = NULL, ...)

Arguments

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.

Value

y The predicted values.

Examples

## 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)

A summary function designed for CMARS

Description

This function allows you to print the output of CMARS model.

Usage

## S3 method for class 'cmaRs'
summary(object, ...)

Arguments

object

A cmaRs object which is constructed by cmaRs.

...

Additional arguments affecting the summary result.

Value

An S3 model of class "summary.cmaRs"

Examples

## 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)

Data Set for Table B6

Description

This data set is taken from MPV package (version 1.58). Please check library(MPV) for more detail.

Usage

data(table.b6)

Format

A data frame with 28 rows and 5 variables.

Source

Montgomery, D.C., Peck, E.A., and Vining, C.G. (2001) Introduction to Linear Regression Analysis. 3rd Edition, John Wiley and Sons.

References

(1972) Kinetics of Chlorination of Niobium oxychloride by Phosgene in a Tube-Flow Reactor. Industrial and Engineering Chemistry, Process Design Development, 11(2).

Examples

data(table.b6)